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

section '.init' will not fit in region 'UNPLACED_SECTIONS' and region 'UNPLACED_SECTIONS' overflowed by 76048 bytes

I am trying to transition my Nordic SDK v12 project from Keil to Segger Embedded studio. I followed the tutorial steps such as placing ses_nrf_51_startup.s file in Internal Files of the SES project.I downloaded the Section Placement XML from Nordic. I then switched the project linker to GNU and imported the XML into the Section Placement of the project. The XML file is below. But when I try building the code I get many errors. The first errors I get is: section '.init' will not fit in region 'UNPLACED_SECTIONS' and region 'UNPLACED_SECTIONS' overflowed by 76048 bytes. I searched online and some Devzone posts also say to import the thumb_crt0.s file from the SES folder into the SES project. I tried that and added the thumb_crt0.s file to the project's Internal Files section, but this did not fix the issue either.

How should I fix the issue? I also attached my code with the Keil and Segger project files in a zip file for reference below.

!DOCTYPE Linker_Placement_File>
<Root name="Flash Section Placement">
  <MemorySegment name="$(FLASH_NAME:FLASH)">
    <ProgramSection alignment="0x100" load="Yes" name=".vectors" start="$(FLASH_START:)" />
    <ProgramSection alignment="4" load="Yes" name=".init" />
    <ProgramSection alignment="4" load="Yes" name=".init_rodata" />
    <ProgramSection alignment="4" load="Yes" name=".text" />
    <ProgramSection alignment="4" load="Yes" name=".dtors" />
    <ProgramSection alignment="4" load="Yes" name=".ctors" />
    <ProgramSection alignment="4" load="Yes" name=".rodata" />
    <ProgramSection alignment="4" load="Yes" name=".ARM.exidx" address_symbol="__exidx_start" end_symbol="__exidx_end" />
    <ProgramSection alignment="4" load="Yes" runin=".fast_run" name=".fast" />
    <ProgramSection alignment="4" load="Yes" runin=".data_run" name=".data" />
    <ProgramSection alignment="4" load="Yes" runin=".tdata_run" name=".tdata" />
    <ProgramSection alignment="4" keep="Yes" load="Yes" runin=".fs_data_run" name=".fs_data" />
  </MemorySegment>
  <MemorySegment name="$(RAM_NAME:RAM);SRAM">
    <ProgramSection alignment="0x100" load="No" name=".vectors_ram" start="$(RAM_START:$(SRAM_START:))" />
    <ProgramSection alignment="4" load="No" name=".fast_run" />
    <ProgramSection alignment="4" load="No" name=".data_run" />
    <ProgramSection alignment="4" load="No" name=".tdata_run" />
    <ProgramSection alignment="4" load="No" keep="Yes" name=".fs_data_run" address_symbol="__start_fs_data" end_symbol="__stop_fs_data" />
    <ProgramSection alignment="4" load="No" name=".bss" />
    <ProgramSection alignment="4" load="No" name=".tbss" />
    <ProgramSection alignment="4" load="No" name=".non_init" />
    <ProgramSection alignment="4" size="__HEAPSIZE__" load="No" name=".heap" />
    <ProgramSection alignment="8" size="__STACKSIZE__" load="No" place_from_segment_end="Yes" name=".stack" />
    <ProgramSection alignment="8" size="__STACKSIZE_PROCESS__" load="No" name=".stack_process" />
  </MemorySegment>
  <MemorySegment name="$(FLASH2_NAME:FLASH2)">
    <ProgramSection alignment="4" load="Yes" name=".text2" />
    <ProgramSection alignment="4" load="Yes" name=".rodata2" />
    <ProgramSection alignment="4" load="Yes" runin=".data2_run" name=".data2" />
  </MemorySegment>
  <MemorySegment name="$(RAM2_NAME:RAM2)">
    <ProgramSection alignment="4" load="No" name=".data2_run" />
    <ProgramSection alignment="4" load="No" name=".bss2" />
  </MemorySegment>
</Root>

keil_segger.zip

Parents Reply
  • Hi Vidar,

    When we compiled and flashed the example code you provided to the NRF51 DK board, the Bluetooth advertising light did not flash and no Bluetooth signal was detected from the DK board. We think that the Softdevice has already been placed into the project so we are not sure why the example you provided does not work. 

    I also tried putting my code into the SES project files of the original example you provided. The SES code compiled and flashed successfully to the DK. But the flashed code did not advertise on the DK board either.

    https://devzone.nordicsemi.com/f/nordic-q-a/44335/importing-keil-uvision-project-to-segger

    We found the post above where you suggest to do nrfjprog --chiperase if the Segger example does not work. However, after we do the chiperase and nrfjprog --recover we have trouble getting the DK board to connect correctly again!

    I attached a zip file containing the code I placed into the SES project files you provided. Are you able to try this code or the original example on your NRF51 DK board? 

    nRF5_SDK_12.3.0_SES_51_example.zip

    Thank you

Children
Related