[nRF52840dk] nrfjprog always reading external flash least significant bit as 0

I'm trying to use nrfjprog to read and write the mx25r6435f external flash on the nRF52840dk board (I have version 3.0.0). However, what I am noticing is that nrfjprog always reads the least significant bit of every byte as 0. For example:

$ nrfjprog --erasepage 0x12000000-0x12000004
WARNING: An address for the --erasepage operation is not aligned to the start
WARNING: of page.
Initializing the QSPI peripheral.
Erasing range [0x00000000 - 0x00000FFF] in the external memory device.
Uninitializing the QSPI peripheral.

and then immediately after:

nrfjprog --memrd 0x12000000 --log
[ #####                ]   0.000s | Reading external memory, 0x0004 bytes @ 0x00000000 - 0x00
[                      ]   0.000s | Reading external memory, 0x0004 bytes @ 0x00000000 - 0x00
[ #################### ]   0.000s | Reading external memory, 0x0004 bytes @ 0x00000000 - Done
0x12000000: EEEEEEEE

The read always returns with each byte having a 0 as the least significant bit. This also happens when I try to program the external flash. The erase works successfully, the write works successfully, but the verify (read) "fails" because nrfjprog thinks the LSB is 0.

I've run code on the nrf that reads the flash and it reads correctly (after erase it is all 0xff and after programming with nrfjprog I get the expected values.

My programming:

cat a.bin
hello from tock flash

arm-none-eabi-objcopy -v -I binary -O ihex --change-addresses 0x12000000  a.bin a.hex
nrfjprog --qspichiperase --program a.hex

Is this a known issue? What can I do?

Debugging

I've tried every version of nrfjprog back to 10.12.1. Through 10.13 I see the same issue. At 10.12.1 it seems I can no longer read the flash, probably because I have a newer version of the nRF52840-dk.

My Setup

I'm on MacOS Ventura (13.3.1a).

Parents
  • I tried on windows with three nrf52840dks:

    C:\Windows\System32>nrfjprog --version
    nrfjprog version: 10.18.1 external
    JLinkARM.dll version: 7.82a

    1.1.0 (2019.12):

    C:\Windows\System32>nrfjprog --memrd 0x12000000
    [ #####                ]   0.000s | Reading external memory, 0x0004 bytes @ 0x00000000 - 0x0000 of 0x0004       
    [                      ]   0.000s | Reading external memory, 0x0004 bytes @ 0x00000000 - 0x0000 of 0x0004       
    [ #################### ]   0.000s | Reading external memory, 0x0004 bytes @ 0x00000000 - Done
    
    0x12000000: FFFFFFFF                              |....|

    2.0.1 (2020.14):

    C:\Windows\System32>nrfjprog --memrd 0x12000000
    [ #####                ]   0.000s | Reading external memory, 0x0004 bytes @ 0x00000000 - 0x0000 of 0x0004       
    [                      ]   0.000s | Reading external memory, 0x0004 bytes @ 0x00000000 - 0x0000 of 0x0004       
    [ #################### ]   0.000s | Reading external memory, 0x0004 bytes @ 0x00000000 - Done
    
    0x12000000: FFFFFFFF                              |....|

    3.0.0 (2022.36):

    C:\Windows\System32>nrfjprog --memrd 0x12000000
    [ #####                ]   0.000s | Reading external memory, 0x0004 bytes @ 0x00000000 - 0x0000 of 0x0004       
    [                      ]   0.000s | Reading external memory, 0x0004 bytes @ 0x00000000 - 0x0000 of 0x0004       
    [ #################### ]   0.000s | Reading external memory, 0x0004 bytes @ 0x00000000 - Done
    
    0x12000000: EEEEEEEE                              |....|

    That points to something about the change to the 3.0.0 revision of the nrf52840dk.

  • Hi,

    That is interesting. However, I have not been able to reproduce on a nrf52840 DK version 3.0.0 either. Can you try downgrading Segger J-Link to 7.80c which is the version we curently support with the lates nRF Command Line tools?

  • I just tried with a different nrf52840dk 3.0.0 (2022.36) on Mac:

    $ nrfjprog --qspieraseall
    WARNING: An operation that can take up to several minutes is being executed.
    WARNING: Please remain patient.
    Initializing the QSPI peripheral.
    Erasing.
    Uninitializing the QSPI peripheral.
    $ nrfjprog --version
    nrfjprog version: 10.17.3 external
    JLinkARM.dll version: 7.80c
    $ nrfjprog --memrd 0x12000000 --log
    0x12000000: EEEEEEEE                              |....|

    Same behavior.

Reply
  • I just tried with a different nrf52840dk 3.0.0 (2022.36) on Mac:

    $ nrfjprog --qspieraseall
    WARNING: An operation that can take up to several minutes is being executed.
    WARNING: Please remain patient.
    Initializing the QSPI peripheral.
    Erasing.
    Uninitializing the QSPI peripheral.
    $ nrfjprog --version
    nrfjprog version: 10.17.3 external
    JLinkARM.dll version: 7.80c
    $ nrfjprog --memrd 0x12000000 --log
    0x12000000: EEEEEEEE                              |....|

    Same behavior.

Children
No Data
Related