当前位置:网站首页>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
欢迎扫描二维码关注微信公众号, 及时获取最新文章:
边栏推荐
- 用于增强压缩视频质量的可变形卷积密集网络
- ES日志报错赏析-- allow delete
- LeetCode 648. Word replacement
- Mmkv use and principle
- In the field of software engineering, we have been doing scientific research for ten years!
- Oracle Linux 9.0 officially released
- FFmpeg----图片处理
- What is cloud primordial? This time, I can finally understand!
- 多商戶商城系統功能拆解01講-產品架構
- 一文读懂数仓中的pg_stat
猜你喜欢
小米的芯片自研之路
Five pain points for big companies to open source
JS get the current time, month, day, year, and the uniapp location applet opens the map to select the location
用于增强压缩视频质量的可变形卷积密集网络
STM32CubeMX,68套组件,遵循10条开源协议
Applet directory structure
CVPR2022 | 医学图像分析中基于频率注入的后门攻击
Because the employee set the password to "123456", amd stolen 450gb data?
Data connection mode in low code platform (Part 2)
Substance painter notes: settings for multi display and multi-resolution displays
随机推荐
Computer win7 system desktop icon is too large, how to turn it down
Pinduoduo lost the lawsuit, and the case of bargain price difference of 0.9% was sentenced; Wechat internal test, the same mobile phone number can register two account functions; 2022 fields Awards an
在软件工程领域,搞科研的这十年!
Es log error appreciation -- allow delete
OAuth 2.0 + JWT 保护API安全
CPU与chiplet技术杂谈
GAN发明者Ian Goodfellow正式加入DeepMind,任Research Scientist
激光雷达lidar知识点滴
安恒堡垒机如何启用Radius双因素/双因子(2FA)身份认证
Cocoscreator operates spine for animation fusion
Instructions for mictr01 tester vibrating string acquisition module development kit
内部排序——插入排序
Mrs offline data analysis: process OBS data through Flink job
Shengteng experience officer Episode 5 notes I
Notes de l'imprimante substance: paramètres pour les affichages Multi - écrans et multi - Résolutions
Decrypt the three dimensional design of the game
The method of parsing PHP to jump out of the loop and the difference between continue, break and exit
用于增强压缩视频质量的可变形卷积密集网络
Es log error appreciation -trying to create too many buckets
多商戶商城系統功能拆解01講-產品架構