Write binary file to external QSPI flash with nrfjprog

Hi,

We need to write binary content from a binary file (.hex or .bin) to a specific area of the external flash (QSPI).

According to this topic:  NRF52840DK:use nrfjprog write a font bin file to external flash, this is similar to our issue.

I have a file called zephyr.recovery.bin.

I want to write the content of this file starting at address 0x1E98000 of the external flash.

Here are the steps I tried:

  • First, I converted the .bin file to .hex with an offset of 0x10000000 (the start of the QSPI memory space), then added my own offset: 0x1E98000.

bin2hex.py --offset 0x11E98000 zephyr.signed.bin zephyr.recovery.hex

  • Then I tried to program the file using this command:

nrfjprog --program zephyr.recovery.hex --recover --verify --log

But I got the following errors:

[ #################### ] 1.158s | Erase file - Done erasing
[error] [ Client] - Encountered error -172: Command program_file executed for 77 milliseconds with result -172
[error] [ nRF53] - Program file parsing failed, program file is invalid!
[error] [ nRF53] - Found data in XIP at address [0x11E98000 - 0x11F34559] that stretches out of XIP area.
[error] [ nRF53] - Failed while reading device information.
[error] [ Worker] - Found data in XIP at address [0x11E98000 - 0x11F34559] that stretches out of XIP area.
ERROR: The file specified is not a valid hex file, has data outside valid areas
ERROR: or does not have data in valid areas.

How should I write the content of my file to the external memory?

Thanks for your help.

Quentin L

Parents Reply
  • The size of the external flash is 32 megabytes. Our file contains raw data, and we don't want to execute the content stored in the external flash.

    The XIP area is only necessary when executing code from external memory, right?

    Currently, we can write our file from the firmware with few tricks, but to simplify our process, we would like to be able to write to the external memory using the debugger. I just want to know if it's possible.

    Thanks,

    Quentin

Children
No Data
Related