https://blog.csdn.net/qq_41426807/article/details/124669265

http://www.arm-cn.com/thread-1190-1-1.html

https://blog.csdn.net/weixin_40603219/article/details/123589075

https://blog.csdn.net/weifengdq/article/details/124382475?spm=1001.2101.3001.6650.4&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-4-124382475-blog-123589075.pc_relevant_downloadblacklistv1&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-4-124382475-blog-123589075.pc_relevant_downloadblacklistv1&utm_relevant_index=8

 dtc编译命令:https://blog.csdn.net/oqqGuMu/article/details/91346377#:~:text=dtc%E7%BC%96%E8%AF%91%E5%99%A8%E5%8F%AF%E4%BB%A5%E6%8A%8Adts%E6%96%87%E4%BB%B6%E7%BC%96%E8%AF%91%E6%88%90%E4%B8%BAdtb%EF%BC%8C%E4%B9%9F%E5%8F%AF%E6%8A%8Adtb%E7%BC%96%E8%AF%91%E6%88%90%E4%B8%BAdts%E6%96%87%E4%BB%B6%EF%BC%8C%E7%BC%96%E8%AF%91%E5%91%BD%E4%BB%A4%E6%A0%BC%E5%BC%8F%E5%A6%82%E4%B8%8B%EF%BC%9A%20dtc%20%5B-I%20input-format%5D%20%5B-O,output-format%5D%20%5B-o%20output-filename%5D%20%5B-V%20output_version%5D%20input_filename

官方文档:https://docs.nvidia.com/jetson/archives/r34.1/DeveloperGuide/text/SD/Clocks.html

推测之前修改不成功可能是因为版本对应文件不正确,后面同时修改了tegra194-p2888-0001-p2822-0000.dtb和tegra194-p2888-0004-e3900-0000.dtb

查看时钟类型:

sudo cat /sys/kernel/debug/bpmp/debug/clk/can1/parent
cat /proc/device-tree/mttcan@310000/pll-source

can配置:

# can_enable.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

#设置can口
sudo ip link set can0 type can bitrate 500000 dbitrate 2000000 berr-reporting on fd on restart-ms 100
sudo ip link set can1 type can bitrate 500000 dbitrate 2000000 berr-reporting on fd on restart-ms 100

#开启can口
sudo ip link set up can0
sudo ip link set up can1

查看波特率是否设置准确:

sudo ip -d -s link show can0

 

posted on 2022-06-09 09:37  Manuel  阅读(339)  评论(0编辑  收藏  举报