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

flash nrf52832 using command line differs from flashing via segger

Hello all

currently I am flashing the device using command line:

#erase chip
nrfjprog --family NRF52 --recover
#program softdevice
nrfjprog --family NRF52 --program .\firmware-img\s132_nrf52_6.1.1_softdevice.hex --chiperase
#program bootloader
nrfjprog --family NRF52 --program ..\nRF5_SDK_15.2.0_9412b96\examples\dfu\secure_bootloader\pca10040_ble\ses\Output\Release\Exe\secure_bootloader_ble_s132_pca10040.hex
#program software
nrfjprog --family NRF52 --program .\Project-nRF52832\Output\Debug\Exe\BLE-nRF52832.hex
#reset chip
nrfjprog.exe --family NRF52 --reset

software uploads, but FOTA process fails

however, if after that process I flash the application software only via JTAG, then power board on\off, and then performing FOTA all works fine

this is the output while flashing using segger (notice content already match so no software is being downloaded):, please advice 

Preparing target for download
Executing script TargetInterface.resetAndStop()
Reset: Halt core after reset via DEMCR.VC_CORERESET.
Reset: Reset device via AIRCR.SYSRESETREQ.
Downloading ‘s132_nrf52_6.1.0_softdevice.hex’ to J-Link
Programming 2.3 KB of addresses 00000000 — 00000967
Programming 144.8 KB of addresses 00001000 — 0002536b
J-Link: Flash download: Bank 0 @ 0x00000000: Skipped. Contents already match
Download successful
Downloading ‘BLE-nRF52832.elf’ to J-Link
Programming 67.0 KB of addresses 00026000 — 00036c2f
Programming 0.0 KB of addresses 00036c30 — 00036c33
Programming 0.0 KB of addresses 00036c34 — 00036c47
Programming 11.2 KB of .rodata addresses 00036c48 — 0003996f
Programming 0.1 KB of addresses 00039970 — 00039a33
J-Link: Flash download: Bank 0 @ 0x00000000: 1 range affected (4096 bytes)
J-Link: Flash download: Total time needed: 0.391s (Prepare: 0.126s, Compare: 0.069s, Erase: 0.031s, Program: 0.071s, Verify: 0.001s, Restore: 0.089s)
Download successful
Connecting ‘J-Link’ using ‘USB’
Connecting to target using SWD
Loaded C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 4.12/bin/JLink_x64.dll
Firmware Version: J-Link OB-SAM3U128-V2-NordicSemi compiled Jan 7 2019 14:07:15
DLL Version: 6.40`
Hardware Version: V1.00
Target Voltage: 3.300
Device "NRF52832_XXAA" selected.
Found SW-DP with ID 0x2BA01477
Found SW-DP with ID 0x2BA01477
Scanning AP map to find all available APs
AP[2]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x24770011)
AP[1]: JTAG-AP (IDR: 0x02880000)
Iterating through AP map to find AHB-AP to use
AP[0]: Core found
AP[0]: AHB-AP ROM base: 0xE00FF000
CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
Found Cortex-M4 r0p1, Little endian.
FPUnit: 6 code (BP) slots and 2 literal slots
CoreSight components:
ROMTbl[0] @ E00FF000
ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS-M7
ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 003BB002 DWT
ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB
ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 003BB001 ITM
ROMTbl[0][4]: E0040000, CID: B105900D, PID: 000BB9A1 TPIU
ROMTbl[0][5]: E0041000, CID: B105900D, PID: 000BB925 ETM
Preparing target for download
Executing script TargetInterface.resetAndStop()
Reset: Halt core after reset via DEMCR.VC_CORERESET.
Reset: Reset device via AIRCR.SYSRESETREQ.
Downloading ‘s132_nrf52_6.1.0_softdevice.hex’ to J-Link
Programming 2.3 KB of addresses 00000000 — 00000967
Programming 144.8 KB of addresses 00001000 — 0002536b
J-Link: Flash download: Bank 0 @ 0x00000000: Skipped. Contents already match
Download successful
Downloading ‘BLE-nRF52832.elf’ to J-Link
Programming 67.0 KB of addresses 00026000 — 00036c2f
Programming 0.0 KB of addresses 00036c30 — 00036c33
Programming 0.0 KB of addresses 00036c34 — 00036c47
Programming 11.2 KB of .rodata addresses 00036c48 — 0003996f
Programming 0.1 KB of addresses 00039970 — 00039a33
J-Link: Flash download: Bank 0 @ 0x00000000: Skipped. Contents already match
Download successful

Parents
  • Hi.

    software uploads, but FOTA process fails

     How did you create your firmware packet? What does it contain?

    Best regards,

    Andreas

  • I created the package using command line, it contains application generated by segger. the FOTA works perfectly if I flash the application using segger, but if I flash the application using command line, all works but FOTA fails 

  • Hi.

    Which command did you use in the command line? Can you share it with me?

    What does your application contain?

    Please explain more in detail.

    Best regards,

    Andreas

  • Hello

    I am using the "secure_bootloader\pca10040_ble" + software based on "ble_app_buttonless_dfu" + "s132_nrf52_6.1.1_softdevice.hex"

    script to flash software:

    #erase chip
    nrfjprog --family NRF52 --recover
    #program softdevice
    nrfjprog --family NRF52 --program .\firmware-img\s132_nrf52_6.1.1_softdevice.hex --chiperase
    #program bootloader
    nrfjprog --family NRF52 --program ..\nRF5_SDK_15.2.0_9412b96\examples\dfu\secure_bootloader\pca10040_ble\ses\Output\Release\Exe\secure_bootloader_ble_s132_pca10040.hex
    #program software
    nrfjprog --family NRF52 --program .\Project-nRF52832\Output\Debug\Exe\BLE-nRF52832.hex
    #reset chip
    nrfjprog.exe --family NRF52 --reset

    flash works, but when I am committing FOTA, FOTA failes.

    however, if I reprogram device application only ("ble_app_buttonless_dfu") using segger, power device on\off, from that point on flashing using FOTA works

    what am I missing?

    log from flashing using segger:

    Preparing target for download
    Executing script TargetInterface.resetAndStop()
    Reset: Halt core after reset via DEMCR.VC_CORERESET.
    Reset: Reset device via AIRCR.SYSRESETREQ.
    Downloading ‘s132_nrf52_6.1.0_softdevice.hex’ to J-Link
    Programming 2.3 KB of addresses 00000000 — 00000967
    Programming 144.8 KB of addresses 00001000 — 0002536b
    J-Link: Flash download: Bank 0 @ 0x00000000: 1 range affected (155648 bytes)
    J-Link: Flash download: Total time needed: 2.854s (Prepare: 0.053s, Compare: 0.032s, Erase: 0.096s, Program: 2.658s, Verify: 0.004s, Restore: 0.008s)
    Download successful
    Downloading ‘BLE-nRF52832.elf’ to J-Link
    Programming 67.0 KB of addresses 00026000 — 00036c2f
    Programming 0.0 KB of addresses 00036c30 — 00036c33
    Programming 0.0 KB of addresses 00036c34 — 00036c47
    Programming 11.2 KB of .rodata addresses 00036c48 — 0003996f
    Programming 0.1 KB of addresses 00039970 — 00039a33
    J-Link: Flash download: Bank 0 @ 0x00000000: Skipped. Contents already match
    Download successful

Reply
  • Hello

    I am using the "secure_bootloader\pca10040_ble" + software based on "ble_app_buttonless_dfu" + "s132_nrf52_6.1.1_softdevice.hex"

    script to flash software:

    #erase chip
    nrfjprog --family NRF52 --recover
    #program softdevice
    nrfjprog --family NRF52 --program .\firmware-img\s132_nrf52_6.1.1_softdevice.hex --chiperase
    #program bootloader
    nrfjprog --family NRF52 --program ..\nRF5_SDK_15.2.0_9412b96\examples\dfu\secure_bootloader\pca10040_ble\ses\Output\Release\Exe\secure_bootloader_ble_s132_pca10040.hex
    #program software
    nrfjprog --family NRF52 --program .\Project-nRF52832\Output\Debug\Exe\BLE-nRF52832.hex
    #reset chip
    nrfjprog.exe --family NRF52 --reset

    flash works, but when I am committing FOTA, FOTA failes.

    however, if I reprogram device application only ("ble_app_buttonless_dfu") using segger, power device on\off, from that point on flashing using FOTA works

    what am I missing?

    log from flashing using segger:

    Preparing target for download
    Executing script TargetInterface.resetAndStop()
    Reset: Halt core after reset via DEMCR.VC_CORERESET.
    Reset: Reset device via AIRCR.SYSRESETREQ.
    Downloading ‘s132_nrf52_6.1.0_softdevice.hex’ to J-Link
    Programming 2.3 KB of addresses 00000000 — 00000967
    Programming 144.8 KB of addresses 00001000 — 0002536b
    J-Link: Flash download: Bank 0 @ 0x00000000: 1 range affected (155648 bytes)
    J-Link: Flash download: Total time needed: 2.854s (Prepare: 0.053s, Compare: 0.032s, Erase: 0.096s, Program: 2.658s, Verify: 0.004s, Restore: 0.008s)
    Download successful
    Downloading ‘BLE-nRF52832.elf’ to J-Link
    Programming 67.0 KB of addresses 00026000 — 00036c2f
    Programming 0.0 KB of addresses 00036c30 — 00036c33
    Programming 0.0 KB of addresses 00036c34 — 00036c47
    Programming 11.2 KB of .rodata addresses 00036c48 — 0003996f
    Programming 0.1 KB of addresses 00039970 — 00039a33
    J-Link: Flash download: Bank 0 @ 0x00000000: Skipped. Contents already match
    Download successful

Children
Related