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

SDK14: Undefined symbol sdh_req_observers$$Base

I am currently porting my project from SDK13.0 to 14.0 so I can use s332 v5.0.0.

I receive warnings when compiling

.\_build\nrf52_firmware.axf: Warning: L6330W: Undefined symbol sdh_req_observers$$Base (referred from nrf_sdh.o). Unused section has been removed.
.\_build\nrf52_firmware.axf: Warning: L6330W: Undefined symbol sdh_req_observers$$Limit (referred from nrf_sdh.o). Unused section has been removed.
.\_build\nrf52_firmware.axf: Warning: L6330W: Undefined symbol sdh_stack_observers$$Base (referred from nrf_sdh.o). Unused section has been removed.
.\_build\nrf52_firmware.axf: Warning: L6330W: Undefined symbol sdh_stack_observers$$Limit (referred from nrf_sdh.o). Unused section has been removed.
.\_build\nrf52_firmware.axf: Warning: L6330W: Undefined symbol sdh_state_observers$$Base (referred from nrf_sdh.o). Unused section has been removed.
.\_build\nrf52_firmware.axf: Warning: L6330W: Undefined symbol sdh_state_observers$$Limit (referred from nrf_sdh.o). Unused section has been removed.
.\_build\nrf52_firmware.axf: Warning: L6330W: Undefined symbol sdh_ant_observers$$Base (referred from nrf_sdh_ant.o). Unused section has been removed.
.\_build\nrf52_firmware.axf: Warning: L6330W: Undefined symbol sdh_ant_observers$$Limit (referred from nrf_sdh_ant.o). Unused section has been removed.
.\_build\nrf52_firmware.axf: Warning: L6330W: Undefined symbol sdh_ble_observers$$Base (referred from nrf_sdh_ble.o). Unused section has been removed.
.\_build\nrf52_firmware.axf: Warning: L6330W: Undefined symbol sdh_ble_observers$$Limit (referred from nrf_sdh_ble.o). Unused section has been removed.
.\_build\nrf52_firmware.axf: Warning: L6330W: Undefined symbol sdh_soc_observers$$Base (referred from nrf_sdh_soc.o). Unused section has been removed.
.\_build\nrf52_firmware.axf: Warning: L6330W: Undefined symbol sdh_soc_observers$$Limit (referred from nrf_sdh_soc.o). Unused section has been removed.

What is causing the undefined symbol errors?

Is it related to the fact that my ble_evt_dispatch function is never called, even though i use

NRF_SDH_BLE_OBSERVER(m_ble_observer, APP_BLE_OBSERVER_PRIO, ble_evt_dispatch, NULL);
Parents
  • Hi goldwake,

    I just faced a similar problem yesterday when upgrading to SDK14 but I am using the GNU ARM GCC toolchain. The problem was that the NRF_SDH_BLE_OBSERVER macro is declaring variables as extern. So these variables need to be defined in the linker script for the symbols to be recognized.

    I'm not sure what the syntax is for the toolchain you're using but this is what I had to add to my linker script (gcc_nrf52.ld) to fix this:

      .sdh_stack_observers :
      {
        PROVIDE(__start_sdh_stack_observers = .);
        KEEP(*(SORT(.sdh_stack_observers*)))
        PROVIDE(__stop_sdh_stack_observers = .);
      } > FLASH
    
      .sdh_req_observers :
      {
        PROVIDE(__start_sdh_req_observers = .);
        KEEP(*(SORT(.sdh_req_observers*)))
        PROVIDE(__stop_sdh_req_observers = .);
      } > FLASH
    
      .sdh_ant_observers :
      {
        PROVIDE(__start_sdh_ant_observers = .);
        KEEP(*(SORT(.sdh_ant_observers*)))
        PROVIDE(__stop_sdh_ant_observers = .);
      } > FLASH
    
      .sdh_state_observers :
      {
        PROVIDE(__start_sdh_state_observers = .);
        KEEP(*(SORT(.sdh_state_observers*)))
        PROVIDE(__stop_sdh_state_observers = .);
      } > FLASH
    
      .sdh_ble_observers :
      {
        PROVIDE(__start_sdh_ble_observers = .);
        KEEP(*(SORT(.sdh_ble_observers*)))
        PROVIDE(__stop_sdh_ble_observers = .);
      } > FLASH
    
      .sdh_soc_observers :
      {
        PROVIDE(__start_sdh_soc_observers = .);
        KEEP(*(SORT(.sdh_soc_observers*)))
        PROVIDE(__stop_sdh_soc_observers = .);
      } > FLASH
    

    Hope this helps!

Reply
  • Hi goldwake,

    I just faced a similar problem yesterday when upgrading to SDK14 but I am using the GNU ARM GCC toolchain. The problem was that the NRF_SDH_BLE_OBSERVER macro is declaring variables as extern. So these variables need to be defined in the linker script for the symbols to be recognized.

    I'm not sure what the syntax is for the toolchain you're using but this is what I had to add to my linker script (gcc_nrf52.ld) to fix this:

      .sdh_stack_observers :
      {
        PROVIDE(__start_sdh_stack_observers = .);
        KEEP(*(SORT(.sdh_stack_observers*)))
        PROVIDE(__stop_sdh_stack_observers = .);
      } > FLASH
    
      .sdh_req_observers :
      {
        PROVIDE(__start_sdh_req_observers = .);
        KEEP(*(SORT(.sdh_req_observers*)))
        PROVIDE(__stop_sdh_req_observers = .);
      } > FLASH
    
      .sdh_ant_observers :
      {
        PROVIDE(__start_sdh_ant_observers = .);
        KEEP(*(SORT(.sdh_ant_observers*)))
        PROVIDE(__stop_sdh_ant_observers = .);
      } > FLASH
    
      .sdh_state_observers :
      {
        PROVIDE(__start_sdh_state_observers = .);
        KEEP(*(SORT(.sdh_state_observers*)))
        PROVIDE(__stop_sdh_state_observers = .);
      } > FLASH
    
      .sdh_ble_observers :
      {
        PROVIDE(__start_sdh_ble_observers = .);
        KEEP(*(SORT(.sdh_ble_observers*)))
        PROVIDE(__stop_sdh_ble_observers = .);
      } > FLASH
    
      .sdh_soc_observers :
      {
        PROVIDE(__start_sdh_soc_observers = .);
        KEEP(*(SORT(.sdh_soc_observers*)))
        PROVIDE(__stop_sdh_soc_observers = .);
      } > FLASH
    

    Hope this helps!

Children
Related