This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How do I avoid halting the CPU when reading/writing RAM from debugger?

I want to read and write RAM (target=nRF51822) from a custom C application while the CPU is running. Now, I can do this using the nrfjprog.dll and I get the expected values out. Only problem is that the CPU is halted and I can't seem to start it going again (calling the run function does nothing).

If I use the command line tool nfrjprog (as opposed to using the DLL in my own application) I see the same behavior.

If I try to simulate the same read/write behavior using JLink Commander the CPU is not halted and everything works as expected. I could change my application to use the Segger tools directly but that requires purchasing the SDK.

I use the PCA10001 evaluation board for programming the target.

Parents
  • Yes I have tried the things you suggest but they do not start the CPU again. Calling for instance the NRFJPROG_go function I get a SUCCESS error code back but the CPU does not start running again and the function NRFJPROG_is_halted tells me that the CPU is in fact still halted. I get the same result when using the nrfjprog.exe.

    The CPU does not NEED to be halted to read the memory. This can bee seen when using the JLink Commander as I said. So this must be a decision made by the developers of the nrfjprogdll. Would it be possible to have an extra version of NRFJPROG_read that did not halt the CPU?

Reply
  • Yes I have tried the things you suggest but they do not start the CPU again. Calling for instance the NRFJPROG_go function I get a SUCCESS error code back but the CPU does not start running again and the function NRFJPROG_is_halted tells me that the CPU is in fact still halted. I get the same result when using the nrfjprog.exe.

    The CPU does not NEED to be halted to read the memory. This can bee seen when using the JLink Commander as I said. So this must be a decision made by the developers of the nrfjprogdll. Would it be possible to have an extra version of NRFJPROG_read that did not halt the CPU?

Children
Related