How to generate application core image at particular offset in Flash

Hello,

I am building https://github.com/nrfconnect/sdk-nrf/tree/main/samples/bluetooth/peripheral_uart example and I need to generate application image at 0x9200. Need to keep this image at this offset because I am using MCUBoot in my project and that is built by a different team. What is recommended way to tweak linker script / flag / other way to achieve this ?

I could build a blinky project with adding CONFIG_FLASH_LOAD_OFFSET=0x8200 in prj.conf. But it's not working for peripheral_uart  sample. using nRF5340 board.

In other words, how to use partition manager without MCUBoot ?

Thanks,

Darshan

Parents Reply Children
  • Hi,

    I could build a blinky project with adding CONFIG_FLASH_LOAD_OFFSET=0x8200 in prj.conf. But it's not working for peripheral_uart  sample. using nRF5340 board.

    The reason for why this does not work is because the MCU will alway start at address 0x0. If you don't have anything on the first address, for instance don't have a bootloader or anything similar that states "go to this address to start the application", then you won't be able to run your peripheral_uart at 0x8200.

    You can use partition manager without MCUboot, for instance use https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html#CONFIG_PM_SINGLE_IMAGE if you don't have MCUboot, and then throw in a static partitioning or to use CONFIG_FLASH_LOAD_OFFSET. Just remember that the application will not run unless you have something that specifies where the application image starts or if it is placed on the default memory address 0x0 in case the application is the first thing that should run (no bootloader use case).

    Kind regards,
    Andreas

Related