mirror of https://github.com/ARMmbed/mbed-os.git
Redirect NRF asserts to mbed error() in TARGET_NRF5x and SDK 14.2 Add related details to TARGET_NRF5x Readme's
parent
cee87d9cef
commit
2ba88ba8f6
|
@ -402,10 +402,10 @@ void btle_handler(const 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);
|
||||
}
|
||||
|
||||
#if NRF_SD_BLE_API_VERSION >= 5
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Nordic NRF52
|
||||
# Nordic NRF5x
|
||||
|
||||
## Adding New Targets Based On Nordic NRF52832 And NRF52840 MCUs
|
||||
|
||||
|
@ -144,6 +144,16 @@ Because each DMA buffer must be at least 5 bytes deep, each buffer is automatica
|
|||
|
||||
The RTC2 ISR is set at the lowest interrupt priority to ensure that UARTE interrupts take precedence. The last 2 of the 4 RTC channels are used for decoupling UARTE ISR context from Mbed IRQ events. This ensures that any user code will only delay other user callbacks and idle flushing and puts an upper bound on the interrupt handling time for the UARTE ISR.
|
||||
|
||||
|
||||
#### Asserts
|
||||
|
||||
The nordic asserts have been redirected to mbed error handling when building in debug mode.
|
||||
The SDK file `mbed-os/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_14_2/libraries/util/nrf_assert.h` was modified to enable the asserts when NDEBUG is not defined.
|
||||
|
||||
The assert handler is defined in mbed-os/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5x/source/btle/btle.cpp : assert_nrf_callback() which forwards assert failures to thye mbed error() handler.
|
||||
|
||||
|
||||
|
||||
#### Limitations
|
||||
|
||||
* The UARTE hardware only supports 8-bit, None/Even parity, and 1 stop bit.
|
||||
|
|
|
@ -48,6 +48,11 @@
|
|||
#endif
|
||||
// <h> Board Support
|
||||
|
||||
// Enable NRF Asserts when Mbed NDEBUG is not set
|
||||
#if !defined(NDEBUG) && !defined(DEBUG_NRF_USER)
|
||||
#define DEBUG_NRF_USER
|
||||
#endif
|
||||
|
||||
//==========================================================
|
||||
// <q> BSP_BTN_BLE_ENABLED - bsp_btn_ble - Button Control for BLE
|
||||
|
||||
|
@ -4287,6 +4292,7 @@
|
|||
//==========================================================
|
||||
// <e> NRF_LOG_ENABLED - Logging module for nRF5 SDK
|
||||
//==========================================================
|
||||
|
||||
#ifndef NRF_LOG_ENABLED
|
||||
#define NRF_LOG_ENABLED 0
|
||||
#endif
|
||||
|
|
|
@ -48,6 +48,11 @@
|
|||
#endif
|
||||
// <h> Board Support
|
||||
|
||||
// Enable NRF Asserts when Mbed NDEBUG is not set
|
||||
#if !defined(NDEBUG) && !defined(DEBUG_NRF_USER)
|
||||
#define DEBUG_NRF_USER
|
||||
#endif
|
||||
|
||||
//==========================================================
|
||||
// <q> BSP_BTN_BLE_ENABLED - bsp_btn_ble - Button Control for BLE
|
||||
|
||||
|
|
|
@ -76,10 +76,6 @@ extern "C" {
|
|||
void assert_nrf_callback(uint16_t line_num, const uint8_t *file_name);
|
||||
//lint -restore
|
||||
|
||||
#if !defined(NDEBUG) && !defined(DEBUG_NRF_USER)
|
||||
#define DEBUG_NRF_USER
|
||||
#endif
|
||||
|
||||
#if (defined(DEBUG_NRF) || defined(DEBUG_NRF_USER))
|
||||
#define NRF_ASSERT_PRESENT 1
|
||||
#else
|
||||
|
|
Loading…
Reference in New Issue