[ABANDONED] Enable to download firmware into Nordic nRF52840 chip

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [ABANDONED] Enable to download firmware into Nordic nRF52840 chip

    Hello,

    I'm trying to run my application from Segger Embedded Studio into my custom nordic nRF52840 board but it is not working !
    I'm using SWD interface (VDD, GND, SWDIO, SWDCLK), speed 4 kHz (lowering it didn't help), jlink 6.34b.


    Error I'm getting in Segger IDE :

    Source Code

    1. Preparing target for download
    2. Executing script TargetInterface.resetAndStop()
    3. Reset: Halt core after reset via DEMCR.VC_CORERESET.
    4. Reset: Reset device via AIRCR.SYSRESETREQ.
    5. Downloading ‘s140_nrf52_6.0.0_softdevice.hex’ to J-Link
    6. Programming 2.5 KB of addresses 00000000 — 00000a17
    7. Programming 144.9 KB of addresses 00001000 — 000253c7
    8. J-Link: Flash download: Restarting flash programming due to program error (possibly skipped erasure of half-way erased sector).
    9. J-Link: Flash download: Skip optimizations disabled for second try.

    I switched to Jlink commander to get more details:

    I'm able to connect to the target and read it's infos:




    Source Code

    1. connect
    2. Device "NRF52840_XXAA" selected.
    3. Connecting to target via SWD
    4. Found SW-DP with ID 0x2BA01477
    5. Found SW-DP with ID 0x2BA01477
    6. AP map detection skipped. User manually configured AP map.
    7. AP[0]: AHB-AP (IDR: Not set)
    8. AP[0]: Core found
    9. AP[0]: AHB-AP ROM base: 0xE00FF000
    10. CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
    11. Found Cortex-M4 r0p1, Little endian.
    12. FPUnit: 6 code (BP) slots and 2 literal slots
    13. CoreSight components:
    14. ROMTbl[0] @ E00FF000
    15. ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS
    16. ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 003BB002 DWT
    17. ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB
    18. ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 003BB001 ITM
    19. ROMTbl[0][4]: E0040000, CID: B105900D, PID: 000BB9A1 TPIU
    20. ROMTbl[0][5]: E0041000, CID: B105900D, PID: 000BB925 ETM
    21. Cortex-M4 identified.
    Display All



    I'm able to erase it with "erase all" command or with nrfgo Studio, but when trying to download the firmware with loadbin I get the same error as in Segger IDE


    Source Code

    1. loadbin firmware.bin,0x00000000
    2. Halting CPU for downloading file.
    3. Downloading file [frimware.bin]...
    4. J-Link: Flash download: Restarting flash programming due to program error (possibly skipped erasure of half-way erased sector).
    5. J-Link: Flash download: Skip optimizations disabled for second try.
    6. Error while programming flash: Programming failed.


    And it seems that the jlink is having a hard time switching to another page of the flash memory cause I can see that starting from address 0x00001000 the flash is still empty!
    Starting to write the bin file from page 1 ( loadbin firmware.bin,0x00001000) produce the same behavior : page 2 ( 0x00002000 ) is empty
    Writing bytes directly to the flash seems to work correctly :


    Source Code

    1. J-Link>w4 1000,DEADBEEF
    2. Writing DEADBEEF -> 00001000
    3. J-Link>mem 1000,4
    4. 00001000 = EF BE AD DE

    I put only 6 bytes in the bin file and this worked as expected!


    I noticed that this problem was discussed here but it was more about OS system (I'm using windows 10) and it's 3 years ago ! I believe if it's an issue in segger firmware then most likely it is fixed already ?

    Attache is the logs from Jlink commander.


    Any idea on how to fix this ?

    Chaabane
    thx
    Files
  • Hello,

    Thank you for your inquiry.
    Such an issue is not known to us.
    The J-Link software version you are using in your setup is quite dated.
    Could you give the latest version a try?
    Does the behaviour change?

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.