S32K344 EVB With MCAL FLEXCAN TJA1153

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

S32K344 EVB With MCAL FLEXCAN TJA1153

Jump to solution
5,376 Views
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 Kudos
Reply
1 Solution
5,345 Views
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

View solution in original post

0 Kudos
Reply
6 Replies
5,360 Views
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 Kudos
Reply
5,353 Views
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 Kudos
Reply
5,346 Views
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 Kudos
Reply
5,299 Views
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 Kudos
Reply
5,288 Views
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 Kudos
Reply
5,285 Views
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 Kudos
Reply