Failed to resume target process. Not allowed to access registers while running

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Failed to resume target process. Not allowed to access registers while running

1,719 Views
beng_
Contributor III

I'm struggling to debug my target device. I'm using a Segger J-Link and connectign via JTAG

Sometimes the app downloads and runs to my first break-point without a hitch. However sometimes when launching a debug session Codewarior will come up with an error.

"Failed to resume target process.
Not allowed to access registers while running"

I'm then stuck and can't debug my target anymore. I can eventually manage to get debug working again via a combination of connecting via J-Flash  erasing the device and power cycling both my target and the j-link. However I haven't yet worked out what combination gets things working again.

What causes the error "Not allowed to access registers while running" to occur (other than the obvious that the J-Link can't access the registers). Is the J-Link unable to stop the target or something?

Any help appreciated.

Labels (1)
0 Kudos
4 Replies

959 Views
davidpotter
Contributor I

I had a very similar or the same problem. Using a custom board with a MK20FX512xxx12 MCU,

I got the device flashed as follows:

Tool bar --> Run --> left button click-->  select Debug Configurations-->Edit Target Settings-->Edit Target and

checked Execute on reset, and un-checked Run out of Reset and unchecked Iniitalize target.

I think the main change that made the difference was NOT using the initialization script,

$ProjDirPath/Project_Settings/Debugger/init_kinetis.tcl. I haven't examined exactly is the problem other than certain registers that the script was trying to access were not available while the processor was running. You can see some

evidence of this in the following log message when flashing:


Starting 3rd party flash programming...
INF:
Jlink: CPU could not be haltedINF:
Jlink: CPU could not be haltedINF:
Jlink: Timeout while checking target RAM, RAMCode did not respond in time
Failed to prepare for programming.
Failed to execute RAMCode for RAM check!
Can not read register 16 (XPSR) while CPU is running
Can not read register 20 (CFBP) while CPU is runnin
Starting 3rd party flash programming...
INF:

I haven't examined the .tcl script to see which of those errors or which error in general killed the flashing.

Two more things. I did NOT halt the CPU via the Jlink commander window. I am using a Jlink Segger Plus.

Would be nice to get a deeper understanding of what elements of debugging are failing. But for now, I am

happy to move forward getting useful coding loaded onto the board

0 Kudos

959 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello David,

So does your project can work well now ?

If it still can't debug , please configure the debug configuration as this thread :

http://mcuoneclipse.com/2014/04/20/using-the-frdm-k64f-with-codewarrior/ 

BR

Alice

0 Kudos

959 Views
beng_
Contributor III

A workaround I've found is use j-Link command to halt the target and then debug via codewarrior. Not ideal.

0 Kudos

959 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Ben,

Does all the project have this problem or only the one ?

Could you please test a simple project.

If all have the problem, please tell me which board and the CW version .

There is a similar case , maybe you can also refer to :

https://community.nxp.com/thread/328870 

BR

Alice

0 Kudos