Error in AT host lib (undefined reference to `__device_dts_ord_91') when disabling serial.

Hi, 

I wont to disable serial to lower the power consumption on my Icarus board. I am using the AWS IoT example which uses the AT HOST Lib. If I try to disable serial using CONFIG_SERIAL=n in prj.conf I get the following error while building. 

[291/313] Linking C executable zephyr/zephyr_pre0.elf
FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map 
: && ccache /opt/nordic/ncs/toolchains/v2.1.2/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc   zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj -o zephyr/zephyr_pre0.elf  -fuse-ld=bfd  -Wl,-T  zephyr/linker_zephyr_pre0.cmd  -Wl,-Map=/Users/thijsfranssen/Documents/IcarusApps/Switch/build/zephyr/zephyr_pre0.map  -Wl,--whole-archive  app/libapp.a  zephyr/libzephyr.a  zephyr/arch/common/libarch__common.a  zephyr/arch/arch/arm/core/aarch32/libarch__arm__core__aarch32.a  zephyr/arch/arch/arm/core/aarch32/cortex_m/libarch__arm__core__aarch32__cortex_m.a  zephyr/arch/arch/arm/core/aarch32/cortex_m/cmse/libarch__arm__core__aarch32__cortex_m__cmse.a  zephyr/arch/arch/arm/core/aarch32/mpu/libarch__arm__core__aarch32__mpu.a  zephyr/lib/libc/newlib/liblib__libc__newlib.a  zephyr/lib/posix/liblib__posix.a  zephyr/soc/arm/common/cortex_m/libsoc__arm__common__cortex_m.a  zephyr/boards/boards/arm/actinius_icarus_ns/libboards__arm__actinius_icarus.a  zephyr/subsys/dfu/boot/libsubsys__dfu__boot.a  zephyr/subsys/net/libsubsys__net.a  zephyr/subsys/net/ip/libsubsys__net__ip.a  zephyr/subsys/net/lib/mqtt/libsubsys__net__lib__mqtt.a  zephyr/subsys/random/libsubsys__random.a  zephyr/drivers/clock_control/libdrivers__clock_control.a  zephyr/drivers/gpio/libdrivers__gpio.a  zephyr/drivers/flash/libdrivers__flash.a  zephyr/drivers/entropy/libdrivers__entropy.a  zephyr/drivers/timer/libdrivers__timer.a  zephyr/drivers/pinctrl/libdrivers__pinctrl.a  modules/nrf/lib/nrf_modem_lib/lib..__nrf__lib__nrf_modem_lib.a  modules/nrf/lib/at_monitor/lib..__nrf__lib__at_monitor.a  modules/nrf/lib/at_host/lib..__nrf__lib__at_host.a  modules/nrf/lib/at_cmd_parser/lib..__nrf__lib__at_cmd_parser.a  modules/nrf/lib/lte_link_control/lib..__nrf__lib__lte_link_control.a  modules/nrf/lib/modem_info/lib..__nrf__lib__modem_info.a  modules/nrf/lib/fatal_error/lib..__nrf__lib__fatal_error.a  modules/nrf/lib/date_time/lib..__nrf__lib__date_time.a  modules/nrf/subsys/net/lib/download_client/lib..__nrf__subsys__net__lib__download_client.a  modules/nrf/subsys/net/lib/fota_download/lib..__nrf__subsys__net__lib__fota_download.a  modules/nrf/subsys/net/lib/aws_jobs/lib..__nrf__subsys__net__lib__aws_jobs.a  modules/nrf/subsys/net/lib/aws_fota/lib..__nrf__subsys__net__lib__aws_fota.a  modules/nrf/subsys/net/lib/aws_iot/lib..__nrf__subsys__net__lib__aws_iot.a  modules/nrf/subsys/dfu/dfu_target/lib..__nrf__subsys__dfu__dfu_target.a  modules/nrf/subsys/fw_info/lib..__nrf__subsys__fw_info.a  modules/nrf/modules/tfm/zephyr/libtfm_api_nrf.a  modules/mcuboot/boot/bootutil/zephyr/libmcuboot_util.a  modules/trusted-firmware-m/libtfm_api.a  modules/cjson/libcjson.a  modules/hal_nordic/nrfx/libmodules__hal_nordic__nrfx.a  /opt/nordic/ncs/v2.1.2/nrfxlib/nrf_modem/lib/cortex-m33/soft-float/libmodem.a  modules/nrfxlib/nrfxlib/nrf_security/src/zephyr/libmbedtls_zephyr.a  -Wl,--no-whole-archive  zephyr/kernel/libkernel.a  zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj  -L"/opt/nordic/ncs/toolchains/v2.1.2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/thumb/v8-m.main/nofp"  -L/Users/thijsfranssen/Documents/IcarusApps/Switch/build/zephyr  -lgcc  zephyr/arch/common/libisr_tables.a  tfm/secure_fw/s_veneers.o  -no-pie  -Wl,--gc-sections  -Wl,--build-id=none  -Wl,--sort-common=descending  -Wl,--sort-section=alignment  -Wl,-u,_OffsetAbsSyms  -Wl,-u,_ConfigAbsSyms  -nostdlib  -static  -Wl,-X  -Wl,-N  -Wl,--orphan-handling=warn  -lm  -Wl,-lc  -L"/opt/nordic/ncs/toolchains/v2.1.2/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi"/lib/thumb/v8-m.main/nofp  -u_printf_float  -Wl,-lgcc  -lc  -specs=nano.specs  modules/nrfxlib/nrfxlib/nrf_security/src/libmbedcrypto.a  /opt/nordic/ncs/v2.1.2/nrfxlib/crypto/nrf_oberon/lib/cortex-m33/soft-float/liboberon_mbedtls_3.0.12.a  modules/nrfxlib/nrfxlib/nrf_security/src/libmbedcrypto_base.a  -mcpu=cortex-m33  -mthumb  -mabi=aapcs  -mfp16-format=ieee  /opt/nordic/ncs/v2.1.2/nrfxlib/crypto/nrf_oberon/lib/cortex-m33/soft-float/liboberon_3.0.12.a  -lc && cd /Users/thijsfranssen/Documents/IcarusApps/Switch/build/zephyr && /opt/nordic/ncs/toolchains/v2.1.2/Cellar/cmake/3.20.5/bin/cmake -E echo
/opt/nordic/ncs/toolchains/v2.1.2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/../../../../arm-zephyr-eabi/bin/ld.bfd: modules/nrf/lib/at_host/lib..__nrf__lib__at_host.a(at_host.c.obj): in function `write_uart_string':
/opt/nordic/ncs/v2.1.2/nrf/lib/at_host/at_host.c:52: undefined reference to `__device_dts_ord_91'
/opt/nordic/ncs/toolchains/v2.1.2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/../../../../arm-zephyr-eabi/bin/ld.bfd: modules/nrf/lib/at_host/lib..__nrf__lib__at_host.a(at_host.c.obj): in function `at_host_init':
/opt/nordic/ncs/v2.1.2/nrf/lib/at_host/at_host.c:253: undefined reference to `__device_dts_ord_91'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

prj.conf

# GPIO config
CONFIG_GPIO=y

# General config
CONFIG_NCS_SAMPLES_DEFAULTS=y
CONFIG_REBOOT=y

# NEWLIB C
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y

# Network
CONFIG_NETWORKING=y
CONFIG_NET_NATIVE=n

# LTE link control
CONFIG_LTE_LINK_CONTROL=y
CONFIG_LTE_NETWORK_MODE_LTE_M=y
CONFIG_LTE_AUTO_INIT_AND_CONNECT=n

# Modem library
CONFIG_NRF_MODEM_LIB=y

# AT Host
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_AT_HOST_LIBRARY=y

# AWS IoT library
CONFIG_AWS_IOT=y
CONFIG_AWS_IOT_CLIENT_ID_STATIC="my-thing"
CONFIG_AWS_IOT_BROKER_HOST_NAME="a1bolrxrfjw3d7-ats.iot.eu-central-1.amazonaws.com"
CONFIG_AWS_IOT_SEC_TAG=495
CONFIG_AWS_IOT_APP_SUBSCRIPTION_LIST_COUNT=2
CONFIG_AWS_IOT_TOPIC_UPDATE_DELTA_SUBSCRIBE=y
CONFIG_AWS_IOT_LAST_WILL=y
CONFIG_AWS_IOT_TOPIC_GET_ACCEPTED_SUBSCRIBE=y
CONFIG_AWS_IOT_TOPIC_GET_REJECTED_SUBSCRIBE=y

# MQTT - Maximum MQTT keepalive timeout specified by AWS IoT Core
CONFIG_MQTT_KEEPALIVE=1200

# Date Time library
CONFIG_DATE_TIME=y

# Modem information
CONFIG_MODEM_INFO=y

# Heap and stacks
CONFIG_HEAP_MEM_POOL_SIZE=8192
CONFIG_MAIN_STACK_SIZE=4096
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

# MCUBOOT
CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_MCUBOOT_IMG_MANAGER=y

# Image manager
CONFIG_IMG_MANAGER=y
CONFIG_FLASH=y
CONFIG_IMG_ERASE_PROGRESSIVELY=y

# AWS FOTA
CONFIG_AWS_FOTA=y
CONFIG_FOTA_DOWNLOAD=y
CONFIG_DFU_TARGET=y

# CJSON
CONFIG_CJSON_LIB=y

# Download client (needed by AWS FOTA)
CONFIG_DOWNLOAD_CLIENT=y
CONFIG_DOWNLOAD_CLIENT_STACK_SIZE=4096

# Power MGMT
CONFIG_PM=y
CONFIG_PM_DEVICE=y

## PSM
CONFIG_LTE_PSM_REQ_RPTAU="00100001"
CONFIG_LTE_PSM_REQ_RAT="00000000"

## Disbable Serial
CONFIG_SERIAL=n

Does anyone know how to fix this? Thanks!

Parents
  • Hi,

    The problem is that the at_host library (which reads AT commands over UART, sends them to the modem, and writes the responses back on UART) uses UART.

    When you disable CONFIG_SERIAL, the at_host library is no longer able to find the UART driver it needs.

    The solution is to also disable the at_host library by changing CONFIG_AT_HOST_LIBRARY to 'n' (line 26 in your prj.conf. Line 25 will also give you a warning when building unless you also set it to 'n').

    Best regards,

    Didrik

Reply
  • Hi,

    The problem is that the at_host library (which reads AT commands over UART, sends them to the modem, and writes the responses back on UART) uses UART.

    When you disable CONFIG_SERIAL, the at_host library is no longer able to find the UART driver it needs.

    The solution is to also disable the at_host library by changing CONFIG_AT_HOST_LIBRARY to 'n' (line 26 in your prj.conf. Line 25 will also give you a warning when building unless you also set it to 'n').

    Best regards,

    Didrik

Children
Related