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

How to program softdevice and firmware with new nrfjprog

Hi,

I used the old nrfjprog like this:

nrfjprog --eraseall --dfu --programs s130_softdevice_whatever.hex --program my_firmware.hex

Which worked fine. I've now updated to the new version with different options. What is the equivalent command? This works, but doesn't flash the softdevice:

nrfjprog --program my_firmware.hex --chiperase

Also I noticed in the new mBed code there are some bootloader hex files. What exactly does the bootloader do? Do I need it? (I never used it before and it worked fine.)

Parents
  • Hi Tim,

    I've faced similar problem when upgraded to nRFTools v7.x - all my scripts suddenly stopped working. However when you let nrfjprog print help into the command line you will get it fixed quickly. Probably the main change is that flashing with more than one binary is not supported any more. You should use mergehex program (included in nRFTool bundle) instead. Another notable changes are:

    • Read-back protection cannot be removed by --chiperase any more (at least on nRF51) but you need to use separate command --recover.
    • Each call can now specify chip family by using -f <family> or --family <family> switch where family is either NRF51 or NRF52. However it has default value (NRF51) set in nrfjprog.ini file so you probably don't care until you switch to nRF52.

    Here is example of part of my flashing script (if anyone has shortcut to safe some calls I'll be interested to hear because I was unable to simplify it so far):

    mergehex -m %SOFTDEVICE_NAME% %APP_NAME% -o %MERGE_NAME%
    nrfjprog --recover -f NRF51
    nrfjprog --program %MERGE_NAME% --verify --chiperase -f NRF51
    nrfjprog --rbp ALL -f NRF51
    nrfjprog -r -f NRF51
    

    Cheers Jan

Reply Children
No Data
Related