当前位置:网站首页>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

欢迎扫描二维码关注微信公众号, 及时获取最新文章:
边栏推荐
- 激光雷达lidar知识点滴
- 全球首款 RISC-V 笔记本电脑开启预售,专为元宇宙而生!
- electron remote 报错
- LeetCode 648. 单词替换
- Leetcode——236. The nearest common ancestor of binary tree
- "July 2022" Wukong editor update record
- Cvpr2022 | backdoor attack based on frequency injection in medical image analysis
- PD virtual machine tutorial: how to set the available shortcut keys in the parallelsdesktop virtual machine?
- asp.netNBA信息管理系统VS开发sqlserver数据库web结构c#编程计算机网页源码项目详细设计
- PAG experience: complete AE dynamic deployment and launch all platforms in ten minutes!
猜你喜欢

OAuth 2.0 + JWT protect API security

设备故障预测机床故障提前预警机械设备振动监测机床故障预警CNC震动无线监控设备异常提前预警

今日睡眠质量记录78分

Cocoscreator operates spine for animation fusion

Mrs offline data analysis: process OBS data through Flink job

电脑Win7系统桌面图标太大怎么调小

Data connection mode in low code platform (Part 2)

华为云数据库DDS产品深度赋能

Simple use of websocket

防火墙基础之服务器区的防护策略
随机推荐
Mmkv use and principle
Oracle Linux 9.0 officially released
[today in history] July 7: release of C; Chrome OS came out; "Legend of swordsman" issued
内部排序——插入排序
[Yugong series] go teaching course 005 variables in July 2022
leetcode:648. 单词替换【字典树板子 + 寻找若干前缀中的最短符合前缀】
智汀不用Home Assistant让小米智能家居接入HomeKit
Equipment failure prediction machine failure early warning mechanical equipment vibration monitoring machine failure early warning CNC vibration wireless monitoring equipment abnormal early warning
OAuth 2.0 + JWT 保护API安全
Substance painter notes: settings for multi display and multi-resolution displays
Instructions d'utilisation de la trousse de développement du module d'acquisition d'accord du testeur mictr01
Because the employee set the password to "123456", amd stolen 450gb data?
安恒堡垒机如何启用Radius双因素/双因子(2FA)身份认证
Navigation — 这么好用的导航框架你确定不来看看?
LeetCode每日一题(636. Exclusive Time of Functions)
Pytorch model trains practical skills and breaks through the bottleneck of speed
ES日志报错赏析-- allow delete
EfficientNet模型的完整细节
2022云顾问技术系列之高可用专场分享会
asp.netNBA信息管理系统VS开发sqlserver数据库web结构c#编程计算机网页源码项目详细设计