How to find where the flash crashlog is stored ( NRF_LOG_BACKEND_FLASH_START_PAGE = 0)?

Hello,

I use nrf52832 and SDK 17.0.2.

I use flash crashlog to store crash log on the flash.

I enabled  NRF_LOG_BACKEND_FLASH_START_PAGE = 0, which means flash log area starts directly after the application (ie first page aligned address).

I use nrfjprog tool to read out the flash content, the command is "nrfjprog --family nrf52 --readcode [file]".

Now I get a file containing the flash content, the snippet of it is:

:10FD4000B0F31A80741A749C1AC00C5AB80429149F
:10FD500029102920291C0114E9382318F61A100447
:10FD60001A20041A28041A30041A38041A40041AF3
:10FD700048041A500411045890D003031247595AEA
:10FD80004D1403FFFF0F3100FFFFFFFFFFFFFFFFD9
:10FD9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF73
:10FDA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF63
:10FDB000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF53
:10FDC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF43
:10FDD000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF33

Since I haven't printed any log yet, I wonder if the log starts with the line "10FD9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF73"? But "10FD9000" is not even a flash address...

 Plase guide me how to locate flash crashlog address, thank you.

  • Hi,

    Since I haven't printed any log yet, I wonder if the log starts with the line "10FD9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF73"? But "10FD9000" is not even a flash address...

    The format here is intel HEX so you are not reading the dump correctly. To dump the flash memory in a easily readable form it is better to use:

    nrfjprog.exe --memrd 0 --n 0x80000 > dump.txt

  • Einar, thank you for your reply.

    I got a further question, is crashlog also contained in the dump file with "nrfjprog.exe --memrd 0 --n 80000 > dump.txt" command? and how do I know where my application code ends in the dump file?

    Could you please explain a little more. Thank you.Grinning

  • Hi,

    I updated my initial answer as there was a typo. The length (specified with --n) should be 0x80000, as that corresponds to the 512 kB flash on the nRF52832 (512*1024).

    The above will dump the entire flash in a easily readable form, where you have the addresses specified ad the beginning of each line. As you set NRF_LOG_BACKEND_FLASH_START_PAGE to 0 you know that the log starts at the first page after the application, so you need to check the application end address (either from the build information of for instance by opening it in nRF Connect programmer and adding the application hex file and hover over it. Then you know that at the next page boundary (whole 0x1000), the log starts.

  • Thank you, that's helpful. I will try it.

Related