J1939 stack errors¶
Error Class¶
The errors are allocated to the three following classes:
Warning¶
A function (in the sense of a task) could not be performed, as a pre-requisite or an external condition was not fulfilled. It may also be that the execution of the function currently is not possible but can be repeated later. In general, this type of error can be ignored in a running system or is handled by the application.
Statistical analysis or recording of the errors may be useful.
Examples of these errors are:
CAN controller in warning level
transmit queue full
communication aborted by the remote station
Error¶
An error has occurred in the system that does not inhibit continuous operation but that cannot be ignored in general. These are often errors caused by overload or incorrect input data. This error can lead to subsequent errors. Depending on the application, the system must be set to an error state or shut down completely. Continued operation of the system in est/debug mode may be advisable.
Examples of these errors are:
data overrun in the receive queue
protocol aborts due to temporary memory problems
timeouts of real-time tasks
Fatal¶
A fatal error has occurred in the system, which, in most cases, inhibits further software operation. Depending on the application, the system must be shut down completely or rebooted.
Examples of these errors are:
stack overrun
CAN controller in Bus-Off
no more free memory available
error in memory- or HW-monitoring
invalid system states
OK¶
No error. Used to acknowledge errors.
Example could be:
send ERR_OK when cyclic reception monitoring starts to receive signals again!
Error ID¶
Error Identifiers: The error identifiers of the several units, which use the error unit. It’s possible to use the error unit also for application errors. Therefore the error identifier of the application has to be added.
ID | Description |
---|---|
ERR_ERR_ID 0 | Error unit identifier |
DLL_ERR_ID 1 | Data link layer identifier |
MEM_ERR_ID 2 | Memory unit identifier |
TPL_ERR_ID 3 | Transport protocol identifier |
NWM_ERR_ID 4 | Network management identifier |
APL_ERR_ID 5 | Application layer identifier |
CYC_ERR_ID 6 | Cycle unit identifier |
REQ_ERR_ID 7 | Request unit identifier |
L2C_ERR_ID 8 | Layer 2 unit identifier |
ADR_ERR_ID 9 | Addressing unit identifier |
NMEA_ERR_ID 10 | NMEA 2000 module |
CDP_ERR_ID 11 | AN Diagnostic Protocol |
DIAG_ERR_ID 12 | J1939 Diagnostic Module |
USR_ERR_ID 13 | User specific code (generated) |
Error Number¶
/** Errors of the APL unit:
** In the following all synchronous and asynchronous errors of the APL unit are defined.
*/
/*------------------------------------------------------------------------
/ Synchronous Errors
/-----------------------------------------------------------------------*/
/** APL_ERR_TIME_EXCEEDED:** APL_Main() was not called in the required sequence*/
#define APL_ERR_TIME_EXCEEDED ERR_BUILD_ERROR_CODE(ERR_ERROR , APL_ERR_ID, 1)
/** APL_ERR_TX_LONG:** The data field of the transmit message is too long*/
#define APL_ERR_TX_LONG ERR_BUILD_ERROR_CODE(ERR_FATAL , APL_ERR_ID, 2)
/** APL_ERR_NO_MEMORY:
** No memory for the data field of the transmit message allocated
*/
#define APL_ERR_NO_MEMORY ERR_BUILD_ERROR_CODE(ERR_ERROR , APL_ERR_ID, 3)
/** APL_ERR_REG_REQUEST:
** An error occurred during registration of a request PGN
*/
#define APL_ERR_REG_REQUEST ERR_BUILD_ERROR_CODE(ERR_ERROR , APL_ERR_ID, 4)
/** APL_ERR_TX_NO_ADDR:
** Device has no address claimed
*/
#define APL_ERR_TX_NO_ADDR ERR_BUILD_ERROR_CODE(ERR_ERROR , APL_ERR_ID, 5)
/** APL_ERR_INVALID_PARAM:
** Invalid parameter passed to an API function
*/
#define APL_ERR_INVALID_PARAM ERR_BUILD_ERROR_CODE(ERR_WARNING , APL_ERR_ID, 6)
/*------------------------------------------------------------------------
/ Asynchronous Errors
/-----------------------------------------------------------------------*/
/** APL_ERR_REQ_RESPONSE:
** A request message couldn't be answered from the request handler due to
** a queue overrun.
*/
#define APL_ERR_REQ_RESPONSE ERR_BUILD_ERROR_CODE(ERR_WARNING, APL_ERR_ID, 11)
/** Errors of the CYC unit:
** In the following all synchronous and asynchronous errors of the CYC
** unit are defined.
*/
/*------------------------------------------------------------------------
/ Synchronous Errors
/-----------------------------------------------------------------------*/
/** CYC_ERR_NOT_INITIALIZED:
** The unit is not yet initialized.
*/
#define CYC_ERR_NOT_INITIALIZED ERR_BUILD_ERROR_CODE(ERR_FATAL, CYC_ERR_ID, 1)
/** CYC_ERR_RX_REGISTRATION:
** The maximal number of receive messages is exceeded.
*/
#define CYC_ERR_RX_REGISTRATION ERR_BUILD_ERROR_CODE(ERR_FATAL, CYC_ERR_ID, 2)
/** CYC_ERR_TX_REGISTRATION:
** The maximal number of transmit messages is exceeded.
*/
#define CYC_ERR_TX_REGISTRATION ERR_BUILD_ERROR_CODE(ERR_FATAL, CYC_ERR_ID, 3)
/** CYC_ERR_TIME_EXCEEDED:
** CYC_Main() was not called in the required sequence.
*/
#define CYC_ERR_TIME_EXCEEDED ERR_BUILD_ERROR_CODE(ERR_ERROR, CYC_ERR_ID, 4)
/*------------------------------------------------------------------------
/ Asynchronous Errors
/-----------------------------------------------------------------------*/
/** CYC_ERR_RX_TIMEOUT:
** A registered message wasn't received in the given time.
*/
#define CYC_ERR_RX_TIMEOUT ERR_BUILD_ERROR_CODE(ERR_ERROR, CYC_ERR_ID, 11)
/** CYC_ERR_RX_TIMEOUT_OK:
** A registered message were received in the given time.
*/
#define CYC_ERR_RX_TIMEOUT_OK ERR_BUILD_ERROR_CODE(ERR_OK, CYC_ERR_ID, 11)
/** CYC_ERR_TX_INVALID_HDL:
** A message couldn't be sent due to an invalid address handle.
*/
#define CYC_ERR_TX_INVALID_HDL ERR_BUILD_ERROR_CODE(ERR_ERROR, CYC_ERR_ID, 12)
/** CYC_ERR_TX_QUEUE_OVRN:
** A message couldn't be sent due to an overrun of the transmit queue.
*/
#define CYC_ERR_TX_QUEUE_OVRN ERR_BUILD_ERROR_CODE(ERR_WARNING, CYC_ERR_ID, 13)
/** CYC_ERR_RX_INVALID_LENGTH:
** The length of the received message is too long for the receive buffer.
*/
#define CYC_ERR_RX_INVALID_LENGTH ERR_BUILD_ERROR_CODE(ERR_ERROR, CYC_ERR_ID, 14)
/** Errors of the NWM unit:
** In the following all synchronous and asynchronous errors of the NWM
** unit are defined.
*/
/*------------------------------------------------------------------------
/ Synchronous Errors
/-----------------------------------------------------------------------*/
/** NWM_ERR_DEVICE_REG:
** The device is already registered in the device list.
*/
#define NWM_ERR_DEVICE_REG ERR_BUILD_ERROR_CODE(ERR_ERROR, NWM_ERR_ID, 1)
/** NWM_ERR_INVALID_HDL:
** The device handle is invalid.
*/
#define NWM_ERR_INVALID_HDL ERR_BUILD_ERROR_CODE(ERR_ERROR, NWM_ERR_ID, 2)
/** NWM_ERR_INVALID_ADDR:
** The device address is invalid.
*/
#define NWM_ERR_INVALID_ADDR ERR_BUILD_ERROR_CODE(ERR_ERROR, NWM_ERR_ID, 3)
/*------------------------------------------------------------------------
/ Asynchronous Errors
/-----------------------------------------------------------------------*/
/** NWM_ERR_NO_COMM:
** The device is not able to start the CAN communication (starting CAN failed).
*/
#define NWM_ERR_NO_COMM ERR_BUILD_ERROR_CODE(ERR_FATAL, NWM_ERR_ID, 11)
/** NWM_ERR_NO_ADDR:
** The device is not able to claim an address and is therefore not allowed
** to take part at network communication any longer.
*/
#define NWM_ERR_NO_ADDR ERR_BUILD_ERROR_CODE(ERR_FATAL, NWM_ERR_ID, 12)
/** NWM_ERR_LIST_FULL:
** The maximum number of nodes in the network (CNF_NWM_MAX_NODES_IN_NET)
** is exceeded.
*/
#define NWM_ERR_LIST_FULL ERR_BUILD_ERROR_CODE(ERR_FATAL, NWM_ERR_ID, 13)
/** Errors of the TPL unit:
** In the following all synchronous and asynchronous errors of the TPL
** unit are defined.
*/
/*------------------------------------------------------------------------
/ Synchronous Errors
/-----------------------------------------------------------------------*/
/** TPL_ERR_TX_OVRN:
** No free Entry in the TxQueue of the TPL available.
*/
#define TPL_ERR_TX_OVRN ERR_BUILD_ERROR_CODE(ERR_WARNING, TPL_ERR_ID, 1)
/** TPL_ERR_CONF_FILTER:
** Too many PGNs tried to register in the config filter.
*/
#define TPL_ERR_CONF_FILTER ERR_BUILD_ERROR_CODE(ERR_FATAL, TPL_ERR_ID, 2)
/*------------------------------------------------------------------------
/ Asynchronous Errors
/-----------------------------------------------------------------------*/
/** TPL_ERR_UNEXP_BAM_FRM:
** Unexpected BAM frame received.
*/
#define TPL_ERR_UNEXP_BAM_FRM ERR_BUILD_ERROR_CODE(ERR_WARNING, TPL_ERR_ID,11)
/** TPL_ERR_UNEXP_RTS_FRM:
** Unexpected RTS frame received
*/
#define TPL_ERR_UNEXP_RTS_FRM ERR_BUILD_ERROR_CODE(ERR_WARNING, TPL_ERR_ID,12)
/** TPL_ERR_UNEXP_CTS_FRM:
** Unexpected CTS frame received.
*/
#define TPL_ERR_UNEXP_CTS_FRM ERR_BUILD_ERROR_CODE(ERR_WARNING, TPL_ERR_ID,13)
/** TPL_ERR_UNEXP_EOM_FRM:
** Unexpected EOM frame received.
*/
#define TPL_ERR_UNEXP_EOM_FRM ERR_BUILD_ERROR_CODE(ERR_WARNING, TPL_ERR_ID,14)
/** TPL_ERR_UNEXP_CA_FRM:
** Unexpected CA frame received.
*/
#define TPL_ERR_UNEXP_CA_FRM ERR_BUILD_ERROR_CODE(ERR_WARNING, TPL_ERR_ID,15)
/** TPL_ERR_UNEXP_DT_FRM:
** Unexpected DT frame received.
*/
#define TPL_ERR_UNEXP_DT_FRM ERR_BUILD_ERROR_CODE(ERR_WARNING, TPL_ERR_ID,16)
/** TPL_ERR_RX_OVRN:
** No free Rx Msg Buffer in the TPL for a global message available.
*/
#define TPL_ERR_RX_OVRN ERR_BUILD_ERROR_CODE(ERR_ERROR , TPL_ERR_ID,17)
/** TPL_ERR_TX_TIMEOUT0:
** Timer overrun for Tx Timeout T0.
*/
#define TPL_ERR_TX_TIMEOUT0 ERR_BUILD_ERROR_CODE(ERR_WARNING, TPL_ERR_ID,18)
/** TPL_ERR_TX_TIMEOUT2:
** Timer overrun for Tx Timeout T2.
*/
#define TPL_ERR_TX_TIMEOUT2 ERR_BUILD_ERROR_CODE(ERR_WARNING, TPL_ERR_ID,19)
/** TPL_ERR_RX_TIMEOUT0:
** Timer overrun for Rx Timeout T0.
*/
#define TPL_ERR_RX_TIMEOUT0 ERR_BUILD_ERROR_CODE(ERR_ERROR , TPL_ERR_ID,20)
/** TPL_ERR_RX_TIMEOUT1:
** Timer overrun for Rx Timeout T1.
*/
#define TPL_ERR_RX_TIMEOUT1 ERR_BUILD_ERROR_CODE(ERR_ERROR , TPL_ERR_ID,21)
/** TPL_ERR_RX_TIMEOUT2:
** Timer overrun for Rx Timeout T2.
*/
#define TPL_ERR_RX_TIMEOUT2 ERR_BUILD_ERROR_CODE(ERR_ERROR , TPL_ERR_ID,22)
/** TPL_ERR_RX_LONG:
** The length of the received message is too long for a seg msg.
*/
#define TPL_ERR_RX_LONG ERR_BUILD_ERROR_CODE(ERR_FATAL , TPL_ERR_ID,23)
/** TPL_ERR_SEND_MSG:
** Error by Sending: Can't send a segmented message.
*/
#define TPL_ERR_SEND_MSG ERR_BUILD_ERROR_CODE(ERR_ERROR , TPL_ERR_ID,24)
/** TPL_ERR_SEND_CA:
** Sending a CA message failed.
*/
#define TPL_ERR_SEND_CA ERR_BUILD_ERROR_CODE(ERR_ERROR , TPL_ERR_ID,25)
/** TPL_ERR_SEND_NACK:
** Sending a NACK message failed.
*/
#define TPL_ERR_SEND_NACK ERR_BUILD_ERROR_CODE(ERR_ERROR , TPL_ERR_ID,26)
/** Errors of the DLL unit:
** In the following all synchronous and asynchronous errors of the DLL
** unit are defined.
*/
/*------------------------------------------------------------------------
/ Synchronous Errors
/-----------------------------------------------------------------------*/
/** DLL_ERR_TX_OVRN:
** overrun in the TxQueue.
*/
#define DLL_ERR_TX_OVRN ERR_BUILD_ERROR_CODE(ERR_WARNING, DLL_ERR_ID, 1)
/** DLL_ERR_START_CAN:
** starting CAN failed.
*/
#define DLL_ERR_START_CAN ERR_BUILD_ERROR_CODE(ERR_FATAL , DLL_ERR_ID, 2)
/** DLL_ERR_RESET_CAN:
** reset CAN failed.
*/
#define DLL_ERR_RESET_CAN ERR_BUILD_ERROR_CODE(ERR_FATAL , DLL_ERR_ID, 3)
/** DLL_ERR_INIT_CAN:
** init CAN failed.
*/
#define DLL_ERR_INIT_CAN ERR_BUILD_ERROR_CODE(ERR_FATAL , DLL_ERR_ID, 4)
/*------------------------------------------------------------------------
/ Asynchronous Errors
/-----------------------------------------------------------------------*/
/** DLL_ERR_BOFF:
** bus error interrupt occurs on CAN.
*/
#define DLL_ERR_BOFF ERR_BUILD_ERROR_CODE( ERR_FATAL , DLL_ERR_ID, 11)
/** DLL_ERR_EPAS:
** error warning interrupt occurs on CAN
*/
#define DLL_ERR_EPAS ERR_BUILD_ERROR_CODE( ERR_WARNING , DLL_ERR_ID, 12)
/** DLL_ERR_EACT:
** CAN controller is in status error active.
*/
#define DLL_ERR_EACT ERR_BUILD_ERROR_CODE( ERR_WARNING , DLL_ERR_ID, 13)
/** DLL_ERR_DOI:
** data overrun interrupt occurs on CAN.
*/
#define DLL_ERR_DOI ERR_BUILD_ERROR_CODE( ERR_ERROR , DLL_ERR_ID, 14)
/** DLL_ERR_RX_OVRN:
** overrun in the RxQueue.
*/
#define DLL_ERR_RX_OVRN ERR_BUILD_ERROR_CODE( ERR_ERROR , DLL_ERR_ID, 15)
/** Errors of the MEM unit:
** In the following all synchronous and asynchronous errors of the MEM
** unit are defined.
*/
/*------------------------------------------------------------------------
/ Synchronous Errors
/-----------------------------------------------------------------------*/
/*------------------------------------------------------------------------
/ Asynchronous Errors
/-----------------------------------------------------------------------*/
/** MEM_ERR_ALLOC_MEMORY:
** Allocate memory failed.
*/
#define MEM_ERR_ALLOC_MEMORY ERR_BUILD_ERROR_CODE
( ERR_FATAL, MEM_ERR_ID, 11)
/** MEM_ERR_FREE_MEMORY:
** Free memory failed.
*/
#define MEM_ERR_FREE_MEMORY ERR_BUILD_ERROR_CODE
( ERR_WARNING, MEM_ERR_ID, 12)
/** Errors of the ERR unit:
** In the following all synchronous and asynchronous errors of the ERR
** unit are defined.
*/
/*------------------------------------------------------------------------
/ Synchronous Errors
/-----------------------------------------------------------------------*/
/** ERR_ERR_INVALID_PARAM:
** Invalid parameter passed to an API function
*/
#define ERR_ERR_INVALID_PARAM ERR_BUILD_ERROR_CODE
(ERR_WARNING , ERR_ERR_ID, 1)
/** Errors of the USR unit (generated by the J1939 Designer):
** In the following all synchronous and asynchronous errors of the USR
** unit are defined.
*/
/*------------------------------------------------------------------------
/ Asynchronous Errors
/-----------------------------------------------------------------------*/
/** USR_ERR_REQ_RESPONSE:
** A request message couldn't be answered from the request handler due to
** a queue overrun.
*/
#define USR_ERR_REQ_RESPONSE ERR_BUILD_ERROR_CODE(ERR_WARNING, USR_ERR_ID, 11)
/** Errors of the REQ unit:
** In the following all synchronous and asynchronous errors of the REQ
** unit are defined.
*/
/*------------------------------------------------------------------------
/ Synchronous Errors
/-----------------------------------------------------------------------*/
/** REQ_ERR_INVALID_PARAM:
** Invalid parameter passed to an API function
*/
#define REQ_ERR_INVALID_PARAM ERR_BUILD_ERROR_CODE(ERR_WARNING , REQ_ERR_ID, 1)
/** Errors of the DIAG unit:
** In the following all synchronous and asynchronous errors of the DIAG
** unit are defined.
*/
/*------------------------------------------------------------------------
/ Asynchron Errors
/-------------------------------------------------------------------------
/ Description * Location
/-----------------------------------------------------------------------*/
/** DIAG_ERR_MEM_ABORTED_TX:
** A memory access session was aborted due to a transmit problem
** (sending a memory access message failed).
*/
#define DIAG_ERR_MEM_ABORTED_TX ERR_BUILD_ERROR_CODE(ERR_ERROR, DIAG_ERR_ID, 11)
/** DIAG_ERR_MEM_ABORTED_RX:
** A memory access session was aborted due to a receive problem
** (a memory access message wasn't received in the expected time).
*/
#define DIAG_ERR_MEM_ABORTED_RX ERR_BUILD_ERROR_CODE(ERR_ERROR, DIAG_ERR_ID, 12)
/** DIAG_ERR_MEM_ABORTED_KEY:
** A memory access session was aborted due to security reasons
** (an invalid key was received).
*/
#define DIAG_ERR_MEM_ABORTED_KEY ERR_BUILD_ERROR_CODE(ERR_WARNING, DIAG_ERR_ID, 13)
/** DIAG_ERR_MEM_ABORTED_DATA:
** A memory access session was aborted due to addressing problems
** (invalid data length was received).
*/
#define DIAG_ERR_MEM_ABORTED_DATA ERR_BUILD_ERROR_CODE(ERR_WARNING, DIAG_ERR_ID, 14)
/** DIAG_ERR_MEM_BUSY:
** A memory access session was declined because the device is busy
** (another session is in process).
*/
#define DIAG_ERR_MEM_BUSY ERR_BUILD_ERROR_CODE(ERR_WARNING, DIAG_ERR_ID, 15)
/** DIAG_ERR_MEM_BUSY_FAILED:
** Transmit a memory access response 'busy' failed.
*/
#define DIAG_ERR_MEM_BUSY_FAILED ERR_BUILD_ERROR_CODE(ERR_WARNING, DIAG_ERR_ID, 16)
/** DIAG_ERR_MEM_INVALID_MSG:
** Invalid message received (the received PGN was not registered for the
** diagnostic unit).
*/
#define DIAG_ERR_MEM_INVALID_MSG ERR_BUILD_ERROR_CODE(ERR_ERROR, DIAG_ERR_ID, 17)
/** Errors of the CDP unit:
** In the following all synchronous and asynchronous errors of the CDP
** unit are defined.
*/
/*------------------------------------------------------------------------
/ Asynchronous Errors
/-----------------------------------------------------------------------*/
/** CDP_ERR_TIME_EXCEEDED:
** CDP_Main() was not called in the required sequence
*/
#define CDP_ERR_TIME_EXCEEDED ERR_BUILD_ERROR_CODE(ERR_ERROR , CDP_ERR_ID, 1)
/** CDP_ERR_ADDR_FORMAT:
** The addressing format of the CAN diagnostic protocol is invalid.
*/
#define CDP_ERR_ADDR_FORMAT ERR_BUILD_ERROR_CODE(ERR_ERROR , CDP_ERR_ID, 2)
/** CDP_ERR_CONF_PGN:
** There is no PGN entry free to register a CDP message.
*/
#define CDP_ERR_CONF_PGN ERR_BUILD_ERROR_CODE(ERR_ERROR , CDP_ERR_ID, 3)
/** CDP_ERR_UNKNOWN_PGN:
** PGN is not registered.
*/
#define CDP_ERR_UNKNOWN_PGN ERR_BUILD_ERROR_CODE(ERR_ERROR , CDP_ERR_ID, 4)
/** CDP_ERR_STATE_READY_TX:
** PGN is not ready for transmitting a CAN diagnostic message.
*/
#define CDP_ERR_STATE_READY_TX ERR_BUILD_ERROR_CODE(ERR_WARNING, CDP_ERR_ID, 5)
/** CDP_ERR_STATE_READY_RX:
** PGN is not ready for receiving a CAN diagnostic message.
*/
#define CDP_ERR_STATE_READY_RX ERR_BUILD_ERROR_CODE(ERR_ERROR , CDP_ERR_ID, 6)
/** CDP_ERR_NO_MEMORY:
** No memory for the data field allocated.
*/
#define CDP_ERR_NO_MEMORY ERR_BUILD_ERROR_CODE(ERR_ERROR , CDP_ERR_ID, 7)
/*------------------------------------------------------------------------
/ Synchronous Errors
/-----------------------------------------------------------------------*/
/** CDP_ERR_ALLOC_MEMORY:
** Allocate memory failed.
*/
#define CDP_ERR_ALLOC_MEMORY ERR_BUILD_ERROR_CODE(ERR_ERROR , CDP_ERR_ID, 11)
/** CDP_ERR_FREE_MEMORY:
** Free memory failed.
*/
#define CDP_ERR_FREE_MEMORY ERR_BUILD_ERROR_CODE(ERR_ERROR, CDP_ERR_ID, 12)
/** CDP_ERR_RX_LENGTH:
** The length of the received CAN diagnostic protocol message is too large
** for the available receive buffer.
*/
#define CDP_ERR_RX_LENGTH ERR_BUILD_ERROR_CODE(ERR_ERROR , CDP_ERR_ID, 13)
/** CDP_ERR_RX_TIMEOUT_FC:
** The CAN diagnostic protocol flow control message wasn't received in the
** given time.
*/
#define CDP_ERR_RX_TIMEOUT_FC ERR_BUILD_ERROR_CODE(ERR_ERROR , CDP_ERR_ID, 14)
/** CDP_ERR_RX_TIMEOUT_CF:
** The CAN diagnostic protocol consecutive frame message wasn't received in
** the given time.
*/
#define CDP_ERR_RX_TIMEOUT_CF ERR_BUILD_ERROR_CODE(ERR_ERROR , CDP_ERR_ID, 15)
/** CDP_ERR_TX_TIMEOUT:
** The CAN diagnostic protocol message wasn't sent in the given time.
*/
#define CDP_ERR_TX_TIMEOUT ERR_BUILD_ERROR_CODE(ERR_ERROR , CDP_ERR_ID, 16)
/** CDP_ERR_PCI_INVALID:
** The CAN diagnostic protocol control information was invalid.
*/
#define CDP_ERR_PCI_INVALID ERR_BUILD_ERROR_CODE(ERR_ERROR , CDP_ERR_ID, 17)