当前位置:网站首页>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
欢迎扫描二维码关注微信公众号, 及时获取最新文章:
边栏推荐
- PD virtual machine tutorial: how to set the available shortcut keys in the parallelsdesktop virtual machine?
- 属性关键字OnDelete,Private,ReadOnly,Required
- Es log error appreciation -maximum shards open
- 2022pagc Golden Sail award | rongyun won the "outstanding product technology service provider of the year"
- 寺岗电子称修改IP简易步骤
- Data Lake (IX): Iceberg features and data types
- 全球首款 RISC-V 笔记本电脑开启预售,专为元宇宙而生!
- 因员工将密码设为“123456”,AMD 被盗 450Gb 数据?
- Es log error appreciation -trying to create too many buckets
- Leetcode - Sword finger offer 05 Replace spaces
猜你喜欢
GAN发明者Ian Goodfellow正式加入DeepMind,任Research Scientist
Equipment failure prediction machine failure early warning mechanical equipment vibration monitoring machine failure early warning CNC vibration wireless monitoring equipment abnormal early warning
【愚公系列】2022年7月 Go教学课程 005-变量
Multi merchant mall system function disassembly lecture 01 - Product Architecture
多商戶商城系統功能拆解01講-產品架構
leetcode:648. Word replacement [dictionary tree board + find the shortest matching prefix among several prefixes]
Instructions for mictr01 tester vibrating string acquisition module development kit
leetcode:648. 单词替换【字典树板子 + 寻找若干前缀中的最短符合前缀】
内部排序——插入排序
Infinite innovation in cloud "vision" | the 2022 Alibaba cloud live summit was officially launched
随机推荐
Pytorch model trains practical skills and breaks through the bottleneck of speed
拼多多败诉,砍价始终差0.9%一案宣判;微信内测同一手机号可注册两个账号功能;2022年度菲尔兹奖公布|极客头条...
Beginner JSP
Demis hassabis talks about alphafold's future goals
Ian Goodfellow, the inventor of Gan, officially joined deepmind as research scientist
Navigation - are you sure you want to take a look at such an easy-to-use navigation framework?
Summary on adding content of background dynamic template builder usage
#yyds干货盘点# 解决名企真题:交叉线
云上“视界” 创新无限 | 2022阿里云直播峰会正式上线
一个程序员的水平能差到什么程度?尼玛,都是人才呀...
Webrtc audio anti weak network technology (Part 1)
Equipment failure prediction machine failure early warning mechanical equipment vibration monitoring machine failure early warning CNC vibration wireless monitoring equipment abnormal early warning
智汀不用Home Assistant让小米智能家居接入HomeKit
Analysis of arouter
Cocoscreator operates spine for animation fusion
Use case diagram
Half an hour of hands-on practice of "live broadcast Lianmai construction", college students' resume of technical posts plus points get!
[Yugong series] go teaching course 005 variables in July 2022
2022云顾问技术系列之高可用专场分享会
一款你不容错过的Laravel后台管理扩展包 —— Voyager