Hi,
I use FlexCAN in conjunction with MQX on a K70. I don't want hardware message filtering and set therefore the global standard mask to zero. I need to use multiple mailboxes for reception. This is necessary to allow reading out a received message from one mailbox but having still other mailboxes receiving messages. This approach seems to work except that only one mailbox is really receiving all messages. My test shows that the mailbox with the smallest index always gets all messages and if this mailbox is frozen to allow the readout of the received message, current messages on the bus are missed.I would think that I could use the FIFO feature of the FlexCAN controller, but I don't know how to enable this feature based on the MQX FlexCAN driver. Can someone help?
Thank you - Frank
Unfortunately the MQX CAN driver doesn't support the advanced features of FlexCAN hardware module (like individual Rx MB filters, Rx FIFO). You will need to implement your own driver or modify the existing driver to employ Rx FIFO. I have a bare metal example somewhere , let me know if you wish to see some reference for your development.
Hi Martin,
thank you for your response! I already thought that the MQX CAN driver was implemented for different use cases. I would appreciate if you could send me the bare metal example, I would try to merge this into the CAN MQX driver.
Thank you!
Sincerely - Frank Dietrich
Date: Mon, 15 Jul 2013 23:27:02 -0700
From: admin@community.freescale.com
To: fkd65@hotmail.com
Subject: Re: MQX Software Solutions - MQX CAN driver problem ...
MQX CAN driver problem ...
created by Martin Latal in MQX Software Solutions - View the full discussion
Unfortunately the MQX CAN driver doesn't support the advanced features of FlexCAN hardware module (like individual Rx MB filters, Rx FIFO). You will need to implement your own driver or modify the existing driver to employ Rx FIFO. I have a bare metal example somewhere , let me know if you wish to see some reference for your development.
Reply to this message by replying to this email -or- go to the message on Freescale Community
Start a new discussion in MQX Software Solutions by email or at Freescale Community
Attached is the bare metal code. Note it is for different MCU (MPC5668x = PXN20) but the FlexCAN module on chip is almost the same as on K70. Interesting code is only in main.c functions InitFlexCAN_A, InitFlexCAN_B and main(). The code configures the FlexCAN modules, and after setup completes, it transmits messages from CAN_A to CAN_B RxFIFO, which is then read.
Hi Martin,
thank you for the example code!
Frank
A note on the code posed above. Since the Flexcan module in the Kinetis was directly copied from the MPC series (which is big endian) you have to make sure to account for that when you try to send or receive messages from the CAN bus (as in byte 0 on the bus is byte 3 in the Kinetis buffer)