Error in thumb_crt0.s ?

Comments

4 comments

  • Avatar
    Jon Elliott

    This isn't an error, in the FLASH build the stack is set up when the processor resets by loading the contents at address 0 into the SP.

    Where you may have a problem is if you've re-located the start of FLASH away from address 0 in which case the stack won't be set up.

    Having said that, I believe the latest version of thumb_crt0.s always sets up SP to avoid users falling over this very problem.

    Regards,

    Jon Elliott

    0
    Comment actions Permalink
  • Avatar
    Juraj Vanco

    Thanks for reply.

    I use Rowley's STMicroelectronics STM32F10x CPU Support Package v1.11. Linker places .text section at 0x08000000, so it is not 0x00000000 and that's probably why SP register is not correctly loaded. How to force the linker to place code at address 0x00000000?

    0
    Comment actions Permalink
  • Avatar
    Jon Elliott

    Looking at the release notes, the thumb_crt0.s file was modified to allow SP to be setup correctly when a FLASH application is located away from 0x00000000 at version 2.0.2 of CrossWorks so make sure you're using this version or later.

    The memory map and section placement files are used to place sections in memory, however using the latest version of thumb_crt0.s is the correct fix for this problem, not moving sections around in memory.

    0
    Comment actions Permalink
  • Avatar
    Juraj Vanco

    Thanks a lot, solved now. I am using commercial CW 1.7.22.

    0
    Comment actions Permalink

Please sign in to leave a comment.