Announcements

Equip yourself to optimize AURIX™ MCUs for Evs at the EV Webinar. Click here to register.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

AURIX™ Forum Discussions

User22029
Level 1
Level 1
First solution authored First reply posted First question asked
Hello Support,

I'm using TriBoard TC397 V2.0 and MC-ISAR_AS422_TC3xx_BASIC_1.40.0
Follow the demo code for MCMCAN module, I write the code blew.

initial(){
const Port_ConfigType * ConfigPtr = NULL_PTR;
ConfigPtr = &Port_Config;
Port_Init(ConfigPtr);
IrqCan_Init();
Can_17_McmCan_Init(&Can_17_McmCan_Config);
Can_17_McmCan_SetControllerMode (Can_17_McmCanConf_CanController_CanController_0, CAN_T_START);
Can_17_McmCan_SetControllerMode (Can_17_McmCanConf_CanController_CanController_1, CAN_T_START);
}

main()
{
initial();
while(1){

Can_17_McmCan_Write(2, &PduInfo_1[0]) ;
/* Delay */
Counter = 0x5FFFF;
while(Counter--)
{}
}
}

Here is my EB tresos config
5184.attach

Initial OK, but when run after Can_17_McmCan_Write -> Can_17_McmCan_lWriteMsgObj
code line 5840

NodeRegAddressPtr->TX.BAR.U = (Ifx_UReg_32Bit)BuffIndex;

It will occur bus off error, and then into bus off ISR
5185.attach
5186.attach
5187.attach
I cannot see any message in busmaster
And in next while loop it will always stuck at bus off.

It should be no problem after Can_write function execute,right?
Please give me some suggestion to solve this problem, thank you.

Best regards
0 Likes
0 Replies