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

nrfjprog --program <> --verify fails at certain conditions. nrfjprog --recover only helps

Hi sometimes it happen with my nrf52832 based device. 
The common way I am programming firmware during development is next: 

nrfjprog --program fw.hex --sectorerase --verify --reset --log

At some condition happen i no longer can program firmware this way untll i perform full chip erase by 

nrfjprog --recover



Log:

0486.log.log

Please support

Parents
  • Hi,

    Have you tried something simple as changing the USB cable? We often see that this is a common culprit. Also, are you using a custom board or a development kit. If it's former, could you upload the schematics? I can make the case private first if you prefer it.

    regards

    Jared  

  • Hi Jared,
    It is custom board and unfortunately, I can't share the schematic. I don't have it.
    I have tried many times with different j-link adapters, powercycled, restarted PC, changed cables, reconnected USB hub etc. I know usually it helps.  

    But in this case it doesn't help. After unsuccessful verification i have dumped the flash and realized that only first about 20kB were programmed. That's why verification fails. I also checked BPROT to exclude some protection reason. 
    What is actually helped: 

    nrfjprog --readcode dump.hex
    nrfjprog -e
    nrfjprog --program dump.hex --verify --reset

    after -eraseall now i can write the same firmwase 10+ times and all attempts are successful. 

    My understanding is that --eraseall lead to clear of some peripheral in NRF52  that prevents chip from successful write. 

    Any ideas?


Reply
  • Hi Jared,
    It is custom board and unfortunately, I can't share the schematic. I don't have it.
    I have tried many times with different j-link adapters, powercycled, restarted PC, changed cables, reconnected USB hub etc. I know usually it helps.  

    But in this case it doesn't help. After unsuccessful verification i have dumped the flash and realized that only first about 20kB were programmed. That's why verification fails. I also checked BPROT to exclude some protection reason. 
    What is actually helped: 

    nrfjprog --readcode dump.hex
    nrfjprog -e
    nrfjprog --program dump.hex --verify --reset

    after -eraseall now i can write the same firmwase 10+ times and all attempts are successful. 

    My understanding is that --eraseall lead to clear of some peripheral in NRF52  that prevents chip from successful write. 

    Any ideas?


Children
Related