2008-05-08 11:44 PM
Problem with stack pointer initialization.
2011-05-17 12:50 AM
Hi
I am using IAR Embedded Workbench Evaluation for ARM 4.41A with ST lib v2 on STR910-EVAL board. I've made a project of the uart example distributed with the library, but now I experience a problem with stack pointer initialization in 91x_init.s. Code is loaded in flash and debugged from the IAR IDE using J-Link. If I single-step through the code, the stack pointers are initialized correctly. If I run the code at full speed up to 'main()', then stack pointers are not intialized correctly. I can see from the disassembly that the instructions are correct and that the data literals to be loaded in the stack pointers are correct based on linker output. The values ending in the stack pointers are just not the correct ones. If I move the init of RAM to before the FMI configuration, I can run the code at full speed and stack pointer initialization works OK. The problem seems not to be related to the debugging process because the behaviour is the same if I run without debugging - if I leave RAM init in its default place software doesn't work, if I move it software works. Riaan2011-05-17 12:50 AM
Hi,
What's the revision of silicon you are using. If it's Rev D, in this case you need to change the following line in the 91x_init.s file: LDR R7, = 0x19 ; Enable Both banks by: LDR R7, = 0x18 ; Enable Both banks Rgds,2011-05-17 12:50 AM
Hi,
I have similar problem. If I load code to the flash using J-Link and run - application works correctly. When I start my application without J-Link I get Undefined Handler. The problem seems as bad stack pointer initialization. By the J-Link I see, that all stacks are overloaded. I using EWARM5.1x with STlib v2 and STR912FA44X6 rev G. I dont have this trouble at version EWARM4.41 with STlib v1.2. Best regards Maca2011-05-17 12:50 AM
Could you share your linker and startup files(*.s,*.icf).
Rgds2011-05-17 12:50 AM
Startup and linker files I taked from examples...
2011-05-17 12:50 AM
I saw that you didn't use the latest version.
Try the attached ones2011-05-17 12:50 AM
With new version of startup files it is possible only single-step through code by J-link. If I run the code, I get Abort Handler.