CAN MCAL

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
961件の閲覧回数
MridulBajaj
Contributor I

 

Hi,

I am trying to implement CAN communication using the AUTOSAR MCAL layer on the S32K144 MCU. I am able to transmit data successfully, but I am not able to receive any data.

I am using the polling method (not interrupts), and currently calling the following API periodically:

Can_MainFunction_Read();
 
  • Is this API sufficient for receiving CAN messages in polling mode?

  • Do I need to use any other API along with it to receive messages properly?

  • Could you please share an example or reference code to implement CAN reception using AUTOSAR MCAL (polling mode) on S32K144?

0 件の賞賛
返信
1 解決策
882件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

you can check within debugger if message is really received. Inspect used MB area, MB flag.
Also be sure no error is detected during reception, otherwise message is not moved-in and no MB flag will be set, check ECR/ESR1 registers.

BR, Petr

元の投稿で解決策を見る

0 件の賞賛
返信
4 返答(返信)
919件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

yes, it is enough to call MainFunction_Read periodically. Upon reception you should get CanIf_RxIndication callback.
Refer e.g to RTD200 demo example, which is using polling mode for both TX and RX.

BR, Petr

0 件の賞賛
返信
903件の閲覧回数
MridulBajaj
Contributor I
When I try to debug my code, it’s not entering the Rx callback function. It gets stuck in the Can_Ipw_MainFunction_Read() function, where the Message Buffer (MB) state is not IDLE.
How can I resolve this issue?
0 件の賞賛
返信
883件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

you can check within debugger if message is really received. Inspect used MB area, MB flag.
Also be sure no error is detected during reception, otherwise message is not moved-in and no MB flag will be set, check ECR/ESR1 registers.

BR, Petr

0 件の賞賛
返信
849件の閲覧回数
MridulBajaj
Contributor I
Thank you. I have figured out the solution.
0 件の賞賛
返信