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

IAR nrf52832_xxab.icf error

Hello,

I noticed the linker file we were using was for the nRF52832_xxAA so I got the nrf52832_xxab.icf from C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.0\arm\config\linker\NordicSemi\nrf52832_xxab.icf.

After switching linker files IAR fails the linking stage with the following error: Error[Lc041]: "block PROC_STACK" defined but not referenced nrf52832_xxab.icf 74

The new linker file: nrf52832_xxab.icf

Are the linked files included with IAR correct?

Look forward to hearing from you, James

  • Hi,

    Normally each example in the SDK comes with it's own linker file(.icf). So you should use that one instead.

    E.g for ble_app_uart, you have the file called ble_app_uart_iar_nRF5x.icf located in the folder SDK_folder\examples\ble_peripheral\ble_app_uart\pca10040\s132\iar. Then you just set that you are using the xxAB variant in the Project options -> General Options -> Device

  • Hi Sigurd,

    thanks for getting back to me. This project isn't based off an example. So would you recommend ble_app_uart_iar_nRF5x.icf or would you recommend a different one from the SDK? There are a lot of different icf files in the SDK. Most of the ICF files have ram starting at a different location. Shouldn't this be the same, the boards have the same amount of ram.

    Normally a generic linker file is provided.

    I have already changed the device to the AB variant in the project options.

    Many thanks, James

  • If you are using the SoftDevice, then I would recommend using the ble_app_uart_iar_nRF5x.icf from the SDK version you are using. The only thing that changes between the .icf files for the ble_peripheral examples is the ram starting address. The total RAM is always the same(end: 0x2000ffff), but the RAM start address for where your application should start depends on how much RAM the SoftDevice uses. This changes based on how many services, characteristics, links, etc you configure the SoftDevice to use.

    The sd_ble_enable function, which is used to enable the SoftDevice, will return the minimum start address of the application RAM region required by the SoftDevice for the given configuration in the app_ram_base variable. The value of app_ram_base will be printed on the UART/RTT if you have logging enabled. You can also open a debug session, set a breakpoint after the in softdevice_enable(ble_enable_params_t

    • p_ble_enable_params) function in softdevice_handler.c and examine the value of app_ram_base that way.

    I recommend taking a look at how one of the examples in the SDK, and see how the IAR project is configured.

  • Note: Since you are using xxab, you need to change the __ICFEDIT_region_RAM_end__ and __ICFEDIT_region_ROM_end__ so it corresponds to the available flash and RAM you have on your device. I.e.:

    define symbol __ICFEDIT_region_IROM1_end__   = 0x0003FFFF;
    
    define symbol __ICFEDIT_region_IRAM1_end__   = 0x20007FFF;
    
  • Thanks for your detailed answers. we are not using the softdevice. So does that mean you would recommend a different linker file. We are using FreeRTOS though.

Related