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

Device crashes when debug flags are turned on

I am writing firmware for a BLE Nano device using the Nordic SDK 8.1. I was having problems where my device would suddenly stop printing to UART and stop trying to bond with ble peripherals also. It seems like it is crashing so I went to turn debug mode on. I did this by including the ble_flash.c, ble_error_log.c, and ble_debug_assert_handler.c. I then added the cflag -DDEBUG and enabled debugging in compilation:

C_SOURCE_FILES +=
../../../../../../components/drivers_nrf/ble_flash/ble_flash.c
../../../../../../components/ble/ble_error_log/ble_error_log.c \

INC_PATHS += -I../../../../../../components/drivers_nrf/ble_flash INC_PATHS += -I../../../../../../components/ble/ble_error_log INC_PATHS += -I../../../../../../components/ble/ble_debug_assert_handler

CFLAGS += -Wall -Og CFLAGS += -DDEBUG

At this point I run my device and the behvior doesn't change (it still stops printing to serial and not making connections), but when I look in the serial monitor I don't see any errors or debug messages. How do I go about getting the error messages for my firmware crash?

Related