Why setting CONFIG_TFM_PROFILE_TYPE_NOT_SET=y apparently solves "FATAL ERROR: UsageFault"?!

Hi, 

here is a brief description of my app with nrf9161DK (2.6.1 SDK, the app was built starting from the MQTT sample): The app is reading RTCM messages from a server via modem, sends them to GNSS via UART, then reads NMEA information from GNSS using the same UART and finally sends the data to a MQTT server via the modem.

I struggled with "FATAL ERROR: UsageFault" (initially, there was reset, then I made CONFIG_RESET_ON_FATAL_ERROR=n) which rather mysteriously occured regularly after 6 minutes from the app reset. I was, however, not able to debug any more detailed info about the root cause.

Among the advices I have found in this site, there was a suggestion to set CONFIG_TFM_PROFILE_TYPE_NOT_SET=y. And quite mysteriously, up to now, the error disappeared.

How could this be explained please? Below, there is FYI my cluttered prj.conf.

So currently, I have no pending issue, but I'd be happy to understand more what could happen here. 

Thank you!

#### "debugging" ##########################################
### debug network timing
# CONFIG_NET_LOG=y
### debug MQTT timing
# CONFIG_MQTT_LOG_LEVEL_DBG=y
### increase LOG buffer size
# CONFIG_LOG_BUFFER_SIZE=64000
### debug optimizations (-Og)
CONFIG_DEBUG=y
CONFIG_DEBUG_OPTIMIZATIONS=y
CONFIG_DEBUG_THREAD_INFO=y
### to try to debug unwanted soft resets (not resetting):
CONFIG_RESET_ON_FATAL_ERROR=n
# CONFIG_REBOOT=n
#
### SECURE TFM logging
### disabling logging of TF-M
# CONFIG_TFM_LOG_LEVEL_SILENCE=y
### forward TF-M secure logging to the same UART as application logging (comment the previous)
CONFIG_TFM_SECURE_UART=y
CONFIG_TFM_SECURE_UART_SHARE_INSTANCE=y
CONFIG_TFM_SECURE_UART0=y
CONFIG_TFM_PARTITION_LOG_LEVEL_DEBUG=y
CONFIG_TFM_SPM_LOG_LEVEL_DEBUG=y
# Dump exception info. Must be combined with enabling log output.
CONFIG_TFM_EXCEPTION_INFO_DUMP=y
#############################################################

# CONFIG_NEWLIB_LIBC_NANO=n

### Possible solution for Fatal error???
# Don't use the minimal TF-M configuration as that doesn't support logging
CONFIG_TFM_PROFILE_TYPE_NOT_SET=y

### Memory
CONFIG_MAIN_STACK_SIZE=2048
CONFIG_HEAP_MEM_POOL_SIZE=4096
CONFIG_ISR_STACK_SIZE=4096

# try to increase MODEM library heap size:
# CONFIG_NRF_MODEM_LIB_HEAP_SIZE=4096

# Modem trace
CONFIG_AT_HOST_LIBRARY=y

# enable GPIO
CONFIG_GPIO=y

# enable uart driver
CONFIG_SERIAL=y
CONFIG_UART_ASYNC_API=y

# if dynamic uart configuration needed
CONFIG_UART_USE_RUNTIME_CONFIGURE=y

# enable console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y

# Logging
CONFIG_LOG=y

# Newlib
CONFIG_NEWLIB_LIBC=y

# Networking
CONFIG_NETWORKING=y
CONFIG_NET_NATIVE=n
CONFIG_NET_SOCKETS_OFFLOAD=y
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_POSIX_NAMES=y

# Modem library
CONFIG_NRF_MODEM_LIB=y

# LTE link control
CONFIG_LTE_LINK_CONTROL=y
CONFIG_LTE_NETWORK_MODE_LTE_M_NBIOT=y

# MQTT
CONFIG_MQTT_LIB=y
CONFIG_MQTT_CLEAN_SESSION=y

Related