When trying to run the flexcan_network demo code, the interrupt handler BOARD_FLEXCAN_HANDLER is not called when trying to send a message. I suspect that something is going wrong with the sending part.
I’m using FlexCAN2 with the following pin muxing: case CAN2_BASE: // CAN2_TX SODIMM 94 IOMUXC_SW_MUX - Pastebin.com.
However when printing out the value of IOMUXC_SW_MUX_CTL_PAD_I2C3_SCL it returns a 5, which is for ALT5_GPIO4_IO13, instead of the 2, which is for ALT2_FLEXCAN2_TX, that it is supposed to return.
Could it be that the pin muxing is overwritten after it is set in pin_mux.h and that this creates issues with the interrupts for flexcan2?
I created a secondary dts file, imx7d-colibri-emmc-aster2.dts with the changes you provided in your post. I also changed the environment variable, as this was not done yet. It seems as if the pin muxing is correct now, i’m getting the correct register values!
However, for some reason the interrupt is still not working. The IFLAG bit for the TXMsgbuffer, in my case 8, is not being set either. The IMASK1 bits are set correctly however.
My current setup consists of the Colibri iMX7 board in the Aster carrier board. From the Aster carrier board I connect pins X20-29 and X20-31 to the Rx and Tx of an MCP2562 CAN transceiver. I try and read out data from the CAN H and CAN L pins from this transceiver with a oscilloscope.
For software i’m using the flexcan_network example, with no changes made(except for some printf methods) and for the pin muxing the pastebin mentioned above is used. Besides that I changed the devicetree as stefan_e suggested. I am running both the m4-core and Linux simultaneously.
For the project i’m working on we’d prefer to have everything working on the board we have now, with an external CAN Transceiver.
Is it possible that you try to recreate my setup, mentioned in a comment above, with the same carrier board, so that we can rule out any hardware issues?
No at this point I am not do further investigation. I tested two setups successfully and was able to communicate just fine, so software is fine. Doing further investigation is project/application specific beyond the free support.