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
Solved! Go to Solution.
Hi,
do not know MCAL driver much, but below one is working for me
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
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
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
Hi,
do not know MCAL driver much, but below one is working for me
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
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
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.
Hi Petr,
I find the root cause, HTH ID number should be higher than HRH ID number . This topic can close. Thanks.