Aurix CAN setup in cpp file

Hi,

I was able to set up the socket cans(can0/can1) in cpp file like below for drive xavier, and made them working. But I do not know how to set up the aurix can in cpp file. Can anyone give me an example?

My setup for the socket can in cpp file:

#define command “sudo ip link set can1 type can bitrate 500000”
#define up “sudo ifconfig can1 up”
#define up “sudo ifconfig can1 down”

{

system(down);
system(command);
system(up);

params.protocol = “can.socket”;
params.parameters = “device=can1”;

}

Hi Phil.Chen,

Please try with https://docs.nvidia.com/driveworks/dwx_canbus_logger_sample.html and refer to its source code under /usr/local/driveworks/samples/src/sensors/canbus/logger. Thanks!

Thank you VickNV!

After I went through the files you provided, I am able to send can msg via aurix can now. However, I am not able to receive msg via aurix can. Would you please give some hint? Many thanks!

here is my setup for aurix can
params.control = “can.aurix”;
params.parameters = “ip=10.42.0.146,bport=50000,bus=a”;

Please run with config-file=/usr/local/driveworks/data/samples/sensors/can/EasyCanConfigFile.conf and refer to Drive_AGX_EB_AURIX_Software_UserGuide.pdf in ~/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-foundation/utils/scripts/DRIVE-V5.1.6-E3550-EB-Aurix.zip for the configuration.

Thank you VickNV! It works!