Flex can Timeout or Busy

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

Flex can Timeout or Busy

Jump to solution
577 Views
chenyh
Contributor II

S32k312

70422bce792321e75f060369f53420b.png63660bc9b955817c510d66e98a5de59.png2fb2ad1a92e73992b1e5d9d0a34f5a7.png8541d7eff4ab29e6dae5d10d83c2ec5.png

This is my code.时间是100MS循环发送,为什么发送一会会出现FLEXCAN_STATUS_TIMEOUT or FLEXCAN_STATUS_BUSY 是哪里有问题,还是我这样发送不正确。

0 Kudos
Reply
1 Solution
546 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

those statuses may indicate previously used MB for transmission does not have successfully message transmitted. You can check ECR,ESR1 registers to know if any error is detected.
Also it would be better to do not use FIRC as CAN protocol clock, used rather FXOSC or PLL running from XOSC.

Also it could be due to a way you are using MBs. You defined 16 MBs to be used in you FlexCAN config. Then 11 are configured for reception, not sure which one. For transmitting you are testing status of first 32 MBs (MBs 0-31). This does not make much sense. Test just remaining MBs from those 16 MBs enabled, or better only those used for transmission.
You can also try to extend timeout value in blocking function.

BR, Petr

View solution in original post

0 Kudos
Reply
2 Replies
547 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

those statuses may indicate previously used MB for transmission does not have successfully message transmitted. You can check ECR,ESR1 registers to know if any error is detected.
Also it would be better to do not use FIRC as CAN protocol clock, used rather FXOSC or PLL running from XOSC.

Also it could be due to a way you are using MBs. You defined 16 MBs to be used in you FlexCAN config. Then 11 are configured for reception, not sure which one. For transmitting you are testing status of first 32 MBs (MBs 0-31). This does not make much sense. Test just remaining MBs from those 16 MBs enabled, or better only those used for transmission.
You can also try to extend timeout value in blocking function.

BR, Petr

0 Kudos
Reply
520 Views
chenyh
Contributor II
OK,Thinks,I solved this problem
0 Kudos
Reply