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