bouffalolab / bl808_linux

Apache License 2.0
129 stars 40 forks source link

UART console change pins #11

Closed daanpape closed 1 year ago

daanpape commented 1 year ago

Hello,

I just compiled and flashed everything on my SiPeed M1S dock. However I cannot get any UART console. On the second enumerated UART I see the following after pressing the reset button:

dynamic memory init success,heap size = 156 Kbyte
E907 start...
mtimer clk:1000000
psram clk init ok!

I can see the linux console output on IO8 (as stated in the docs) but I cannot do anything with it as IO5 is not exposed on the SiPeed M1S dock. I therefore want to change the console (C906) pins to IO17(RX)/IO16(TX) so that it corresponds to the first enumerated USB serial port on the SiPeed M1S dock.

Therefore I changed the serial block in the hw808c.dts to:

serial@30002000 {
            compatible = "bflb-uart,uart0";
            reg = <0x0 0x30002000 0x0 0x1000>;
            interrupt-parent = <&intc>;
            interrupts = <20>;
            clocks = <&mm_xclk>;
            clock-frequency = <40000000>;
            clock-names = "baudclk";
            status = "okay";
            pin {
                rx = <17>;
                tx = <16>;
            };
        };

I than removed the build output in the out directory and reflashed. However nothing has changed. Can anyone give me some pointers?

Kind regards, Daan

daanpape commented 1 year ago

For reference, I just found the solution on the M1S repo:

https://github.com/sipeed/M1s_BL808_Linux_SDK/blob/main/patch/m1sdock/m1sdock_uart_pin_def.patch