Can Protocol (small issue)
Posted: 2026-01-29 18:13
Hi.
I have the luckfox lyra plus, and currenlty I am trying to work on an data intensive can application.
Going to the official documentation, I learned that in order to enable can I had to include the following snippet
in the device tree file kernel-6.1/arch/arm/boot/dts/rk3506g-luckfox-lyra-plus.dts
After rebuilding the kernel and the firmware without any issues and then flashing the board (SPI-NAND buildroot), this had as a result the following:
Can was enabled but the rx side of the protocol was now Programmable IO (simply polling style) , this I suspect will limit the throughput.
After some thinking and slowly trying to understand .dts .dtsi notations (and learning that can0 is served by dmac0) I made this attempt:
But without any luck.
Has anybody faced this ?
I have the luckfox lyra plus, and currenlty I am trying to work on an data intensive can application.
Going to the official documentation, I learned that in order to enable can I had to include the following snippet
Code: Select all
&can0 {
assigned-clocks = <&cru CLK_CAN0>;
assigned-clock-rates = <200000000>;
pinctrl-names = "default";
pinctrl-0 = <&rm_io30_can0_tx &rm_io31_can0_rx>;
status = "okay";
};
After rebuilding the kernel and the firmware without any issues and then flashing the board (SPI-NAND buildroot), this had as a result the following:
Code: Select all
root@luckfox:~# dmesg | grep -i can
[ 1.502078] CAN device driver interface
[ 1.503355] rk3576_canfd ff320000.can: Failed to request rxchan
[ 1.503929] rk3576_canfd ff320000.can: CAN info: use_dma = 0, rx_max_data = 18, fifo_depth = 14
[ 1.619928] can: controller area network core
[ 1.620076] NET: Registered PF_CAN protocol family
[ 1.620113] can: raw protocol
[ 1.620140] can: broadcast manager protocol
After some thinking and slowly trying to understand .dts .dtsi notations (and learning that can0 is served by dmac0) I made this attempt:
Code: Select all
&can0 {
assigned-clocks = <&cru CLK_CAN0>;
assigned-clock-rates = <200000000>;
pinctrl-names = "default";
pinctrl-0 = <&rm_io30_can0_tx &rm_io31_can0_rx>;
dmas = <&dmac0 20 1 0 0 0>; # channel request , direction[device --> mem]
dma-names = "rx";
status = "okay";
};
Has anybody faced this ?