This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problem running from debugger

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