Hello,
we built up a gateway with an XMC 4400 between Can Node 0 and 1.
Gateway is in both directions, all messages from Node 0 to Node 1 and from Node 1 to Node 0.
Therefor we have on RX MO on Node 0 and a TX FiFo with 30 MOs on Node 1.
Same the other way round.
Our Code:
Node 1 Rx MO:
/* Message 33 Configuration - Receive */
XMC_CAN_MO_Config(&message33_rx_n1);
XMC_CAN_GATEWAY_InitSourceObject(&message33_rx_n1,
( (XMC_CAN_GATEWAY_CONFIG_t) {
2,
31,
2,
true,
true,
true,
true
}));
Node 0 Transmit fifo
/*Message 2 Transmit*/
/*Base Objects*/
XMC_CAN_MO_Config(&message2_31_tx_gw_n0);
XMC_CAN_TXFIFO_ConfigMOBaseObject(&message2_31_tx_ gw_n0,((XMC_CAN_FIFO_CONFIG_t){2,31,2}));
XMC_CAN_GATEWAY_InitDesObject(&message2_31_tx_gw_n 0);
/*Slave Objects*/
for ( i = 3; i <= 31; i++ ) {
message2_31_tx_gw_n0.can_mo_ptr += ( CAN_MO3 - CAN_MO2);
XMC_CAN_MO_Config(&message2_31_tx_gw_n0);
XMC_CAN_TXFIFO_ConfigMOSlaveObject(&message2_31_tx _gw_n0,((XMC_CAN_FIFO_CONFIG_t){2,31,2}));
XMC_CAN_GATEWAY_InitDesObject(&message2_31_tx_gw_n 0);
}
Gateway is working fine, if both can busses are okay.
BUT if we have a temorary disconnection on on bus, the Gatewas/FiFo is struggeling,
means messages are no more forwarded any more at once, but at different times.
Example:
On Node 0 we have periodig can message which are gatewayed to node 1.
Everything works.
Now we disconnect the Can bus on node 1, can bus on node 0 is still working.
After a while we reconnect can node 1 bus.
The effect is now, that some forwarded messages are not forwarded directly,
but later up to 2 seconds.
That does mean that the ordering of the messages is different on Node 1 than on Node 0.
This is terrible for our application.
We tried to reset the messagecounters for the Fifo, TX request flags, and any other
flag without any final result.
Does anyone have an Idea what to do ?
Regards
we built up a gateway with an XMC 4400 between Can Node 0 and 1.
Gateway is in both directions, all messages from Node 0 to Node 1 and from Node 1 to Node 0.
Therefor we have on RX MO on Node 0 and a TX FiFo with 30 MOs on Node 1.
Same the other way round.
Our Code:
Node 1 Rx MO:
/* Message 33 Configuration - Receive */
XMC_CAN_MO_Config(&message33_rx_n1);
XMC_CAN_GATEWAY_InitSourceObject(&message33_rx_n1,
( (XMC_CAN_GATEWAY_CONFIG_t) {
2,
31,
2,
true,
true,
true,
true
}));
Node 0 Transmit fifo
/*Message 2 Transmit*/
/*Base Objects*/
XMC_CAN_MO_Config(&message2_31_tx_gw_n0);
XMC_CAN_TXFIFO_ConfigMOBaseObject(&message2_31_tx_ gw_n0,((XMC_CAN_FIFO_CONFIG_t){2,31,2}));
XMC_CAN_GATEWAY_InitDesObject(&message2_31_tx_gw_n 0);
/*Slave Objects*/
for ( i = 3; i <= 31; i++ ) {
message2_31_tx_gw_n0.can_mo_ptr += ( CAN_MO3 - CAN_MO2);
XMC_CAN_MO_Config(&message2_31_tx_gw_n0);
XMC_CAN_TXFIFO_ConfigMOSlaveObject(&message2_31_tx _gw_n0,((XMC_CAN_FIFO_CONFIG_t){2,31,2}));
XMC_CAN_GATEWAY_InitDesObject(&message2_31_tx_gw_n 0);
}
Gateway is working fine, if both can busses are okay.
BUT if we have a temorary disconnection on on bus, the Gatewas/FiFo is struggeling,
means messages are no more forwarded any more at once, but at different times.
Example:
On Node 0 we have periodig can message which are gatewayed to node 1.
Everything works.
Now we disconnect the Can bus on node 1, can bus on node 0 is still working.
After a while we reconnect can node 1 bus.
The effect is now, that some forwarded messages are not forwarded directly,
but later up to 2 seconds.
That does mean that the ordering of the messages is different on Node 1 than on Node 0.
This is terrible for our application.
We tried to reset the messagecounters for the Fifo, TX request flags, and any other
flag without any final result.
Does anyone have an Idea what to do ?
Regards