Assertions#
Callbacks called by assertions.
The assertion framework was implemented to not only assert that certain conditions are true in a block of code, but also to handle them more appropriately. In previous implementations, the behavior upon a failed assert was to hang in a while(1) loop. However, with the callback, each assert is given a unique error code so that they can be handled on a more case-by-case basis. For documentation on each of the errors, see the rail_assert_error_codes.h file. RAIL_ASSERT_ERROR_MESSAGES[errorCode] gives the explanation of the error. With asserts built into the library, users can choose how to handle each error inside the callback.
The assertion framework was implemented to not only assert that certain conditions are true in a block of code, but also to handle them more appropriately. In previous implementations, the behavior upon a failed assert was to hang in a while(1) loop. However, with the callback, each assert is given a unique error code so that they can be handled on a more case-by-case basis. For documentation on each of the errors, see the rail_assert_error_codes.h file. SL_RAIL_ASSERT_ERROR_MESSAGES[error_code] gives the explanation of the error. With asserts built into the library, users can choose how to handle each error inside the callback.
Enumerations#
Enumeration of all possible error codes from RAIL_ASSERT.
Enumeration of all possible error codes from SL_RAIL_ASSERT.
Functions#
Callback called upon failed assertion.
Callback called upon failed assertion.
Macros#
Use this define to create an array of error messages that map to the codes in RAIL_AssertErrorCodes_t.
Use this define to create an array of error messages that map to the codes in sl_rail_assert_error_codes_t.
Enumeration Documentation#
RAIL_AssertErrorCodes_t#
RAIL_AssertErrorCodes_t
Enumeration of all possible error codes from RAIL_ASSERT.
| Enumerator | |
|---|---|
| RAIL_ASSERT_FAILED_APPENDED_INFO_MISSING | Appended info missing from RX packet. |
| RAIL_ASSERT_FAILED_RX_FIFO_BYTES | Receive FIFO too small for IR calibration. |
| RAIL_ASSERT_UNUSED_2 | Invalid assert, no longer used. |
| RAIL_ASSERT_FAILED_ILLEGAL_RXLEN_ENTRY_STATUS | Receive FIFO entry has invalid status. |
| RAIL_ASSERT_FAILED_BAD_PACKET_LENGTH | Receive FIFO entry bad packet length. |
| RAIL_ASSERT_FAILED_SYNTH_DIVCTRL_ENUM_CONVERSION_ERROR | Unable to configure radio for IR calibration. |
| RAIL_ASSERT_FAILED_UNEXPECTED_STATE_RX_FIFO | Reached unexpected state while handling RX FIFO events. |
| RAIL_ASSERT_FAILED_UNEXPECTED_STATE_RXLEN_FIFO | Reached unexpected state while handling RXLEN FIFO events. |
| RAIL_ASSERT_FAILED_UNEXPECTED_STATE_TX_FIFO | Reached unexpected state while handling TX FIFO events. |
| RAIL_ASSERT_FAILED_UNEXPECTED_STATE_TXACK_FIFO | Reached unexpected state while handling TX ACK FIFO events. |
| RAIL_ASSERT_INVALID_MEMORY_ACCESS | Invalid memory region accessed. |
| RAIL_ASSERT_FAILED_UNSUPPORTED_RX_DATA_SOURCE | Unsupported RX Data Source. |
| RAIL_ASSERT_UNUSED_12 | Invalid assert, no longer used. |
| RAIL_ASSERT_FAILED_RTCC_POST_WAKEUP | Error synchronizing the RAIL timebase after sleep. |
| RAIL_ASSERT_FAILED_SYNTH_VCO_FREQUENCY | VCO frequency outside supported range. |
| RAIL_ASSERT_FAILED_RAC_STATE | Radio active while changing channels. |
| RAIL_ASSERT_FAILED_SYNTH_INVALID_VCOCTRL | Invalid Synth VCOCTRL field calculation. |
| RAIL_ASSERT_FAILED_NESTED_SEQUENCER_LOCK | Nested attempt to lock the sequencer. |
| RAIL_ASSERT_FAILED_RSSI_AVERAGE_DONE | RSSI averaging enabled without a valid callback. |
| RAIL_ASSERT_UNUSED_19 | Invalid assert, no longer used. |
| RAIL_ASSERT_FAILED_PROTIMER_RANDOM_SEED | Unable to seed radio pseudo random number generator. |
| RAIL_ASSERT_UNUSED_21 | Invalid assert, no longer used. |
| RAIL_ASSERT_FAILED_PROTIMER_CHANNEL | Invalid timer channel specified. |
| RAIL_ASSERT_UNUSED_23 | Invalid assert, no longer used. |
| RAIL_ASSERT_FAILED_BASECNTTOP | LBT config exceeds register size. |
| RAIL_ASSERT_UNUSED_25 | Invalid assert, no longer used. |
| RAIL_ASSERT_FAILED_RTCC_SYNC_MISSED | Could not synchronize RAIL timebase with the RTC. |
| RAIL_ASSERT_FAILED_CLOCK_SOURCE_NOT_READY | Clock source not ready. |
| RAIL_ASSERT_UNUSED_28 | Invalid assert, no longer used. |
| RAIL_ASSERT_NULL_HANDLE | NULL was supplied as a RAIL_Handle_t argument. |
| RAIL_ASSERT_UNUSED_30 | Invalid assert, no longer used. |
| RAIL_ASSERT_FAILED_NO_ACTIVE_CONFIG | API improperly called while protocol inactive. |
| RAIL_ASSERT_UNUSED_32 | Invalid assert, no longer used. |
| RAIL_ASSERT_UNUSED_33 | Invalid assert, no longer used. |
| RAIL_ASSERT_UNUSED_34 | Invalid assert, no longer used. |
| RAIL_ASSERT_UNUSED_35 | Invalid assert, no longer used. |
| RAIL_ASSERT_UNUSED_36 | Invalid assert, no longer used. |
| RAIL_ASSERT_UNUSED_37 | Invalid assert, no longer used. |
| RAIL_ASSERT_FAILED_TX_SYNTH_ENABLE | Failed to enable synth for transmit. |
| RAIL_ASSERT_DEPRECATED_FUNCTION | This function is deprecated and must not be called. |
| RAIL_ASSERT_MULTIPROTOCOL_NO_EVENT | Multiprotocol task started with no event to run. |
| RAIL_ASSERT_FAILED_INVALID_INTERRUPT_ENABLED | Invalid interrupt enabled. |
| RAIL_ASSERT_UNUSED_42 | Invalid assert, no longer used. |
| RAIL_ASSERT_DIVISION_BY_ZERO | Division by zero. |
| RAIL_ASSERT_CANT_USE_HARDWARE | Function cannot be called without access to the hardware. |
| RAIL_ASSERT_NULL_PARAMETER | Pointer parameter was passed as NULL. |
| RAIL_ASSERT_SECURE_ELEMENT_FAULT | Secure Element fault. |
| RAIL_ASSERT_SMALL_SYNTH_RADIO_CONFIG_BUFFER | Synth radio config buffer for channel hopping too small. |
| RAIL_ASSERT_CHANNEL_HOPPING_BUFFER_TOO_SHORT | Buffer provided for RX Channel Hopping is too small. |
| RAIL_ASSERT_INVALID_MODULE_ACTION | Invalid action was attempted on a module. |
| RAIL_ASSERT_CHANNEL_HOPPING_INVALID_RADIO_CONFIG | The radio config for this channel is not compatible with channel hopping. |
| RAIL_ASSERT_CHANNEL_CHANGE_FAILED | Channel change failed. |
| RAIL_ASSERT_INVALID_REGISTER | Attempted to read invalid register. |
| RAIL_ASSERT_CP_DMA_INTERNAL_GENERIC_ERROR | CP/DMA Invalid error. |
| RAIL_ASSERT_CACHE_CONFIG_FAILED | DMP radio config caching failed. |
| RAIL_ASSERT_NULL_TRANSITIONS | NULL was supplied as a RAIL_StateTransitions_t argument. |
| RAIL_ASSERT_BAD_LDMA_TRANSFER | LDMA transfer failed. |
| RAIL_ASSERT_INVALID_RTCC_SYNC_VALUES | Attempted to wake up with invalid RTCC sync data. |
| RAIL_ASSERT_SEQUENCER_FAULT | Radio sequencer hit a fault condition. |
| RAIL_ASSERT_BUS_ERROR | Bus fault. |
| RAIL_ASSERT_INVALID_FILTERING_CONFIG | The current radio config cannot be used with packet filtering. |
| RAIL_ASSERT_RETIMING_CONFIG | Retiming configuration error. |
| RAIL_ASSERT_FAILED_TX_CRC_CONFIG | TX CRC configuration is corrupt. |
| RAIL_ASSERT_INVALID_PA_OPERATION | The current PA config does not allow for this operation. |
| RAIL_ASSERT_SEQ_INVALID_PA_SELECTED | The sequencer selected an invalid PA. |
| RAIL_ASSERT_FAILED_INVALID_CHANNEL_CONFIG | Invalid/unsupported channel config. |
| RAIL_ASSERT_INVALID_XTAL_FREQUENCY | Radio Calculator configuration HFXO frequency mismatch with chip. |
| RAIL_ASSERT_INTERNAL_GENERIC_ERROR | Internal error. |
| RAIL_ASSERT_UNSUPPORTED_SOFTWARE_MODEM_MODULATION | Software modem image does not support requested modulation |
| RAIL_ASSERT_FAILED_RTCC_SYNC_STOP | Failed to disable RTCC synchronization. |
| RAIL_ASSERT_FAILED_MULTITIMER_CORRUPT | Multitimer linked list corrupted. |
| RAIL_ASSERT_FAILED_TEMPCAL_ERROR | Unable to configure radio for temperature calibration. |
| RAIL_ASSERT_INVALID_VDET_CONFIGURATION | Invalid VDET configuration. |
| RAIL_ASSERT_INVALID_RFFPLL_CONFIGURATION | Invalid RFFPLL configuration. |
| RAIL_ASSERT_SECURE_ACCESS_FAULT | Secure access fault. |
| RAIL_ASSERT_FAILED_SYSRTC0_NOT_RUNNING | SYSRTC0 not running. |
| RAIL_ASSERT_RADIO_CONFIG_NOT_UP_TO_DATE | Radio Configurator not updated. |
| RAIL_ASSERT_FAILED_RSSI_THRESHOLD | Failed to set the event for configurable RSSI threshold. |
| RAIL_ASSERT_INCORRECT_ZWAVE_REGION | Intended and actual Z-Wave region configuration mismatch. |
| RAIL_ASSERT_FAILED_RTCC_SYNC_STALE_DATA | Attempted to sleep with stale RTCC synchronization data. |
| RAIL_ASSERT_INVALID_LOG2X4_CLEAR_CONDITION | Attempted to clear LOG2X4 with a DEC1 value not equal to 0. |
| RAIL_ASSERT_FAILED_DMA_WRITE_INCOMPLETE | Failed to complete DMA write. |
| RAIL_ASSERT_CALCULATOR_NOT_SUPPORTED | RAIL does not support this Radio Calculator configuration. |
| RAIL_ASSERT_INVALID_SEQUENCER_IMAGE | Invalid binary image was loaded onto the sequencer. |
| RAIL_ASSERT_MISSING_SEQUENCER_IMAGE | No common or protocol image selected to be loaded onto the sequencer. |
| RAIL_ASSERT_INVALID_OR_MISSING_SOFTWARE_MODEM_IMAGE | Software modem image invalid or missing. |
| RAIL_ASSERT_SEQ_USER_SEQUENCER_GENERIC_ERROR | The sequencer user generated error. |
sl_rail_assert_error_codes_t#
sl_rail_assert_error_codes_t
Enumeration of all possible error codes from SL_RAIL_ASSERT.
| Enumerator | |
|---|---|
| SL_RAIL_ASSERT_FAILED_APPENDED_INFO_MISSING | Appended info missing from RX packet. |
| SL_RAIL_ASSERT_FAILED_RX_FIFO_BYTES | Receive FIFO too small for IR calibration. |
| SL_RAIL_ASSERT_UNEXPECTED_REG_RESET_VALUE | Unexpected register reset value. |
| SL_RAIL_ASSERT_FAILED_ILLEGAL_RXLEN_ENTRY_STATUS | Receive FIFO entry has invalid status. |
| SL_RAIL_ASSERT_FAILED_BAD_PACKET_LENGTH | Receive FIFO entry bad packet length. |
| SL_RAIL_ASSERT_FAILED_SYNTH_DIVCTRL_ENUM_CONVERSION_ERROR | Unable to configure radio for IR calibration. |
| SL_RAIL_ASSERT_FAILED_UNEXPECTED_STATE_RX_FIFO | Reached unexpected state while handling RX FIFO events. |
| SL_RAIL_ASSERT_FAILED_UNEXPECTED_STATE_RXLEN_FIFO | Reached unexpected state while handling RXLEN FIFO events. |
| SL_RAIL_ASSERT_FAILED_UNEXPECTED_STATE_TX_FIFO | Reached unexpected state while handling TX FIFO events. |
| SL_RAIL_ASSERT_FAILED_UNEXPECTED_STATE_TXACK_FIFO | Reached unexpected state while handling TX ACK FIFO events. |
| SL_RAIL_ASSERT_INVALID_MEMORY_ACCESS | Invalid memory region accessed. |
| SL_RAIL_ASSERT_FAILED_UNSUPPORTED_RX_DATA_SOURCE | Unsupported RX Data Source. |
| SL_RAIL_ASSERT_UNUSED_12 | Invalid assert, no longer used. |
| SL_RAIL_ASSERT_FAILED_RTCC_POST_WAKEUP | Error synchronizing the RAIL timebase after sleep. |
| SL_RAIL_ASSERT_FAILED_SYNTH_VCO_FREQUENCY | VCO frequency outside supported range. |
| SL_RAIL_ASSERT_FAILED_RAC_STATE | Radio active while changing channels. |
| SL_RAIL_ASSERT_FAILED_SYNTH_INVALID_VCOCTRL | Invalid Synth VCOCTRL field calculation. |
| SL_RAIL_ASSERT_FAILED_NESTED_SEQUENCER_LOCK | Nested attempt to lock the sequencer. |
| SL_RAIL_ASSERT_FAILED_RSSI_AVERAGE_DONE | RSSI averaging enabled without a valid callback. |
| SL_RAIL_ASSERT_UNUSED_19 | Invalid assert, no longer used. |
| SL_RAIL_ASSERT_FAILED_PROTIMER_RANDOM_SEED | Unable to seed radio pseudo random number generator. |
| SL_RAIL_ASSERT_UNUSED_21 | Invalid assert, no longer used. |
| SL_RAIL_ASSERT_FAILED_PROTIMER_CHANNEL | Invalid timer channel specified. |
| SL_RAIL_ASSERT_UNUSED_23 | Invalid assert, no longer used. |
| SL_RAIL_ASSERT_FAILED_BASECNTTOP | LBT config exceeds register size. |
| SL_RAIL_ASSERT_UNUSED_25 | Invalid assert, no longer used. |
| SL_RAIL_ASSERT_FAILED_RTCC_SYNC_MISSED | Could not synchronize RAIL timebase with the RTC. |
| SL_RAIL_ASSERT_FAILED_CLOCK_SOURCE_NOT_READY | Clock source not ready. |
| SL_RAIL_ASSERT_UNUSED_28 | Invalid assert, no longer used. |
| SL_RAIL_ASSERT_NULL_HANDLE | NULL was supplied as a sl_rail_handle_t argument. |
| SL_RAIL_ASSERT_UNUSED_30 | Invalid assert, no longer used. |
| SL_RAIL_ASSERT_FAILED_NO_ACTIVE_CONFIG | API improperly called while protocol inactive. |
| SL_RAIL_ASSERT_UNUSED_32 | Invalid assert, no longer used. |
| SL_RAIL_ASSERT_UNUSED_33 | Invalid assert, no longer used. |
| SL_RAIL_ASSERT_UNUSED_34 | Invalid assert, no longer used. |
| SL_RAIL_ASSERT_UNUSED_35 | Invalid assert, no longer used. |
| SL_RAIL_ASSERT_UNUSED_36 | Invalid assert, no longer used. |
| SL_RAIL_ASSERT_SEQ_USER_SEQUENCER_PROTOCOL_TAKE_TOO_LONG | Sequencer protocol stack running too long. |
| SL_RAIL_ASSERT_FAILED_TX_SYNTH_ENABLE | Failed to enable synth for transmit. |
| SL_RAIL_ASSERT_DEPRECATED_FUNCTION | This function is deprecated and must not be called. |
| SL_RAIL_ASSERT_MULTIPROTOCOL_NO_EVENT | Multiprotocol task started with no event to run. |
| SL_RAIL_ASSERT_FAILED_INVALID_INTERRUPT_ENABLED | Invalid interrupt enabled. |
| SL_RAIL_ASSERT_UNUSED_42 | Invalid assert, no longer used. |
| SL_RAIL_ASSERT_DIVISION_BY_ZERO | Division by zero. |
| SL_RAIL_ASSERT_CANT_USE_HARDWARE | Function cannot be called without access to the hardware. |
| SL_RAIL_ASSERT_NULL_PARAMETER | Pointer parameter was passed as NULL. |
| SL_RAIL_ASSERT_SECURE_ELEMENT_FAULT | Secure Element fault. |
| SL_RAIL_ASSERT_SMALL_SYNTH_RADIO_CONFIG_BUFFER | Synth radio config buffer for channel hopping too small. |
| SL_RAIL_ASSERT_CHANNEL_HOPPING_BUFFER_TOO_SHORT | Buffer provided for RX Channel Hopping is too small. |
| SL_RAIL_ASSERT_INVALID_MODULE_ACTION | Invalid action was attempted on a module. |
| SL_RAIL_ASSERT_CHANNEL_HOPPING_INVALID_RADIO_CONFIG | The radio config for this channel is not compatible with channel hopping. |
| SL_RAIL_ASSERT_CHANNEL_CHANGE_FAILED | Channel change failed. |
| SL_RAIL_ASSERT_INVALID_REGISTER | Attempted to read invalid register. |
| SL_RAIL_ASSERT_CP_DMA_INTERNAL_GENERIC_ERROR | CP/DMA Invalid error. |
| SL_RAIL_ASSERT_CACHE_CONFIG_FAILED | DMP radio config caching failed. |
| SL_RAIL_ASSERT_NULL_TRANSITIONS | NULL was supplied as a sl_rail_state_transitions_t argument. |
| SL_RAIL_ASSERT_BAD_LDMA_TRANSFER | LDMA transfer failed. |
| SL_RAIL_ASSERT_INVALID_RTCC_SYNC_VALUES | Attempted to wake up with invalid RTCC sync data. |
| SL_RAIL_ASSERT_SEQUENCER_FAULT | Radio sequencer hit a fault condition. |
| SL_RAIL_ASSERT_BUS_ERROR | Bus fault. |
| SL_RAIL_ASSERT_INVALID_FILTERING_CONFIG | The current radio config cannot be used with packet filtering. |
| SL_RAIL_ASSERT_RETIMING_CONFIG | Retiming configuration error. |
| SL_RAIL_ASSERT_FAILED_TX_CRC_CONFIG | TX CRC configuration is corrupt. |
| SL_RAIL_ASSERT_INVALID_PA_OPERATION | The current PA config does not allow for this operation. |
| SL_RAIL_ASSERT_SEQ_INVALID_PA_SELECTED | The sequencer selected an invalid PA. |
| SL_RAIL_ASSERT_FAILED_INVALID_CHANNEL_CONFIG | Invalid/unsupported channel config. |
| SL_RAIL_ASSERT_INVALID_XTAL_FREQUENCY | Radio Calculator configuration HFXO frequency mismatch with chip. |
| SL_RAIL_ASSERT_INTERNAL_GENERIC_ERROR | Internal error. |
| SL_RAIL_ASSERT_UNSUPPORTED_SOFTWARE_MODEM_MODULATION | Software modem image does not support requested modulation |
| SL_RAIL_ASSERT_FAILED_RTCC_SYNC_STOP | Failed to disable RTCC synchronization. |
| SL_RAIL_ASSERT_FAILED_MULTITIMER_CORRUPT | Multitimer linked list corrupted. |
| SL_RAIL_ASSERT_FAILED_TEMPCAL_ERROR | Unable to configure radio for temperature calibration. |
| SL_RAIL_ASSERT_INVALID_VDET_CONFIGURATION | Invalid VDET configuration. |
| SL_RAIL_ASSERT_INVALID_RFFPLL_CONFIGURATION | Invalid RFFPLL configuration. |
| SL_RAIL_ASSERT_SECURE_ACCESS_FAULT | Secure access fault. |
| SL_RAIL_ASSERT_FAILED_SYSRTC0_NOT_RUNNING | SYSRTC0 not running. |
| SL_RAIL_ASSERT_RADIO_CONFIG_NOT_UP_TO_DATE | Radio Configurator not updated. |
| SL_RAIL_ASSERT_FAILED_RSSI_THRESHOLD | Failed to set the event for configurable RSSI threshold. |
| SL_RAIL_ASSERT_INCORRECT_ZWAVE_REGION | Intended and actual Z-Wave region configuration mismatch. |
| SL_RAIL_ASSERT_FAILED_RTCC_SYNC_STALE_DATA | Attempted to sleep with stale RTCC synchronization data. |
| SL_RAIL_ASSERT_INVALID_LOG2X4_CLEAR_CONDITION | Attempted to clear LOG2X4 with a DEC1 value not equal to 0. |
| SL_RAIL_ASSERT_FAILED_DMA_WRITE_INCOMPLETE | Failed to complete DMA write. |
| SL_RAIL_ASSERT_CALCULATOR_NOT_SUPPORTED | RAIL does not support this Radio Calculator configuration. |
| SL_RAIL_ASSERT_INVALID_SEQUENCER_IMAGE | Invalid binary image was loaded onto the sequencer. |
| SL_RAIL_ASSERT_MISSING_SEQUENCER_IMAGE | No common or protocol image selected to be loaded onto the sequencer. |
| SL_RAIL_ASSERT_INVALID_OR_MISSING_SOFTWARE_MODEM_IMAGE | Software modem image invalid or missing. |
| SL_RAIL_ASSERT_SEQ_USER_SEQUENCER_GENERIC_ERROR | The sequencer user generated error. |
Function Documentation#
RAILCb_AssertFailed#
void RAILCb_AssertFailed (RAIL_Handle_t railHandle, RAIL_AssertErrorCodes_t errorCode)
Callback called upon failed assertion.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| RAIL_Handle_t | [in] | railHandle | A RAIL instance handle. |
| RAIL_AssertErrorCodes_t | [in] | errorCode | Value passed in by the calling assertion API indicating the RAIL assertion that failed. |
DeprecatedThis RAIL 2.x callback has been replaced in RAIL 3 by sl_railcb_assert_failed() with an additional parameter.
sl_railcb_assert_failed#
void sl_railcb_assert_failed (sl_rail_handle_t rail_handle, sl_rail_assert_error_codes_t error_code, int line)
Callback called upon failed assertion.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_rail_handle_t | [in] | rail_handle | A radio-generic or real RAIL instance handle. |
| sl_rail_assert_error_codes_t | [in] | error_code | Value passed in by the calling assertion API indicating the RAIL assertion that failed. |
| int | [in] | line | An auxiliary value helping pinpoint which of several places the error_code assertion might have failed. |