I’m testing the flexcan_network example for the colibri iMX7 on the cortex-m4. During the execution process the BOARD_FLEXCAN_HANDLER method / flexcan1 interrupt handler was never executed. The program itself is working correctly except the send and receive interrupt.
Additionally I checked the values of the following internal registers of the cortex-m4 for the flecan 1.
I was not able to reproduce your problem. I hooked a CAN Analzer (CANdoISO) up to the Evaluation board and was successfully able to transmit and receive messages. Let me describe my setup and point out some common pitfalls…
#Setup
The Colibri Evaluationboard needs to
be configured properly. Please refer
to the document below for details:
On my PC I had 2 terminal programs running: one for
UARTA, one for UARTB
I booted the Colibri into U-Boot and started a dummy M4 application which does nothing but looping forever. This is my standard procedure to turn on all required clocks, so I can later easily hook up the JTAG debugger.
I started the CAN Analyzer, making sure that
The baud rate was correctly set to 125kbps
The analyzer was in “normal” mode (not in “ListenOnly”)
I used VSCode to build the flexcan_network project in debug configuration, and to download and run it through the JTAG debugger.
Now I was able to see the debug messages on UARTB, showing that the application was transmitting a CAN message once every second.
Using the CAN analyzer I transmitted messages with ID 0x321 and was able to see on UARTB that these messages were received properly.
It is crucial that there is an active second CAN device on the bus. This is required to acknowledge transmitted messages.
If you abort the application while running (for example with the debugger), restarting the application is not always sufficient to bring the CAN controller back in a proper state. If you see inproper functioning, I recommend to do a power cycle and start over
Linux could possibly lock some resources once it is started. Try to run the application from U-Boot.