Calculate the size of application code in nrf52840 flash

Hi i am using nordic nrf52840 chip.

i programmed one application at 0x27000 address, and now i want to calculate the size of that application code in run time.

i have my own bootloader code at 0x5E000. and in that bootloader i want to calculate the address of my application code which i programmed at 0x27000 address.

can some one let me know the way i can calculate the size of my application.

is there any nordic API available for that.

Regards

RS 

Parents
  • Hi

    I think you will need to read the application area to see (0x0002 7000 - 0x000F 8000 in the nRF52840) to see what is used and not by your application. Both SEGGER Embedded Studios (SES) and the nRFConnect programmer application for desktop is able to do this for you. There's no specific API for it that we've made I'm afraid, but you could also use nrfjprog to read the memory. Either with the --memrd function to read a specific address range from the flash or the readcode to read the whole device flash.

    Best regards,

    Simon

Reply
  • Hi

    I think you will need to read the application area to see (0x0002 7000 - 0x000F 8000 in the nRF52840) to see what is used and not by your application. Both SEGGER Embedded Studios (SES) and the nRFConnect programmer application for desktop is able to do this for you. There's no specific API for it that we've made I'm afraid, but you could also use nrfjprog to read the memory. Either with the --memrd function to read a specific address range from the flash or the readcode to read the whole device flash.

    Best regards,

    Simon

Children
Related