This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nRF51822: adjust Bootloader space

Hello, guys.

We are using nRF51822 SoC together with nRF5 v12.3.0 SDK.

According to the nRF51822 memory layout, we have 127KB of space reserved for the Application code and 20KB of space reserved for the Bootloader:

Now, we slightly customized the existing Bootloader code mainly by adding a periodical timer that will feed the Watchdog peripheral (SDKs below v15 do not support automatic watchdog feeding from the Bootloader - link). As a consequence, the size of our Bootloader code is now ~22KB.

Is it safe that we increase the Bootloader area for ~2KB and take this space from the Application area (so that now we have 127-2 = 125KB for the Application code)?

If affirmative, is the line 14 in secure_dfu_gcc_nrf51.ld linker file (located at $(SDK_ROOT)/examples/dfu/bootloader_secure) the only place where we need to adjust the Bootloader size. For example, to change the default:

FLASH (rx) : ORIGIN = 0x3AC00, LENGTH = 0x5000

with

FLASH (rx) : ORIGIN = 0x3A400, LENGTH = 0x5800

Thanks in advance for your time and efforts.

Sincerely,

Bojan.

Parents
  • Hi,

    Is it safe that we increase the Bootloader area for ~2KB and take this space from the Application area (so that now we have 127-2 = 125KB for the Application code)?

    Yes, as long as the rest space is enough for your application. 

    The modification looks fine. Can it work without issue?

    Regards,
    Amanda

  • Hello, .

    Thanks for the reply. It seems it is working fine.

    One more question... I don't initialize the Watchdog timer within the Bootloader, I just feed it periodically with

    nrf_drv_wdt_channel_feed(0);

    This is basically writing a 0x6E524635UL magic number into NRF_WDT->RR[0] register. Do you see any issue with that in the case our main Application does not use (initialize) Watchdog timer?

    Regards,

    Bojan.

Reply
  • Hello, .

    Thanks for the reply. It seems it is working fine.

    One more question... I don't initialize the Watchdog timer within the Bootloader, I just feed it periodically with

    nrf_drv_wdt_channel_feed(0);

    This is basically writing a 0x6E524635UL magic number into NRF_WDT->RR[0] register. Do you see any issue with that in the case our main Application does not use (initialize) Watchdog timer?

    Regards,

    Bojan.

Children
Related