From cfd248ee050b334b5cd67f377ec5d829bd97b14f Mon Sep 17 00:00:00 2001 From: Andrew Leech Date: Tue, 6 Feb 2018 12:39:56 +1100 Subject: [PATCH] Enable ASSERTS's in nrf sdk to catch coding errors. These will now flow through to mbed standard error handling. --- .../targets/TARGET_NORDIC/TARGET_NRF51/source/btle/btle.cpp | 4 ++-- targets/targets.json | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF51/source/btle/btle.cpp b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF51/source/btle/btle.cpp index 0873336a44..25bbad56b0 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF51/source/btle/btle.cpp +++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF51/source/btle/btle.cpp @@ -299,10 +299,10 @@ static void btle_handler(ble_evt_t *p_ble_evt) gattServer.hwCallback(p_ble_evt); } -/*! @brief Callback when an error occurs inside the SoftDevice */ +/*! @brief Callback when an error occurs inside the SoftDevice or ASSERT in debug*/ void assert_nrf_callback(uint16_t line_num, const uint8_t *p_file_name) { - ASSERT_TRUE(false, (void) 0); + error("nrf failure at %s:%d", p_file_name, line_num); } /*! diff --git a/targets/targets.json b/targets/targets.json index 6285ffc7c6..507829213d 100755 --- a/targets/targets.json +++ b/targets/targets.json @@ -3450,7 +3450,8 @@ "CMSIS_VECTAB_VIRTUAL", "CMSIS_VECTAB_VIRTUAL_HEADER_FILE=\"cmsis_nvic.h\"", "NO_SYSTICK", - "MBED_TICKLESS" + "MBED_TICKLESS", + "DEBUG_NRF_USER" ], "MERGE_BOOTLOADER": false, "extra_labels": [