nrfjprog flash write placement when using --reset option

Hi All, 

I was trying to upload the latest revision of some code i wish to verify before pushing to production and was using the command line to generate the bootloader settings and mergehex files. For some reason, when i tried to flash the final image (softdevice s132 v 6.1.1, bootloader, bl_settings, and app) the app file was placed incorrectly it seems and i don't think the application code was ever reached. Attached is a screenshot after reading from the nrf connect programmer app (nrfjprog flash error.png)

The command format I used is as follows:

"path to file i want to flash "> nrfjprog --program image_file.hex --chiperase --reset

When I program the part using the nrfconnect programmer app everything works fine however and the application looks like it resides exactly where it should.

UPDATE: i also tried flashing again from the command line but without the "--reset" option. for some reason this works just fine. but I'd like to leave the post up to see why the --reset option makes a difference here. When I select "auto-reset" in the nrf connect programmer app everything ends up in the right place when writing, why would nrfjprog work differently? a screenshot of the image when flashed using nrf connect programmer is attached (nrfjprog flash correct.png)

Thanks, 

Patjshan

  • Hi,

    Could you please provide more information about the pictures - what each one of them represent, which of them are correct and which not?

    Best regards,
    Dejan

  • sorry for the delay, for some reason I do not get notification/emails when my post has been responded to. The lower picture (name: nrfjprog-flash-error.png if you open in a new tab) is a screenshot of the flash layout after programming with nrfjprog using the --reset option to reset the chip automatically after programming. As you can see the application data has been offset from its intended position by quite a bit. 

    Alternatively the picture first picture (name: nrfjprog-flash-correct.png) shows the same board but after erasing the flash on the chip and using nrfjprog without the --reset option and you can see the application data is in the correct place just above the softdevice

  • Hi,

    In nRF5 SDK, there are flash page tags used with Flash Data Storage. Page tags are written when FDS is first initialized and additional data is written on the first boot. 
    It is recommended to have "Auto reset" ON when using Programmer application, as this prevents CPU from halting.

    Best regards,
    Dejan

  • I'm confused about how exactly this is effecting my issue. To be clear I only used the nrf connect programmer tool to read and capture the screenshots. Writing to the chip was done from the command line using nrfjprog.

    can you explain more in depth how the flash page tags are being affected by the "--reset" option from the command line? when I leave this option out the hex file seems to load just fine but with it my application hangs.

  • Hi,

    You might be right as application data is usually added just below the bootloader.

    Regarding the issue, I have tested it myself. 
    First, I wrote hex file using Programmer application. Afterwards, I used nrfjrog to program the board using the same command that you provided (with --reset option).
    I have not seen the problem that you described. 

    Best regards,
    Dejan

Related