当前位置:网站首页>Jetson AGX Orin CANFD 使用
Jetson AGX Orin CANFD 使用
2022-07-07 12:46:00 【weifengdq】
硬件连接
参考:
- Controller Area Network (CAN)
- Jetson AGX Orin Developer Kit User Guide - Hardware Layout | NVIDIA Developer
用到的引脚是:
- CAN0: RX(29), TX(31)
- CAN1: RX(37), TX(33)
- GND(39)
需要接 CANFD收发器 和 120Ω终端电阻 才能正常使用, 这里接收发器后连到CANFD分析仪
配置脚本
之前 Jetson Xavier 设置 CANFD (Jetpack 4.6, 开启pllaon)_weifengdq的博客-CSDN博客_canfd采样点设置 里面提到过, pllaon只影响到了Xavier和Xavier NX, 暂时对Orin没有影响. CAN引脚默认不是配置成CAN, 修改也有几种方法:
- 修改 cfg 文件
- 使用 jetson-io 配置
- 使用 busybox 配置
哪种方法都可以, 这里以最后一种为例, 把两路CANFD配置成 [email protected], [email protected]
#!/bin/sh
sudo busybox devmem 0x0c303000 32 0x0000C400
sudo busybox devmem 0x0c303008 32 0x0000C458
sudo busybox devmem 0x0c303010 32 0x0000C400
sudo busybox devmem 0x0c303018 32 0x0000C458
sudo modprobe can
sudo modprobe can_raw
sudo modprobe mttcan
sudo sh -c 'echo 0x600 > /sys/devices/platform/c310000.mttcan/net/can0/tdc_offset'
sudo sh -c 'echo 0x600 > /sys/devices/platform/c320000.mttcan/net/can1/tdc_offset'
sudo ip link set down can0
sudo ip link set can0 type can bitrate 500000 sample-point 0.8 dbitrate 5000000 dsample-point 0.8 berr-reporting on fd on restart-ms 100
sudo ip link set up can0 mtu 72
sudo ifconfig can0 txqueuelen 1000
# ip -s -d link show can0
sudo ip link set down can1
sudo ip link set can1 type can bitrate 500000 sample-point 0.8 dbitrate 5000000 dsample-point 0.8 berr-reporting on fd on restart-ms 100
sudo ip link set up can1 mtu 72
sudo ifconfig can1 txqueuelen 1000
# ip -s -d link show can1
注意上面 tdc_offset
的路径在不同Jetson里面不一定固定, 可以 busybox
和 modprobe
命令执行完后, 用 sudo find / -name tdc_offset
命令查找该路径. tdc_offset
在 2M 以上波特率时必须设置
配置完后 ifconfig
看一下, 然后检验一下
$ ip -s -d link show can0
8: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 72 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/can promiscuity 0 minmtu 0 maxmtu 0
can <BERR-REPORTING,FD> state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 100
bitrate 500000 sample-point 0.800
tq 20 prop-seg 39 phase-seg1 40 phase-seg2 20 sjw 1
mttcan: tseg1 2..255 tseg2 0..127 sjw 1..127 brp 1..511 brp-inc 1
dbitrate 5000000 dsample-point 0.800
dtq 20 dprop-seg 3 dphase-seg1 4 dphase-seg2 2 dsjw 1
mttcan: dtseg1 1..31 dtseg2 0..15 dsjw 1..15 dbrp 1..15 dbrp-inc 1
clock 50000000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 0 0 0 0 0 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
RX: bytes packets errors dropped overrun mcast
0 0 0 0 0 0
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0
收发测试
先来配置下 CANFD 分析仪
这里分析仪 5Mbps 采样点是 75%, 好在不影响使用:
- Orin发送标准帧
cansend can0 123#11.22.33.44.55.66.77.88
- Orin发送扩展帧
cansend can0 12345678#11.22.33.44.55.66.77.88
- Orin发送CANFD, 不开BRS和ESI
cansend can0 123##0.11.22.33.44.55.66.77.88
- Orin发送CANFD, 开BRS
cansend can0 123##1.11.22.33.44.55.66.77.88
- Orin发送CANFD, 开ESI
cansend can0 123##2.11.22.33.44.55.66.77.88
- Orin发送CANFD, 开BRS和ESI
cansend can0 123##3.11.22.33.44.55.66.77.88
- CANFD分析仪发送64字节到Orin
欢迎扫描二维码关注微信公众号, 及时获取最新文章:
边栏推荐
- Xiaomi's path of chip self-development
- Use case diagram
- 半小时『直播连麦搭建』动手实战,大学生技术岗位简历加分项get!
- 设备故障预测机床故障提前预警机械设备振动监测机床故障预警CNC震动无线监控设备异常提前预警
- Ian Goodfellow, the inventor of Gan, officially joined deepmind as research scientist
- ES日志报错赏析-trying to create too many buckets
- word中删除一整页
- 云上“视界” 创新无限 | 2022阿里云直播峰会正式上线
- 华为云数据库DDS产品深度赋能
- 全球首款 RISC-V 笔记本电脑开启预售,专为元宇宙而生!
猜你喜欢
Notes de l'imprimante substance: paramètres pour les affichages Multi - écrans et multi - Résolutions
GAN发明者Ian Goodfellow正式加入DeepMind,任Research Scientist
Navigation — 这么好用的导航框架你确定不来看看?
2022年13个UX/UI/UE最佳创意灵感网站
设备故障预测机床故障提前预警机械设备振动监测机床故障预警CNC震动无线监控设备异常提前预警
Simple use of websocket
2022pagc Golden Sail award | rongyun won the "outstanding product technology service provider of the year"
Data connection mode in low code platform (Part 2)
Equipment failure prediction machine failure early warning mechanical equipment vibration monitoring machine failure early warning CNC vibration wireless monitoring equipment abnormal early warning
全球首款 RISC-V 笔记本电脑开启预售,专为元宇宙而生!
随机推荐
华为云数据库DDS产品深度赋能
半小时『直播连麦搭建』动手实战,大学生技术岗位简历加分项get!
什么是云原生?这回终于能搞明白了!
Summary on adding content of background dynamic template builder usage
Es log error appreciation -maximum shards open
Demis hassabis talks about alphafold's future goals
低代码平台中的数据连接方式(下)
设备故障预测机床故障提前预警机械设备振动监测机床故障预警CNC震动无线监控设备异常提前预警
Analysis of arouter
⼀个对象从加载到JVM,再到被GC清除,都经历了什么过程?
Data Lake (IX): Iceberg features and data types
EMQX 5.0 发布:单集群支持 1 亿 MQTT 连接的开源物联网消息服务器
PyTorch模型训练实战技巧,突破速度瓶颈
[today in history] July 7: release of C; Chrome OS came out; "Legend of swordsman" issued
JS get the current time, month, day, year, and the uniapp location applet opens the map to select the location
Internal sort - insert sort
Notes de l'imprimante substance: paramètres pour les affichages Multi - écrans et multi - Résolutions
昇腾体验官第五期随手记I
2022云顾问技术系列之高可用专场分享会
"July 2022" Wukong editor update record