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

Build error with CONFIG_NEWLIB_LIBC defined on nRF9160

I am combining several of the examples along with my own code.  Specifically, I'm taking the Event Manager sample and combining it with some custom UART code and modified GPS sample.  Ultimately I'm trying to make an event based system that will allow me to issue commands via a terminal program on my PC and allow me to control the GPS state machine.  I have successfully merged the UART and event manager code together, but when I try to bring in my GPS code I'm getting an odd error when I build.

I'm getting the following error: undefined reference to 'static_assert'  See the picture below for a snapshot of my code. 

This error appears to occur in the header file for my uart event.  This error only started happening after I pulled in the project configuration defines into my prj.conf file for the GPS code I was adding.  I've pasted the prj.conf file contents below.  Through a series of trial and error, I've discovered that the CONFIG_NEWLIB_LIBC=y is the problem.  If I do not include that, the build no longer throws the 'undefined reference to static_assert' error.'  However, I need CONFIG_NEWLIB_LIBC for some of my other code so I have to include it.

I don't know why this error is happening.  The EVENT_TYPE_DEFINE() macro that I'm calling is part of the event manager, so I'm not sure why it's conflicting with the CONFIG_NEW_LIB_LIBC define.

I am at the latest modem firmware and am working with the v1.0.0 release.

# Enabling assert
CONFIG_ASSERT=y

# Logger configuration
CONFIG_LOG=y
CONFIG_LOG_DEFAULT_LEVEL=2
CONFIG_LOG_BACKEND_UART=y
CONFIG_LOG_STRDUP_BUF_COUNT=10

# Configuration required by Event Manager
CONFIG_EVENT_MANAGER=y
CONFIG_LINKER_ORPHAN_SECTION_PLACE=y
CONFIG_HEAP_MEM_POOL_SIZE=2048
CONFIG_REBOOT=y

#uart configuration
CONFIG_SERIAL=y

CONFIG_TRUSTED_EXECUTION_NONSECURE=y

CONFIG_UART_INTERRUPT_DRIVEN=y

CONFIG_MAIN_STACK_SIZE=4096
CONFIG_UART_1_NRF_UARTE=y
CONFIG_UART_0_NRF_UARTE=y

#Flash and NVS config
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_NVS=y
CONFIG_NVS_LOG_LEVEL_DBG=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y

#GPS
CONFIG_BSD_LIBRARY=y
CONFIG_STDOUT_CONSOLE=y
CONFIG_NETWORKING=y
CONFIG_NET_SOCKETS_OFFLOAD=y
CONFIG_NET_SOCKETS=y
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
CONFIG_FAULT_DUMP=2
CONFIG_FP_SHARING=y
CONFIG_NET_SOCKETS_POSIX_NAMES=y
CONFIG_AT_HOST_LIBRARY=y

#GPIO
CONFIG_GPIO=y
CONFIG_GPIO_NRF_P0=y

Related