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

Level 3
Level 3

How can i configure a xmc1400 as can gateway with DAVE4?

FIrst i try to use two CAN_NODE app's,
configure each CAN-Node Message object's as TX object and send a frame, to test the physical connection.

That works on both CAN-Nodes 🙂

Than i configure:
CAN-Node1 Message-Object LMO_01 as RX object (Ext_29bit, Accept Std_Ext, Mask:0 to receive all frames)
CAN-Node0 Message-Object LMO_01 as TX object ( (Ext_29bit, Accept Std_Ext)

To activate the gateway function, i place in main.c after DAVE_Init() two API calls:

XMC_CAN_GATEWAY_InitSourceObject( CAN_NODE_1.lmobj_ptr[0] , can_gatewaySource);
XMC_CAN_GATEWAY_InitDesObject( CAN_NODE_0.lmobj_ptr[0] );

But the Gateway doesn't work.....

I try the gateway config with:

XMC_CAN_GATEWAY_CONFIG_t can_gatewaySource =
0, //bot
0, //top
0, //base
} ;

Also i try as bot,top,base: 1,1,1 / 19,19,19 / 17,17,17 without a working gateway.
What is missed?

The second try is to use the multican_config app.

In this
i configure LMO_0 to List2 (Node1) as RX and Gateway source object; Copy all to destination; Mask 0.....
i configure LMO_1 to List1 (Node0) as TX and Gateway destination object (MMC: Standard message object)

Because NO MANUAL PIN Allocator is available for the CAN-RX/TX-Pin's (is this a bug or feature?)
i change the PIN config in multican_config_conf.c to XMC_CAN_NODE_RECEIVE_INPUT_RXDCG for NODE0 and XMC_CAN_NODE_RECEIVE_INPUT_RXDCC for NODE1

and the gateway isn't working!
In this config, no acknowledge is possible on the RX-Node1.

So i try to configure the Port Pins manualy to Output after Dave_Init() :
XMC_GPIO_Init(XMC_GPIO_PORT1, 1,&config_out); // G
XMC_GPIO_Init(XMC_GPIO_PORT4, 9,&config_out); // C

but the Gateway isn't working....

What is wrong?
1 Reply
First solution authored First like received

you can add two DIGITAL_IO APPs. One you define as input one and you connect the pin to the rx_node_0 (I assume you set the gateway source to the NODE_0). Second DIGITAL_IO APP you define as a input/output and connect the output of the tx_node_1 to that pin. Also, take a look at the following picture for the proper gateway settings.


Additionally, I highlighted some fields that you should be aware....I set that gateway source has 0x444 as an identifier value. Of course you can change this value, but this would mean that you´re "triggering" message (M0 that is used to trigger gateway transmission should also be 0x444). If you want receive message that is transmitted by the gateway destination message object, then in this case you should set 0x777 as an identifier value for receive message object.

You can also notice that I´ve highlighted option "copy identifier". You can also pass the identifier trough gateway but then beware to use the same identifier at the receiving side as was used on the transmitting side.

If you done everything properly with the connection of two DIGITAL_IO APPs with the MULTICAN_CONFIG APP you should see something like this under "Report" view:

Let me know if you need additional support.