Skip to main content
Visitor II
July 16, 2024
Question

Error faced in error handler generated code

  • July 16, 2024
  • 1 reply
  • 1609 views

Hey! I am beginner with stm32cube ide. I was doing a simple interrupt push button with nvic. I had cross checked all of my initialisations with other posts over here and they matched. I am facing an error while building the project. The error says "expected indendent or statement at end of input" for the error handler function generated by by stm32. The same code for error handler was generated when I tried for simple led blinking but no error faced there.

There seems to be no indendent error when checked. Also i did not understand the statement at end of input part of the error

Any idea how I could solve this issue.

Your responses would help a ton!!

beginner_0-1721136300522.png

beginner_1-1721136340587.png

 

 

    1 reply

    Andrew Neil
    Super User
    July 16, 2024

    @beginner wrote:

    Hey! I am beginner with stm32cube ide. 


    Do you have experience with any other IDEs? With C programming in general?

     

    Please see the posting tips for how to properly post source code:

    https://community.st.com/t5/community-guidelines/how-to-write-your-question-to-maximize-your-chances-to-find-a/ta-p/575228

    It's best to do the same for posting error messages, too.

     


    @beginner wrote:

    The error says "expected indendent or statement at end of input"


    No, it says, "expected declaration or statement..."

    AndrewNeil_0-1721136569737.png

    This probably means that you have missed a closing brace, or made some similar mistake somewhere earlier in the file.

    Your code screenshot does show something at line 162:

    AndrewNeil_1-1721136805948.png

     


    @beginner wrote:

    Also i did not understand the statement at end of input part of the error


    It means that the compiler has come to the end of your file, but it doesn't make sense for the file to end there - there should be something else (a declaration or a statement) following

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.