Imported IAR project failed: startup_stm32f401xe.c errors

Sysprogs forums Forums VisualGDB Imported IAR project failed: startup_stm32f401xe.c errors

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #20409
    Vlad
    Participant

    Hi, the project from STM32CubeF4  built for IAR  IDE was imported and one missing header was added but consequent build failed. See screenshot .

    Looks like one single problem caused this : a collision between the EWARM/startup_stm32f401xe.s from STM distribution  and the same named file object from com.sysprogs.arm.stm32  . Double click on the error line brings up the com.sysprogs.arm.stm32 version of startup_stm32f401xe.c file with 131 errors all related to invalid conversion or “aliased to undefined symbol” in that file.

    what is the best way to fix this? To remove Linker flags which brings in that failing startup object ?? Will EWARM startup object work well for VGDB ?

    Attachments:
    You must be logged in to view attached files.
    #20411
    Vlad
    Participant

    This reported problem has been fixed by importing anew the same project with checked <span style=”text-decoration: underline;”>“exclude the startup file from project”</span> in the device selection window. Missing headers were added by clicking ADD and project was built successfully with no errors the blinking GPIO example from STM32F4Cube distribution for STM32F401RE-Nucleo board.

    But download to target and running fail in both configurations.

    Running DEBUG configuration message: “Warning: could not set a breakpoint on main. ‘Step into new instance” will not work “. Execution stopped outside of the “main” memory stack so VGDB could not help showing the stack content.

    All debug stepping toolbar commands are dimmed. LED on the Nucleo board shows that communication with PC is in process. When DEBUG session stopped Nucleo LED shows communication with PC is finished but user LED is not blinking as expected from the downloaded program. Clearly program was downloaded to target but failed to run.

    When executing “Program and Start without debugging” – program gets downloaded as shown by the board’s ST-LINK LED and download finishes, but user LED does not blink as expected.

    Apparently executable was not built properly. Please help.

    • This reply was modified 6 years, 2 months ago by Vlad.
    #20424
    support
    Keymaster

    Hi,

    The original problem is most likely caused by the unexpected error settings (normally conversion from a function pointer to a function should not cause any errors). The easiest workaround would be to simply patch the file manually by replacing “&” with “(void *)&” in that block of text.

    By removing the startup file from the project you have likely removed the entry point, so the program indeed won’t start. Please try restoring the startup file.

    #20432
    Vlad
    Participant

    “Invalid conversion” fixed as per your advice. 65 errors left  “aliased to undefined symbol” .. See screenshot. Looks like confusing syntax.  Default handler() function is indeed declared and defined in the same file.

    If  macro DEBUG_DEFAULT_INTERRUPT_HANDLERS were defined (see 2nd screenshot), then above error producing lines would not be included for compilation within ifdef…else…  statement:)

    • This reply was modified 6 years, 2 months ago by Vlad.
    Attachments:
    You must be logged in to view attached files.
    #20436
    Vlad
    Participant

    When I added macro DEBUG_DEFAULT_INTERRUPT_HANDLERS to C/C++ preprocessor (useful for DEBUG configuration only, not good for release), all above “invalid conversion” errors vanish, new 3 errors came up – see attachment.

    “Multiple definitions” of Reset_Handler and Default_Handler could be a result of two files with the same name: startup_stm32f401xe.c from STM32Cube distribution and from sysprogs.  Is it so?

    And the last line “ld returned 1 exit status” from collect2.exe file   ?

    Attachments:
    You must be logged in to view attached files.
    #20440
    support
    Keymaster

    Hi,

    Looks like you are using both our startup file and the original assembly startup file (.S). Please try excluding the original one from the project.

    If the resulting project doesn’t work, please try setting a breakpoint on the Reset_Handler() function and step through it. It should help understand what is going on.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.