MQX4.2: FlexCan, Bug in fsl_flexcan_hal.c when set MCR.MAXMB?

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

MQX4.2: FlexCan, Bug in fsl_flexcan_hal.c when set MCR.MAXMB?

Jump to solution
526 Views
arnogir
Senior Contributor II

Currently in fsl_flexcan_hal.c, flexcan_hal_init MAXMB field is set by:

// Set maximum number of message buffers 
flexcan_reg_ptr->MCR |= CAN_MCR_MAXMB((data->max_num_mb -1)); 

But initial value is not 0!! but 0x0F..
Then MCR must be clear before

Do following, are you ok with this problem or are tehy a thing that I not seen!?:smileysilly:

// Set maximum number of message buffers 
flexcan_reg_ptr->MCR &= ~CAN_MCR_MAXMB_MASK; 
flexcan_reg_ptr->MCR |= CAN_MCR_MAXMB((data->max_num_mb -1)); 
0 Kudos
1 Solution
338 Views
DavidS
NXP Employee
NXP Employee

Hi Arnaud,

I agree with your analysis and will submit this as an issue for MQX4.2.

Clearing and then setting the MAXMB field seems appropriate.

Regards,

David

View solution in original post

0 Kudos
1 Reply
339 Views
DavidS
NXP Employee
NXP Employee

Hi Arnaud,

I agree with your analysis and will submit this as an issue for MQX4.2.

Clearing and then setting the MAXMB field seems appropriate.

Regards,

David

0 Kudos