Hallo
When I try to start the debugger, the application get flashed and the debugger starts. If I hit Run, the execution ends in the PAbt_Handler in the StartUp.s. Stopping the debugger, reset cpu and then run again makes the application run to main and the rest of the program. If I step through the startup.s file, it jumps to the PAbt handler after the BX R0!!
IMPORT __main LDR R0, =__main BX R0
Sometimes I do have to re-flash to get it to run right.
I use cross module optimization and MicroLIB. Im using uVision 4.03 and MDK-ARM 4.10. The MCU is a LPC2131 Running the application without the debugger (no JTAG) it starts and run every time...
Any idea what could be the problem?
After the jump to main in the startup.s file, there is some heap init stuff. It seems never to be called?
IMPORT __main LDR R0, =__main BX R0 IF :DEF:__MICROLIB EXPORT __heap_base EXPORT __heap_limit ELSE ; User Initial Stack & Heap AREA |.text|, CODE, READONLY IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + USR_Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ENDIF
/Thomas
I don't work with a Cortex yet, but I think you can solve this by powering the peripherals you need in your program entry point, while building the program with all peripherals powered off (that should be an option in the startup file editor). In a device like a LPC2400, the register I refer to is called PCONP.