Error Handling

Runtime errors in the ARXF-CP are handled by the error handler RXF_ErrorHandler_error(). The error handler will catch use of NULL pointers, lack of resources, etc.

The error handler function is called from several places in the Framework, the first argument indicates the error that occurred, the second parameter is not always used but for instance in case of an BSW/RTE failure, the BSW/RTE error code is passed here. The third parameter "returnAllowed" can be used to decide it the software can recover from that error after application specific error handling or if the error is expected to require a shutdown or reboot. But the final decision which errors are handled in which way can only be decided with application knowledge by the developer.

The example implementation of the operation RXF_ErrorHandler_error() is implemented as an endless loop in the source file RXF_ErrorHandler.c, if "returnAllowed" is false. Otherwise it just returns.

The ARXF-CP calls the error handler so you must provide one, otherwise the the linker will throw an error unresolved external symbol _RXF_ErrorHandler_error.

For this, you can use the RXFErrorHandler Stereotype of this Framework:

"Error Codes

Error Description
RXF_ERROR_EMPTY_ME_PTR
An ARXF-CP operation was called with me == NULL.
For initialization of a structured class which is a part of a SWC, there is a workaround. For other cases, this is considered a code generation error.
RXF_ERROR_TASK_INIT_FAILED
This error can only occur in the Windows simulation.
RXF_ERROR_TASK_START_FAILED
This error can only occur in the Windows simulation.
RXF_ERROR_TASK_DELETE_FAILED
This code is used for compatibility reasons and can not occur in this product.
WST_ERR_MEM_EMPTY_TASK_PTR
In a call to RXF_MemoryManager_getMemory() the RXF_Active pointer is NULL. See section Code generation for Events automatically adds a RXF_Active pointer argument. Contact Support.
RXF_ERROR_TIMER_CREATE_FAILED
This code is used for compatibility reasons and can not occur in this product.
RXF_ERROR_TIMER_START_FAILED
A timout could not be added to the timer queue, see Memory Pools tab of the RXF Configuration.
RXF_ERROR_MUTEX_CREATE_FAILED
This error can only occur in the Windows simulation.
RXF_ERROR_MUTEX_CLEANUP_FAILED
This code is used for compatibility reasons and can not occur in this product.
RXF_ERROR_MUTEX_LOCK_FAILED
This code is used for compatibility reasons and can not occur in this product.
RXF_ERROR_MUTEX_UNLOCK_FAILED
This code is used for compatibility reasons and can not occur in this product.
RXF_ERROR_MUTEX_EMPTY_PTR
A NULL pointer was passed to RXF_SWC_Init(), see initialization of exclusive areas for critical region handler purposes. See Best Practices section Initialization.
RXF_ERROR_MEMORY_ALLOC_TOO_LARGE
The requested size is larger than the largest static memory block specified on the Memory Pools tab of the RXF Configuration and the constant RXF_MEMORY_USE_HEAP is not defined.
RXF_ERROR_MEMORY_CONFIG_ERROR
The requested size is smaller or equal than the largest static memory block on the Memory Pools tab of the RXF Configuration but no more memory is available. Either the static memory pools and/or the heap is exhausted.
RXF_ERROR_MEMORY_INVALID_RETURN_PTR
If RXF_MEMORY_USE_HEAP is not enabled on the Memory Pools tab of the RXF Configuration, the returned memory is not from a memory pool.
RXF_ERROR_REACTIVE_EVENT_NOT_CONSUMED
When RXF_ERROR_REACTIVE_EVENT_NOT_CONSUMED is not enabled on the Configuration tab of the RXF Configuration, the ARXF-CP will call the error handler with this error code when:
  • the event is not a timeout event so timeout events can not trigger this error
  • an event was not consumed
  • the application model does not define a specific handler for this in the property C_CG::Framework::ReactiveHandleEventNotConsumed.
Events are not consumed if the destination statechart (in the current state) does not wait for that trigger.
RXF_ERROR_REACTIVE_EVENT_REUSE_DETECTED
An event was re-used, i.e. the same event object is sent again while it is still queued.
RXF_ERROR_REACTIVE_EMPTY_VTBL_PTR
A virtual table is used to call the generated statechart functions. It may never be NULL. This is considered a code generation error.
RXF_ERROR_REACTIVE_VTBL_EMPTY_DISPATCHEVENT_PTR
The ARXF-CP handles a statechart but the vtbl contains a NULL pointer to the event handling function. This is considered a code generation error.
RXF_ERROR_TOO_FEW_NULL_CONFIGS
The null transition count has in invalid value. This is considered a code generation error.
RXF_ERROR_INFINITE_NULL_TRANSITIONS
The null transition count RXF_MAX_NULL_STEPS on the Configuration tab of the RXF Configuration has exceeded.
RXF_ERROR_EVENT_DESTINATION_NULL
Attempt to send an event to a NULL destination.
WST_ERR_ITF_EMPTY_VTBL_PTR
This code is used for compatibility reasons.
WST_ERR_ITF_VTBL_EMPTY_GEN_PTR
This code is used for compatibility reasons.
RXF_ERROR_RTOS_INIT_FAILED Not applicable in an AUTOSAR environment. Defined for compatibility reasons.
RXF_ERROR_EMPTY_SWC_PTR When trying to access the RXF_SWC structure, the pointer was NULL.
RXF_ERROR_WIN_EVENT_FAILED This error can only occur in the Windows simulation.
RXF_ERROR_WIN_THREAD_FAILED This error can only occur in the Windows simulation.
RXF_ERROR_AUTOSAR_SWC_INIT_ERROR SWC is already initialized. See AUTOSAR section Initialization.