Skip to main content
KSae .1
Associate
February 18, 2020
Question

How to fix the problem "invalid storage class for function"

  • February 18, 2020
  • 1 reply
  • 31381 views

Hello

I'm new to STM32.

The name of the board I am using is NUCLEO-F091RC.

I am using TureStdio and want to use simple I2C communication.

But I get the error in places like MX_GPIO_Init (void).

The function is an automatically generated function so I don't know how to fix it.

Here is a list of errors:

expected declaration or statement at end of input

invalid storage class for function "MX_GPIO_Init"

invalid storage class for function "MX_I2C1_Init"

invalid storage class for function "MX_TIM14_Init"

invalid storage class for function "MX_USART1_UART_Init"

invalid storage class for function "MX_USART2_UART_Init"

0690X00000DBpHvQAL.png

I have attached my project.

Please help me.

1 reply

KnarfB
Super User
February 18, 2020

The "expected declaration or statement at end of input" error means that there is an imbalance of curly braces { } somewhere in your code. The "invalid storage class ..." errors are only inherited from that.

In STM32CubeIDE use right-click > Source > Format to auto-indent your code. This might help spotting the error.

KSae .1
KSae .1Author
Associate
February 19, 2020

Thank you. I will do it immediately.