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

Usagefault_CheckingError after changing to new version of SDK

Hello!

I have an application which uses the nrf Connect SDK and thus far I have been using an old version from around April of last year.
Recently however it became necessary to upgrade to a newer version of the SDK as other people have joined the project and also we need to use some of the newer API functions.

After upgrading the SDK I updated all the altered include-paths and also updated deprecated types and functions and the project now successfully builds.
Some config options have changed as well so I have tried my best to find their new names and set them to how they should be.
Upon running the application however it faults before entering the applications main function claiming "UsageFault_CheckingError".



I have included my prj.conf below:

CONFIG_BSD_LIBRARY=y
CONFIG_BSD_LIBRARY_SYS_INIT=n

CONFIG_NETWORKING=y
CONFIG_NET_SOCKETS=y

CONFIG_HEAP_MEM_POOL_SIZE=8192
CONFIG_MAIN_STACK_SIZE=8192

CONFIG_MODEM_KEY_MGMT=y
CONFIG_LTE_LINK_CONTROL=y

CONFIG_NET_IPV4=y
CONFIG_NET_IPV6=n

CONFIG_MAIN_THREAD_PRIORITY=5

# TLS configuration
CONFIG_MBEDTLS=y
CONFIG_MBEDTLS_BUILTIN=y
CONFIG_MBEDTLS_ENABLE_HEAP=y
CONFIG_MBEDTLS_HEAP_SIZE=10240
CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN=16384

CONFIG_NET_SOCKETS_SOCKOPT_TLS=y
CONFIG_NET_SOCKETS_TLS_MAX_CONTEXTS=4

CONFIG_MBEDTLS_PEM_CERTIFICATE_FORMAT=y

# Enable fancy C functions
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_NANO=n

# GPIO
CONFIG_GPIO=y

# I2C
CONFIG_I2C=y
#CONFIG_I2C_NRFX=y
#CONFIG_I2C_3=y
#CONFIG_I2C_3_NRF_TWIM=y

#CONFIG_NFCT_PINS_AS_GPIOS=y

# Modem
CONFIG_MODEM_INFO=y

# Debug
CONFIG_DEBUG=y
CONFIG_SERIAL=y
CONFIG_PRINTK=y
CONFIG_USE_SEGGER_RTT=y
CONFIG_NO_OPTIMIZATIONS=y
#CONFIG_RESET_ON_FATAL_ERROR=n

# Optimization
CONFIG_BOOT_BANNER=n

# Math
#CONFIG_FLOAT=y

# ADC
CONFIG_ADC=y
CONFIG_ADC_ASYNC=y
#CONFIG_NRFX_ADC=y
#CONFIG_ADC_NRFX_SAADC=y
#CONFIG_NRFX_SAADC=y
#CONFIG_GPIO_NRFX=y

# NVS / Flash
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_NVS=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y

# Systemview
#CONFIG_THREAD_NAME=y
CONFIG_USE_SEGGER_RTT=y


# J-trace print:
CONFIG_PRINTK=y
CONFIG_CONSOLE=y
CONFIG_STDOUT_CONSOLE=y
CONFIG_UART_CONSOLE=n
CONFIG_RTT_CONSOLE=y
CONFIG_USE_SEGGER_RTT=y

# Watchdog:
#CONFIG_WATCHDOG=y

# Real-Time Counter:
CONFIG_COMPILER_OPT="-DNRFX_RTC_ENABLED=1 -DNRFX_RTC0_ENABLED=1"

Parents Reply Children
  • Hello!

    I upgraded from v1.2.0 to v1.5.0.
    I don't think I have any logs that would be very useful here, but I have included the build log in case I missed something.

    Stepping through the code, the program faults upon trying to enter the application main-thread (that is, upon calling arch_switch_to_main_thread() in init.c). Basically, none of my code is ever executed as far as I can tell.

    Other than that I can mention that in the previous version, the application used NRFX-drivers for the ADC and also made use of the internal RTC and I2C. These have all been temporarily disabled whilst migrating to this new SDK-version while I figure out the new names and paths of config-options and header files. Please note: reenabling these does not fix the issue I am having.

    Edit: I do not have the build logs available.

  • After some more tinkering it seems the issue was (somewhat) resolved by adding the following config options:
    CONFIG_NET_NATIVE=n
    CONFIG_NRF_MODEM_LIB=y
    CONFIG_NRF_MODEM_LIB_SYS_INIT=y

    I also removed the BSD_LIB config options.

    There is now a separate issue with the same fault (I suspect it is related) when calling lte_lc_init_and_connect() or lte_lc_connect(). I have made a separate ticket for this here.

Related