当前位置:网站首页>How to convert Quanzhi a40i/t3 to can through SPI
How to convert Quanzhi a40i/t3 to can through SPI
2022-07-03 00:52:00 【ningmengzier】
Full ambition A40i perhaps T3 Of CPU No middle CAN controller , But in the actual use process , use CAN, Usually SPI turn CAN The way .
This paper is based on Feiling embedded OKA40i-C Operate on the development board , Other brand development boards can be referred to as appropriate .
stay OKA40i-C On the base plate , All the way SPI, But because of the voltage and mcp2515 The voltage of does not match , Therefore, the serial port will be used 2 This group of multiplexes is SPI external mcp2515 modular .
according to CPU Chapter 3 of the manual describes , Can be PI17-19 Reuse as SPI1, use PH08 As an interruption .
A40i/T3 use sys_config.fex perhaps dts Configure pin multiplexing function , Let's use dts To configure .
01- open SPI1
modify sys_config.fex, take uart2 Configuration removed , open SPI1 Configuration of .
At the same time PH08 Comment out :
At the same time, modify the device tree :
02- modify defconfig
It is verified by other platforms , And adapt to the driver of the device tree mcp251x.c,
modify defconfig The configuration file :
Networking support ---> CAN bus subsystem support --->CAN Device Drivers --->Microchip MCP251x SPI CAN controllers Choose .
At the same time, select SPI To configure , Supported by default , Not here .
03- To configure iproute
file system :
buildroot-201611/configs/sun8iw11p1_hf_defconfig
It needs to be configured BR2_PACKAGE_IPROUTE2=y.
recompile , And package the image , burn .
04- test can0 node
After starting ,ifconfig Check to see if can0 node . Use the following command to test :
ifconfig can0 down ip link set can0 up type can bitrate 125000 triple-sampling on ifconfig can0 up cansend can0 123#12345678 candump can0
If necessary, please contact Feiling technical service personnel , Provide patch file .
matters needing attention
In the device tree , When used as an interrupt , because A40i/T3 Only use PH The pins of the group are multiplexed into interrupts , When setting an interrupt in the device tree, the following :
interrupt-parent = <&pio>; interrupts = <8 0>;
in addition , Pay attention to the interrupt trigger mode in the driver .
边栏推荐
- Gan model architecture in mm
- [shutter] image component (load network pictures | load static pictures | load local pictures | path | provider plug-in)
- 【AutoSAR 七 工具链简介】
- 【AutoSAR 十二 模式管理】
- In the first half of 2022, there are 10 worth seeing, and each sentence can bring you strength!
- Vulkan is not a "panacea"“
- 【AutoSAR 二 AppL概述】
- 数组与集合性能比较
- Extension of flutter
- File operation io-part2
猜你喜欢
Sentry developer contribution Guide - configure pycharm
Rust string slicing, structs, and enumeration classes
飞凌搭载TI AM62x的ARM核心板/开发板首发上市,亮相Embedded World 2022
AttributeError: ‘tuple‘ object has no attribute ‘layer‘问题解决
Automated defect analysis in electronic microscopic images
图解网络:什么是虚拟路由器冗余协议 VRRP?
基于ARM RK3568的红外热成像体温检测系统
File operation io-part2
[IELTS reading] Wang Xiwei reading P1 (reading judgment question)
In the first half of 2022, there are 10 worth seeing, and each sentence can bring you strength!
随机推荐
图解网络:什么是虚拟路由器冗余协议 VRRP?
[AUTOSAR five methodology]
leetcode-2280:表示一个折线图的最少线段数
Leetcode 294. Flip game II (game theory)
[IELTS reading] Wang Xiwei reading P1 (reading judgment question)
[golang syntax] map common errors golang panic: assignment to entry in nil map
antv x6节点拖拽到画布上后的回调事件(踩大坑记录)
指针初阶(基础)
Array and collection performance comparison
【AutoSAR 十二 模式管理】
Some introduction and precautions about XML
Overlay of shutter (Pop-Up)
Vulkan并非“灵药“
[AUTOSAR VI description document]
Unity learns from spaceshooter to record the difference between fixedupdate and update in unity for the second time
Why is the website slow to open?
Leetcode-934: the shortest Bridge
leetcode-849:到最近的人的最大距离
Shell implements basic file operations (SED edit, awk match)
Shell 实现文件基本操作(sed-编辑、awk-匹配)