Skip to main content
Associate II
January 31, 2026
Question

Error when enabling I2C interrupt in STM32G030F6P6

  • January 31, 2026
  • 2 replies
  • 192 views

STM32G030F6P6 microcontroller CubeIDE environment when enabling interrupt for I2C an LL_I2C_EnableIT_RX (I2C2); error occurs
_______stm32g030xx.h:618:29: error: expected declaration specifiers or '...' before '(' token

Viktro_0-1769885819361.png

error occurs when any I2C interrupt is enabled

 

2 replies

TDK
Super User
January 31, 2026

There are no errors in the code you posted.

If you encounter errors in CubeMX generated code, please include the IOC file used to generate that code.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Technical Moderator
February 3, 2026
"To give better visibility on the answered topics, please click on ""Accept as Solution"" on the reply which solved your issue or answered your question.Saket_Om"
ViktroAuthor
Associate II
February 3, 2026

thanks for the answers. further analysis of the problem I voiced showed that in an empty project with the same configuration, enabling interrupts does not cause an error. Only when I add the library for working with lsm303dlch. I will look into it further.