【已解决】SPI2 驱动mcp2515有人实现过吗?
本帖最后由 hiking 于 2019-5-23 09:00 编辑1、设备树
&spi2 {
status = "okay";
can0: can@0{
status = "okay";
compatible = "microchip,mcp2515";
pinctrl-names = "default";
pinctrl-0 = <&can0_pins>;
reg = <0>;
clocks = <&clk16m>;
spi-max-frequency = <10000000>;
interrupt-parent = <&gpio4>;
interrupts = <28 IRQ_TYPE_EDGE_FALLING>;
};
};
2、内核已经配置MCP251x
Linux Kernel Configuration
Networking support
CAN bus subsystem support
CAN device drivers
Platform CAN drivers with Netlink support
CAN bit-timing calculation
Microchip MCP251x SPI CAN controller
还需要哪里配置吗?
ls /sys/class/net/和busybox ifconfig 看不到can0
解决:
1.8电平的问题,使用转换模块转换一下;
请问你解决了吗我也碰到了交流下 解决了,需要增加电平转换模块 hiking 发表于 2019-5-23 08:59
解决了,需要增加电平转换模块
1.8v转多少呢 hiking 发表于 2019-5-23 08:59
解决了,需要增加电平转换模块
Hi hiking,
I need help with this, How can I add this level converter module ?? 撸主。。我设备树(SPI2节点描述,时钟,中断引脚)和系统编译都改了,电压也转1.8V了,还是不行,,在PC-PLUS上调通了,在3399J上就是不行,请问还需要设置哪里才行么?谢谢! 请问这个调通了吗?我现在SPI2时钟输出不了。 请问clocks = <&clk16m>;该如何配置?谢谢! 我设备树(SPI2节点描述,时钟,中断引脚)和系统编译也都改了,电压转1.8V了,就是不行,请问还需要设置哪里才行么?谢谢! 我是用SPI2接MCP2515,但是设备一直没找到,报了以下三句,复位的时候用示波器抓不到波形
[ 1.703279] rockchip-spi ff1e0000.spi: Failed to request TX DMA channel
[ 1.703299] rockchip-spi ff1e0000.spi: Failed to request RX DMA channel
[ 1.703310] rockchip-spi ff1e0000.spi: no high_speed pinctrl state
页:
[1]