views:

74

answers:

2

When I use JTAG to load my C code to evaluation board, it loads successfully. However, when I executed my code from main(), I immediately got "CPU is not halted" error, followed by "No APB-AP found" error.

I was able to load and executed the USB-related code before I got this error.

I googled for it and use JTAG command "rx 0" to reset the target, but it does not make any change.

I am using ARM Cortex-M3 Processor, J-Link ARM V4.14d, IAR Embedded workbench IDE.

Thanks for ur help.

+1  A: 

One possibility: watchdog

If your hardware has a watchdog, then you must ensure that it does not reset the CPU when the JTAG wants to halt it. If the watchdog resets the CPU you would typically get a "CPU not halted" type of error you described.

If the CPU has an internal watchdog circuit, on some CPUs it is automatically "paused" when the JTAG halts the CPU. But on others, that doesn't happen, and you need to ensure the watchdog is disabled while doing JTAG debugging.

If your circuit has a watchdog circuit that is external to the CPU, then typically you need to be able to disable it in some way (typically the hardware designer provides some sort of switch/jumper on the board to do so).

Craig McQueen
A: 

are you re-using the jtag lines as gpio lines and clobbering the jtags ability to communicate with the chip? I bricked a stellaris board that way.

dwelch