SPNA245 September 2020 TM4C1290NCPDT , TM4C1290NCPDT , TM4C1290NCZAD , TM4C1290NCZAD , TM4C1292NCPDT , TM4C1292NCPDT , TM4C1292NCZAD , TM4C1292NCZAD , TM4C1294KCPDT , TM4C1294KCPDT , TM4C1294NCPDT , TM4C1294NCPDT , TM4C1294NCZAD , TM4C1294NCZAD , TM4C1297NCZAD , TM4C1297NCZAD , TM4C1299KCZAD , TM4C1299KCZAD , TM4C1299NCZAD , TM4C1299NCZAD , TM4C129CNCPDT , TM4C129CNCPDT , TM4C129CNCZAD , TM4C129CNCZAD , TM4C129DNCPDT , TM4C129DNCPDT , TM4C129DNCZAD , TM4C129DNCZAD , TM4C129EKCPDT , TM4C129EKCPDT , TM4C129ENCPDT , TM4C129ENCPDT , TM4C129ENCZAD , TM4C129ENCZAD , TM4C129LNCZAD , TM4C129LNCZAD , TM4C129XKCZAD , TM4C129XKCZAD , TM4C129XNCZAD , TM4C129XNCZAD
The version of the driver library file can.c in TivaWare version 2.2.0.295 and earlier, and the ROM based version, use interface one (IF1) registers for most functions and interface two (IF2) registers for receiving messages (CANMessageGet()). This can create an issue when the CAN functions are used in the main application code and in interrupt routines or in multiple threads of an RTOS. The consistency of the interface registers is not maintained during the interrupt or task switch. The updated version of can.c included with this application note uses IF1 registers for all functions when the CPU is not in an exception and uses IF2 registers when the CPU is in an exception state. This simplifies writing code for CAN using interrupts. When using an RTOS, all CAN functions should be in one thread or in one interrupt routine.
The can.c file located in the driverlib folder of the latest TivaWare installation can be replaced with the provided can.c file and the driver library rebuilt, or the provided can.c file can be added directly to your project.