S32K344 EVB With MCAL FLEXCAN TJA1153

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

S32K344 EVB With MCAL FLEXCAN TJA1153

跳至解决方案
5,080 次查看
JAY_SUN1
Contributor II

Hi NXP team,

I configured CAN0 of S32K344 EVB with NXP MCAL, but it would be stuck in the function FlexCAN_Ip_SendBlocking. I already read below link and set baudrate and UntouchPin accordingly.  Please check my project as attaced and help us to solve the problem. Thanks a lot.

https://community.nxp.com/t5/S32K/S32K344-EVB-With-EB-AUTOSAR/td-p/1349402

Wade

 

0 项奖励
回复
1 解答
5,049 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

do not know MCAL driver much, but below one is working for me

PetrS_0-1666356064542.png

MB0 is configured to receive any std ID by init, so upper code sends a message once std ID message is received. You can read message content within CanIf_RxIndication, I think.

Moreover modify My_Tja1153_Init to use CanHardwareObject_1 for Send functions.

BR, Petr

在原帖中查看解决方案

0 项奖励
回复
6 回复数
5,064 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

I modified your while loop little bit and it is sending a CAN message when connecting to CAN tool.

while (1)
{
//Can_Write(CanHardwareObject_0, &Can_PduInfo);
//delay(100000U);
    u8TimeOut = 100U;
    if((Can_Write(CanHardwareObject_1, &Can_PduInfo) == E_OK))
       while((!CanIf_bTxFlag) && (u8TimeOut != 0U))
       {
          Can_MainFunction_Write();
          Can_DummyDelay(100U);
          u8TimeOut--;
       }
    CanIf_bTxFlag = 0;
    Can_au8Sdu8bytes[0]++;
    delay(5000000U);

}

Note that if transceiver is in Vanilla state a configuration should be done after device power up.
Try to load code and do power off/on.

BR, Petr

0 项奖励
回复
5,057 次查看
JAY_SUN1
Contributor II

Hi Petrs,

Thanks for your prompty reply.

It can send the message, but please teach me how to set receiver in my code. Thanks.

Wade

0 项奖励
回复
5,050 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

do not know MCAL driver much, but below one is working for me

PetrS_0-1666356064542.png

MB0 is configured to receive any std ID by init, so upper code sends a message once std ID message is received. You can read message content within CanIf_RxIndication, I think.

Moreover modify My_Tja1153_Init to use CanHardwareObject_1 for Send functions.

BR, Petr

0 项奖励
回复
5,003 次查看
JAY_SUN1
Contributor II

Hi Petr,

It can receive message now, but when I add another instance (FlexCAN_4), it will show error (There must not be HTH with Object ID lower than that of any HRH configured!) as attached picture, please help to check it and let us know how to add another instance . I also attached my project for you ref. Thanks.

Wade

0 项奖励
回复
4,992 次查看
JAY_SUN1
Contributor II

Hi Petr,

I update my project as attached since I set incorrect pin in original project. But it still show error "There must not be HTH with Object ID lower than that of any HRH configured!". 

Besides, I have tried to set FlexCAN4 single, it can work normally. But when I set FlexCAN1 & FlexCAN4 at the same time, it can't work. I think the main issue is how to add another FlexCAN instance in the MCAL. Please help us to check it. Thanks.

0 项奖励
回复
4,989 次查看
JAY_SUN1
Contributor II

Hi Petr,

I find the root cause, HTH ID number should be higher than HRH ID number . This topic can close. Thanks.

0 项奖励
回复