RK3588S_Android15 mcp2515 SPI转CAN 背景RK3588S默认没有can口需要mcp2515去SPI转、SDK/driver/net默认有mcp251x的驱动打开相关宏定义即可。原理图查看SPI0m2,引用相关pinctrl配置中断和复位dts配置diff --git a/arch/arm64/boot/dts/rockchip/rk3588s-xiding.dtsi b/arch/arm64/boot/dts/rockchip/rk3588s-xiding.dtsi index d7b92705ce0f..a7c7b68d03d6 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588s-xiding.dtsi b/arch/arm64/boot/dts/rockchip/rk3588s-xiding.dtsi -129,6 129,17 fan2_en_h: fan2-en-h { rockchip,pins 1 RK_PA6 RK_FUNC_GPIO pcfg_pull_up; }; }; //pinctrl mcp2515_int_rst { mcp2515_int_grp: mcp2515-int-grp { rockchip,pins 3 RK_PC4 RK_FUNC_GPIO pcfg_pull_up; }; mcp2515_rst_grp: mcp2515-rst-grp { rockchip,pins 3 RK_PC5 RK_FUNC_GPIO pcfg_pull_up; }; }; }; /* -147,3 158,35 hdptxphy_hdmi0 { status disabled; }; spi0 { status okay; pinctrl-names default,high-speed; pinctrl-0 spi0m2_pins spi0m2_cs0; cs-gpios gpio1 RK_PB4 1; /* MCP2515 CAN 控制器 */ mcp25150 { status okay; compatible microchip,mcp2515; reg 0; /* SPI0 CS0 */ spi-max-frequency 10000000; // spi-max-frequency 10000000; /* 改为 1 MHz */ interrupt-parent gpio3; interrupts RK_PC4 IRQ_TYPE_EDGE_FALLING; reset-gpios gpio3 RK_PC5 GPIO_ACTIVE_HIGH; clocks clk8m; pinctrl-names default; pinctrl-0 mcp2515_int_grp mcp2515_rst_grp; }; clk8m: clk8 { compatible fixed-clock; #clock-cells 0; clock-frequency 8000000; //8m }; }; diff --git a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi index 91202cb80e3e..0d87cc7e0274 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi -7033,7 7033,7 spi0: spifeb00000 { dmas dmac0 14, dmac0 15; dma-names tx, rx; pinctrl-names default; - pinctrl-0 spi0m0_cs0 spi0m0_cs1 spi0m0_pins; pinctrl-0 spi0m2_cs0 spi0m2_cs1 spi0m2_pins; num-cs 2; status disabled; }; diff --git a/arch/arm64/configs/rk3588.config b/arch/arm64/configs/rk3588.config index b53203bc70e7..2c7b388bc541 100644 --- a/arch/arm64/configs/rk3588.config b/arch/arm64/configs/rk3588.config -2,9 2,13 CONFIG_MALI_VALHALLy CONFIG_AIC_LOADFW_SUPPORTm CONFIG_SENSORS_GPIO_FANy CONFIG_CANy CONFIG_CAN_MCP251Xy CONFIG_CAN_MCP251XFDy 附完整文件 #include dt-bindings/usb/pd.h #include rk3588s.dtsi #include rk3588s-evb.dtsi #include rk3588-rk806-single.dtsi /{ panel-edp { status okay; compatible simple-panel; backlight backlight; power-supply vcc3v3_lcd_edp; prepare-delay-ms 120; enable-delay-ms 120; unprepare-delay-ms 120; disable-delay-ms 120; //width-mm 120; //height-mm 160; panel-timing { clock-frequency 135000000; hactive 1920;//160 vactive 1080;//31 hfront-porch 148; hsync-len 54; hback-porch 88; vfront-porch 36; vsync-len 10; vback-porch 14; hsync-active 0; vsync-active 0; de-active 0; pixelclk-active 0; }; port { panel_in_edp: endpoint { remote-endpoint edp_out_panel; }; }; }; vcc3v3_lcd_edp: vcc3v3-lcd-edp { compatible regulator-fixed; regulator-name vcc3v3_lcd_edp; gpio gpio4 RK_PB3 GPIO_ACTIVE_HIGH; pinctrl-names default; pinctrl-0 edp0_pwren; enable-active-high; regulator-boot-on; vin-supply vcc_3v3_s3; }; /*fan: pwm-fan { compatible pwm-fan; gpios gpio1 RK_PA5 GPIO_ACTIVE_HIGH; gpio-fan,speed-map 0 0 4500 1; pinctrl-names default; pinctrl-0 fan_en_h; #cooling-cells 2; };*/ gpio_fan1: gpio-fan1 { compatible gpio-fan; gpio-fan,speed-map 0 0 8600 1; gpios gpio1 RK_PA5 GPIO_ACTIVE_HIGH; #cooling-cells 2; pinctrl-names default; pinctrl-0 fan1_en_h; status okay; }; gpio_fan2: gpio-fan2 { compatible gpio-fan; gpio-fan,speed-map 0 0 8600 1; gpios gpio1 RK_PA6 GPIO_ACTIVE_HIGH; #cooling-cells 2; pinctrl-names default; pinctrl-0 fan2_en_h; status okay; }; }; backlight { pwms pwm13 0 25000 0; status okay; }; edp0 { force-hpd; status okay; ports { port1 { reg 1; edp_out_panel: endpoint { remote-endpoint panel_in_edp; }; }; }; }; edp0_in_vp0 { status disabled; }; edp0_in_vp1 { status disabled; }; edp0_in_vp2 { status okay; }; pinctrl { edp0{ edp0_pwren: edp0-pwren { rockchip,pins 4 RK_PB3 RK_FUNC_GPIO pcfg_pull_up; }; }; fan { fan1_en_h: fan1-en-h { rockchip,pins 1 RK_PA5 RK_FUNC_GPIO pcfg_pull_up; }; fan2_en_h: fan2-en-h { rockchip,pins 1 RK_PA6 RK_FUNC_GPIO pcfg_pull_up; }; }; mcp2515_int_rst { mcp2515_int_grp: mcp2515-int-grp { rockchip,pins 3 RK_PC4 RK_FUNC_GPIO pcfg_pull_up; }; mcp2515_rst_grp: mcp2515-rst-grp { rockchip,pins 3 RK_PC5 RK_FUNC_GPIO pcfg_pull_up; }; }; }; route_edp0 { status okay; connect vp2_out_edp0; }; hdptxphy0 { status okay; }; hdptxphy_hdmi0 { status disabled; }; spi0 { status okay; pinctrl-names default,high-speed; pinctrl-0 spi0m2_pins spi0m2_cs0; //cs-gpios gpio1 RK_PB4 1; /* MCP2515 CAN 控制器 */ mcp25150 { status okay; compatible microchip,mcp2515; reg 0; /* SPI0 CS0 */ spi-max-frequency 10000000; // spi-max-frequency 10000000; /* 改为 1 MHz */ interrupt-parent gpio3; interrupts RK_PC4 IRQ_TYPE_EDGE_FALLING; reset-gpios gpio3 RK_PC5 GPIO_ACTIVE_HIGH; clocks clk8m; pinctrl-names default; pinctrl-0 mcp2515_int_grp mcp2515_rst_grp; }; clk8m: clk8 { compatible fixed-clock; #clock-cells 0; clock-frequency 8000000; //8m }; };cat sys/kernel/debug/**/pinmux-pins相关引脚是否正常烧录固件ifconfig -a 是否有can节点测试github下载canutils交叉编译。附RK3588S的candump和cansend

相关新闻

最新新闻

SerenityOS 命令行选项解析指南:getopt 与 getopt_long 用法、返回值与底层实现

SerenityOS 命令行选项解析指南:getopt 与 getopt_long 用法、返回值与底层实现

SerenityOS 命令行选项解析指南:getopt 与 getopt_long 用法、返回值与底层实现 【免费下载链接】serenity The Serenity Operating System 🐞 项目地址: https://gitcode.com/GitHub_Trending/se/serenity 导读 本文以 getopt(3) 手册 为核心&a…

2026/10/1 19:32:24
轻量服务器还是ECS?大促云服务器选购与避坑实战指南

轻量服务器还是ECS?大促云服务器选购与避坑实战指南

每年大促节点,群里永远有人在问同一个问题:“38元的轻量服务器到底怎么抢?为什么我每次点进去都是已售罄?68元直购和99元的ECS我到底选哪个?”作为一个常年帮团队和自己采购云服务器的老用户,我太清楚这种纠…

2026/9/30 21:32:07
为 AI 代理的 Review 动作编写 Cedar 审批门控策略:review-agent-governance 策略编写实战指南

为 AI 代理的 Review 动作编写 Cedar 审批门控策略:review-agent-governance 策略编写实战指南

为 AI 代理的 Review 动作编写 Cedar 审批门控策略:review-agent-governance 策略编写实战指南 【免费下载链接】agents Multi-harness agentic plugin marketplace for Claude Code, Codex, Cursor, OpenCode, GitHub Copilot, and Google Antigravity 项目地址:…

2026/10/2 15:29:32
PaddleOCR 手写数学公式识别算法 CAN 实战指南:Counting-Aware Network 训练、评估与推理部署

PaddleOCR 手写数学公式识别算法 CAN 实战指南:Counting-Aware Network 训练、评估与推理部署

PaddleOCR 手写数学公式识别算法 CAN 实战指南:Counting-Aware Network 训练、评估与推理部署 【免费下载链接】PaddleOCR Turn any PDF or image document into structured data for your AI. A powerful, lightweight OCR toolkit that bridges the gap between i…

2026/10/1 19:32:23
Spring源码解析:构造器注入的类型转换与候选匹配机制

Spring源码解析:构造器注入的类型转换与候选匹配机制

/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views …

2026/10/1 19:32:35
openai-agents-python 多模型接入指南:深入解析 AnyLLMModel 适配层与 any-llm 路由

openai-agents-python 多模型接入指南:深入解析 AnyLLMModel 适配层与 any-llm 路由

openai-agents-python 多模型接入指南:深入解析 AnyLLMModel 适配层与 any-llm 路由 【免费下载链接】openai-agents-python A lightweight, powerful framework for multi-agent workflows 项目地址: https://gitcode.com/GitHub_Trending/op/openai-agents-pyth…

2026/9/30 21:32:11

日新闻

周新闻

月新闻