This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

What are the iROM and iRAM value for nrf51822 in this DFU example?

I'm trying to port the _12.3.0_ DFU bootloader_secure  example to my custom nrf51822 board.

The example can run perfectly on pca10028 board, but not on my 51822 board even after I modified the relevant macro definitions.

I now suspect it has something to do with the iROM and iRAM values.

My board can successfully advertise, but there will be a GATT error message once you try to connect it using the nrf toolbox DFU function.

After changing values to what was mentioned in this thread:https://devzone.nordicsemi.com/f/nordic-q-a/11541/problems-with-dfu-bootloader

I got 138 these errors, which reads like this:

.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching dfu-cc.pb.o(.constdata).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching dfu-cc.pb.o(.constdata).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching nrf_dfu_flash.o(i.nrf_dfu_flash_init).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching nrf_dfu_utils.o(i.nrf_dfu_app_is_valid).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching app_timer.o(i.nrf_delay_us).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching pb_common.o(i.pb_field_iter_find).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching nrf_dfu_flash.o(i.fs_evt_handler).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching nrf_dfu_transport.o(i.nrf_dfu_transports_close).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching nrf_dfu_transport.o(i.nrf_dfu_transports_init).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching nrf_nvmc.o(i.nrf_nvmc_page_erase).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching app_scheduler.o(i.app_sched_init).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching app_timer.o(i.app_timer_create).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching app_timer.o(i.user_op_alloc).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching app_util_platform.o(i.app_util_critical_region_exit).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching fstorage.o(i.queue_advance).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching pb_decode.o(i.iter_from_extension).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching nrf_crypto.o(i.nrf_crypto_verify).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching main.o(i.nrf_gpio_cfg).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching boards.o(i.bsp_board_leds_init).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching boards.o(i.nrf_gpio_cfg).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching nrf_ble_dfu.o(i.send_hvx).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching nrf_bootloader_app_start.o(i.nrf_bootloader_app_start).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching nrf_dfu_mbr.o(i.nrf_dfu_mbr_copy_sd).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching app_timer.o(i.app_timer_stop).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching softdevice_handler.o(i.softdevice_enable_get_default_config).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching pb_decode.o(i.pb_message_set_to_defaults).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching micro_ecc_lib_uECC.c.o(.text.uECC_vli_cmp_unsafe).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching micro_ecc_lib_uECC.c.o(.text.uECC_vli_modMult).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching dfu-cc.pb.o(.constdata).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching dfu-cc.pb.o(.constdata).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching dfu_req_handling.o(i.pb_decoding_callback).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching pb_decode.o(i.pb_decode_fixed32).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching pb_decode.o(.constdata).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching micro_ecc_lib_uECC.c.o(.text.uECC_vli_equal).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching micro_ecc_lib_uECC.c.o(.text.uECC_vli_modSub).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching memcpya.o(.text).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching memseta.o(.text).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching pb_common.o(i.pb_field_iter_begin).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching dfu_req_handling.o(i.on_dfu_complete).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching app_timer.o(i.RTC1_IRQHandler).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching fstorage.o(i.check_config).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching softdevice_handler.o(i.SWI2_IRQHandler).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching pb_decode.o(i.decode_field).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching pb_decode.o(i.pb_readbyte).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching micro_ecc_lib_uECC.c.o(.text.uECC_vli_modMult_fast).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching micro_ecc_lib_uECC.c.o(.text.uECC_vli_modSquare_fast).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching llshl.o(.text).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching nrf_queue.o(i.nrf_queue_is_full).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching pb_decode.o(i.buf_read).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching micro_ecc_lib_uECC.c.o(.text.uECC_vli_isZero).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching micro_ecc_lib_uECC.c.o(.text.uECC_vli_rshift1).
.\_build\nrf51422_xxac_s130.axf: Error: L6406E: No space in execution regions with .ANY selector matching main.o(i.NVIC_SystemReset).

And clearly that suggests I have entered all the wrong values.

Any suggestions?

  • Hi,

    The errors you are seeing are caused by too small ROM set for the project. The original issues you were seeing might be a problem with RAM size, so updating the RAM settings might be necessary. The ROM settings in the post you linked to are very small, and you will almost certainly have to leave the ROM size at 0x5000 which means that the ROM start address should be left unchanged as well.

    Best regards,
    Rune Holmgren

  • Hello, I've Restored the iROM settings and I have enlarged the iRAM1 region to 0xA380, and now everything appears to be swell!

    Just one thing: How shall I determine the size of the iRAM1 region? Shall I use some sort of "halving scheme" and decide the minimal functional size? Or is there a detailed doc somewhere that I'm unaware of? I mean 0xA380 sounds kind of too large? It may be problematic form me to migrate it to freeRTOS later?

    Also, what is iRAM2? What does it do?

  • Not 100% sure that I understand what you are wondering about. Let me know if I misunderstand you. You are wondering how to determine how much RAM your current build actually requires. Keil (or any other compiler, but the format may vary) will output this line at the end of the linking stage. It can be used to calculate the minimal values for RAM and ROM as shown below.

    "Program Size: Code=3680 RO-data=568 RW-data=32 ZI-data=8600"

    ROM size required = Code + RO-data + RW-data = 4280

    RAM size required = RW-data + ZI-data = 8632

    IRAM

    IRAM2 is just an additional RAM section Keil offers you in case you want to have two areas of memory where you can place data. This can be useful for purposes such as disabling parts of the RAM when it's not being necessary to spend power to retain it. It's similar to setting up RAM areas in the linker file of a GCC project (In fact you can do manual configurations for Keil in the linker file if the GUI options are not flexible enough.

    Best regards,
    Rune Holmgren

Related