i.mx Flexcan message buffers > 16 usable?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.mx Flexcan message buffers > 16 usable?

Jump to solution
1,101 Views
slay
Contributor III

Hi Everyone,

Based on the Linux Flexcan driver, I try to use more message buffers for transmitting and receiving some frames with specific ID's. This seems to be OK as long as I don't try to use message buffers 16 and further. If I configure for instance MB[9] to MB[12] for receiving a range of ID's, this works just fine. If I copy the same configuration to MB[16] - MB[19], no frame is rcved (the iflag1 bit of these MB's never gets set). Also, if I just change the FLEXCAN_TX_BUF_ID of the standard Flexcan driver from 8 to 16, transmitting frames no longer succeeds.

I did find a paragraph in the user manual about the "Arbitration and Matching Timing", regarding the number of message buffers that can be used depending on the ratio between Peripheral Clock Frequency and CAN Bit Rate. But this should not be the problem in the configuration I use here:

oscillator frequency = 24 MHz

Prescaler = 3 => Bitclock = 8 MHz

Bitrate = 500 Kbit => 1 bit = 16 Tq

So it should be possible to use all 64 Message buffers, I would think. Does anyone know what I am missing here? Did anyone succeed in using these higher message buffers on this processor?

Regards,

Ruud

Labels (1)
Tags (1)
0 Kudos
1 Solution
857 Views
slay
Contributor III

Solved! By looking at the driver code of the Freescale maintained BSP, I noticed the  'maxmb' part of the MCR. This part is not set for the mainline driver and will therefore have the default value 0x0F, meaning that only MB's 0-15 will be used for receive and transmit purposes. This explains why I could not use MB's 16 - 63. By changing this to a higher value, the other message buffers can also be used. I have set it to 0x1F now, to use up to 32 message buffers.

Ruud

View solution in original post

0 Kudos
1 Reply
858 Views
slay
Contributor III

Solved! By looking at the driver code of the Freescale maintained BSP, I noticed the  'maxmb' part of the MCR. This part is not set for the mainline driver and will therefore have the default value 0x0F, meaning that only MB's 0-15 will be used for receive and transmit purposes. This explains why I could not use MB's 16 - 63. By changing this to a higher value, the other message buffers can also be used. I have set it to 0x1F now, to use up to 32 message buffers.

Ruud

0 Kudos