当前位置:网站首页>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 .
边栏推荐
- 腾讯云免费SSL证书扩展文件含义
- Helm basic learning
- [shutter] image component (the placeholder | transparent_image transparent image plug-in is loaded into the memory)
- [applet project development -- JD mall] user defined search component of uni app (middle) -- search suggestions
- Leetcode-2115: find all the dishes that can be made from the given raw materials
- [jetcache] jetcache configuration description and annotation attribute description
- 【小程序项目开发-- 京东商城】uni-app之自定义搜索组件(中)-- 搜索建议
- [Luogu p4320] road meets (round square tree)
- Initial order of pointer (basic)
- 【AutoSAR 一 概述】
猜你喜欢

Leetcode-849: maximum distance to the nearest person

Win10 多种方式解决无法安装.Net3.5的问题

The "2022 China Digital Office Market Research Report" can be downloaded to explain the 176.8 billion yuan market in detail

Vulkan practice first bullet
[AUTOSAR five methodology]

FAQ | FAQ for building applications for large screen devices

leetcode-2280:表示一个折线图的最少线段数

1.11 - bus

tail -f 、tail -F、tailf的区别

Shell 实现文件基本操作(sed-编辑、awk-匹配)
随机推荐
Array and collection performance comparison
KingbaseES ALTER TABLE 中 USING 子句的用法
【AutoSAR 十一 通信相关机制】
Lex & yacc & bison & flex configuration problems
【JetCache】JetCache的配置说明和注解属性说明
图解网络:什么是虚拟路由器冗余协议 VRRP?
Rust string slicing, structs, and enumeration classes
机器学习:numpy版本线性回归预测波士顿房价
Why is the website slow to open?
[jetcache] jetcache configuration description and annotation attribute description
【AutoSAR 二 AppL概述】
Leetcode-2280: represents the minimum number of line segments of a line graph
node_ Modules cannot be deleted
mysql 多表联合删除
Leetcode-241: designing priorities for operational expressions
MySQL multi table joint deletion
Teach you JDBC hand in hand -- structure separation
Kubernetes resource object introduction and common commands (V) - (NFS & PV & PVC)
leetcode-849:到最近的人的最大距离
Briefly talk about other uses of operation and maintenance monitoring