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

SES: section `i.halNfcCallback' will not fit in region `UNPLACED_SECTIONS'

Hej, I just spent plenty of time finding an answer on above error within here with no luck. Since there are certainly others facing this problem, I hereby post my solution for reference:

Segger Embedded Studio (SES) has caught my attention and so I ported the examples\ble_peripheral\experimental_ble_nfc_pairing_reference\ from SDK 13. After solving startup, flash placements and all the other subtleties, I got following linker error:

Output/nrf52832_xxaa/Exe/ble_nfc_pairing_reference_pca10040_s132.elf section i.halNfcCallback' will not fit in regionUNPLACED_SECTIONS'

Using objdump -h nfc_t2t_lib_keil.lib and objdump -h nfc_t2t_lib_gcc.a revealed that the keil-library requires two additional sections the gcc-library doesn't:

In archive nfc_t2t_lib_keil.lib:

nfc_t2t_lib.o:     file format elf32-little

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 i.halNfcCallback 0000009c  00000000  00000000  00000034  2**2
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
...
 23 .constdata    0000000a  00000000  00000000  00000775  2**0
...`

So what you need to do is add two new sections to your flash_placement.xml file:

<ProgramSection alignment="4" load="Yes" name="i" />
<ProgramSection alignment="4" load="Yes" name=".constdata" />

additional note: I found no reference in any KEIL-project files in the SDK and hence assume that these two sections are builtin-standard-KEIL sections. nfc t4t library, gazell library and others may also require manual addition of these two sections in SES.

Related