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

nrfjprog.dll - nrfjprogdll_go not starting SoC

Hi

I used nrfjprog.dll in our internal software. implementation is in C#.

Everything works just fine - except for the last call to NRFJPROGDLL_go - it seems like it starts the proc for a couple mseccs, then it returns to halted state.

If I call it from command line (nrfjprog -f nrf51 --run) everything is fine and the device starts to work...

Is there any more detailed information on how the commands --run and --go are implemtend in nrfjprog?
I already had a look pynrfjprog but this does not give any insight on this issue.

I'm usijng the latest version of nrf command line tools.

Any hints?

  • Do you perform any actions after _go() ? Some functions in the nRFJProg DLL halt the processor to ensure data integrity.

    If possible, could you post the nRFJProg log, or a pseudocode of your script?

  • Hi

    pseudo code below:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    void flashingDevice(){
    NRFJProg.NRFJPROG_open_dll ();
    NRFJProg.NRFJPROG_is_dll_open( ref open );
    if(open){
    NRFJProg.NRFJPROG_is_connected_to_emu( ref connected );
    if(!connected){
    NRFJProg.NRFJPROG_connect_to_emu_without_snr( 8000 );
    NRFJProg.NRFJPROG_read_connected_emu_snr( ref serial );
    NRFJProg.NRFJPROG_connect_to_device();
    // GET SOME DEVICE INFOS
    NRFJProg.NRFJPROG_is_connected_to_device( ref deviceConnected );
    if ( deviceConnected ) {
    NRFJProg.NRFJPROG_halt();
    Thread.Sleep( 200 );
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Ah, you're protecting, then doing go?

    You should perform a debug reset instead, this will reset your device and start the program. Since you've enabled readback protection, the go probably fails, as you no longer have access to the core.

  • currently I'm not setting protection, this was also one of my first thoughts.

    should I do a debug_reset instead of sys_reset anyways?

  • If you're not protected you should be able to do a sysreset, but a debug reset is mostly equivalent, and should always work.

    After programming you should at least reset the device to make sure your program counter and stack pointers are read correctly.

1 2