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

Using nrfjprog to program application does not work

I'm developing an application on a custom nRF52 board. I have no problem to program the board with Keil. However when I try to program the application with the nrfjprog, the application won't run. What is the correct procedure to program with nrfjprog?

Below is my command line log:

$ nrfjprog -f NRF52 --program nrf52832_xxaa_s132.hex --sectorerase
Parsing hex file.
Erasing page at address 0x1C000.
Erasing page at address 0x1D000.
Erasing page at address 0x1E000.
Erasing page at address 0x1F000.
Erasing page at address 0x20000.
Erasing page at address 0x21000.
Erasing page at address 0x22000.
Erasing page at address 0x23000.
Erasing page at address 0x24000.
Applying system reset.
Checking that the area to write is not protected.
Programing device.

$ nrfjprog -f NRF52 --reset
Applying system reset.
Run.
Parents
  • my usual steps:

    nrfjprog -f NRF52 --program SOFTDEVICE.hex --chiperase --verify
    nrfjprog -f NRF52 --program APPLICATION.hex --verify
    nrfjprog -f NRF52 --reset

    It does look like your commands are correct though. Just make sure the Softdevice is programmed properly or else your BLE application won't run correctly.

    Using --sectorerase when programming your application will allow you to program the SoftDevice once and then continue to program your APPLICATION.hex as it changes without having to always reload the SoftDevice. My recommendation is to try the commands I listed above first though. Lets verify that atleast works so we can localize the problem. If that works then try the --sectorerase command again.

  • Looks like "nrfjprog -f NRF52 --reset" could not run the application. However by following the below steps, I can get the app running:

    After flashing the softdevice and application with nrfjprog, go to Keil and open the 'Options for Target' dialog, in the Debug tag click the Settings button next to 'Use J-LINK/J-TRAce Cortex'. After the SW Device is detected just close the dialog. Then my application is running.

    Any idea why nrfjprog --reset does not work?

Reply
  • Looks like "nrfjprog -f NRF52 --reset" could not run the application. However by following the below steps, I can get the app running:

    After flashing the softdevice and application with nrfjprog, go to Keil and open the 'Options for Target' dialog, in the Debug tag click the Settings button next to 'Use J-LINK/J-TRAce Cortex'. After the SW Device is detected just close the dialog. Then my application is running.

    Any idea why nrfjprog --reset does not work?

Children
No Data
Related