# Aurix CAN setup in cpp file

**URL:** <https://forums.developer.nvidia.com/t/aurix-can-setup-in-cpp-file/111369>\
**Category:** DRIVE AGX Xavier General\
**Created:** [February 3, 2020, 3:43pm UTC](https://forums.developer.nvidia.com/t/aurix-can-setup-in-cpp-file/111369 "2020-02-03T15:43:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phil.Chen](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Phil.Chen](https://forums.developer.nvidia.com/u/Phil.Chen)\
**Post date:** [February 3, 2020, 3:43pm UTC](https://forums.developer.nvidia.com/t/aurix-can-setup-in-cpp-file/111369/1 "2020-02-03T15:43:25Z")

</div>

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”;  
…  
}

---

<div class="post-metadata">

**Author:** ![VickNV](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/vicknv/32/14043_2.png) [@VickNV](https://forums.developer.nvidia.com/u/VickNV)\
**Post date:** [February 3, 2020, 4:02pm UTC](https://forums.developer.nvidia.com/t/aurix-can-setup-in-cpp-file/111369/2 "2020-02-03T16:02:17Z")

</div>

Hi Phil.Chen,

Please try with [https://docs.nvidia.com/driveworks/dwx\_canbus\_logger\_sample.html](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!

---

<div class="post-metadata">

**Author:** ![Phil.Chen](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Phil.Chen](https://forums.developer.nvidia.com/u/Phil.Chen)\
**Post date:** [February 3, 2020, 7:01pm UTC](https://forums.developer.nvidia.com/t/aurix-can-setup-in-cpp-file/111369/3 "2020-02-03T19:01:47Z")

</div>

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”;

---

<div class="post-metadata">

**Author:** ![VickNV](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/vicknv/32/14043_2.png) [@VickNV](https://forums.developer.nvidia.com/u/VickNV)\
**Post date:** [February 3, 2020, 7:59pm UTC](https://forums.developer.nvidia.com/t/aurix-can-setup-in-cpp-file/111369/4 "2020-02-03T19:59:55Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Phil.Chen](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Phil.Chen](https://forums.developer.nvidia.com/u/Phil.Chen)\
**Post date:** [February 3, 2020, 8:10pm UTC](https://forums.developer.nvidia.com/t/aurix-can-setup-in-cpp-file/111369/5 "2020-02-03T20:10:08Z")

</div>

Thank you VickNV! It works!

---

<div class="post-metadata">

**Author:** ![TomNVIDIA](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/tomnvidia/32/14181_2.png) [@TomNVIDIA](https://forums.developer.nvidia.com/u/TomNVIDIA)\
**Post date:** [October 12, 2021, 8:04pm UTC](https://forums.developer.nvidia.com/t/aurix-can-setup-in-cpp-file/111369/6 "2021-10-12T20:04:54Z")

</div>

Closed on October 12, 2021, 8:04pm UTC


