NRF52840DK:use nrfjprog write a font bin file to external flash

Hi, sir

I have a bin font file for LVGL to display Chinese, I want to burn this file to the external flash of nrf52840DK by nrfjprog, how should I do it?
I have tried nrfjprog -f NRF52 --program myFont.bin --qspichiperase --verify, but it returns

I tried nrfjprog --readqspi and the generated bin file is completely empty

How should I read the content in external flash?

  • Hello,

    Programming .bin files using nrfjprog is a bit limited, since .bin files doesn't have any means of addressing. Hence it is only possible to write .bin files to address 0x00000000 (the start of the flash on the nRF), so that will not work. I see you added the --qspieraseall, so that will erase the QSPI flash, but not write to it.

    Since there is currently no option to write a .bin file with an offset, I suggest you download bin2hex.py (pip install bin2hex), and use the following method:

    bin2hex.py --offset 0x12000000 bin_file.bin hex_file.hex
    nrfjprog --qspieraseall
    nrfjprog --program hex_file.hex --verify
    nrfjprog --verify hex_file.hex

    This will convert the content of bin_file.bin to a hex_file.hex, and all the data is offset with 0x12000000, which is the start address of the QSPI flash. After that you can program it as if it was an ordinary hex file, and nrfjprog will program it into the external QSPI. 

    Give it a go and let me know if it doesn't work.

    Best regards,

    Edvin

Related