使用VIM3做机器人相关,需要使用spi总线连接两个从机传感器接收数据
Control the robot using the VIM3 and connect two slave sensors using the spi bus to receive data
按照文档激活spi设备
flow steps to setup spi1
编辑env.txt.内容如下:
edit env.txt
like:
# Device Tree Overlays
# uart3 -- Enable UART3 (uart_C, GPIO Header PIN15 & PIN16)
# pwm_f -- Enable PWM_F (GPIO Header PIN35)
# i2c3 -- Enable i2c3 (GPIO Header PIN22 & PIN23)
# spi1 -- Enable SPI1 (GPIO Header PIN15 & PIN16 & PIN35 & PIN37), pwm_f need to be removed
# i2s -- Enable I2S (GPIO Header PIN29 & PIN30 & PIN31 & PIN32 & PIN33)
# os08a10 -- Enable OS08A10 Camera
# onewire -- Enable onewire bus (GPIO Header PIN15)
# disable-ts050 -- Disable TS050 LCD
# m2x-eth -- Enable M2X 100M ethernet. Note: 1G ethernet will be disabled.
# otg-device -- Enable USB OTG Device
# watchdog -- Enable watchdog
# can -- Enable mcp2515 (GPIO Header PIN15 && PIN16 && PIN22 && PIN35 && PIN37), pwm_f/i2c3/uart3 need to be removed
# mpu6050-i2c -- Enable mpu6050 (GPIO Header PIN22 & PIN23 & PIN37), pwm_f need to be removed
# ext_board -- Enable for Khadas EXT Board
# spdifin -- Enable SPDIFIN (GPIO Header PIN35), pwm_f need to be removed
overlays=spi1 i2c3 os08a10 watchdog
custom_ethmac=c8:63:14:71:00:24
rootfstype=ext4
overlays里面也添加了spi1,去除了pwm_f和uart3,但是保存重启后找不到spi设备
In overlays,I remove pwm_f ,uart3 and add spi1,but i can’t find spi dev after reboot.
dmesg | grep spi也没有反应
dmesg | grep spi also no response
使用的是fenix编译的实时固件,主线linux,server版ubuntu 20.04
system info(ubuntu server 20.04):
Linux Khadas 5.17.0-rt17 #1.0.11 SMP Mon May 2 23:40:32 PDT 2022 aarch64 aarch64 aarch64 GNU/Linux
由于需要使用实时内核,而4.9版本打实时补丁有问题,只能使用主线版本
only mainline linux can patch RT,So I can’t use kernel 4.9.
在论坛查查了相关问题,又尝试使用dts来开启spi
overlays does’t work ,try to edit DTS
在/fenix/build/linux-mainline-5.17/arch/arm64/boot/dts/amlogic
里修改了 meson-khadas-vim3.dtsi
文件
同时也把里面的PWM_EF设置为disabled
set PWM_EF to disabled
然后编译出来镜像重新烧录到SD卡里面启动,结果还是没有spi设备,是不是我修改的dts文件不对?还是有其他问题?
make images via fenix,burn into SD card,and power on. Still can’t find spi dev. Is I edit wrong DTS file or just another problem?