照着 https://whycan.cn/t_3138.html 该帖子学f1c200s,但tiny200v2的打印串口和licheepi nano的不同,需要修改为uart1,我照着一些帖子改了dts sunxi-common.h等文件,还是没有成功。linux新手,请各位帮看下还有哪些需要改
/u-boot/include/configs/sunxi-common.h
#ifndef CONFIG_CONS_INDEX
#define CONFIG_CONS_INDEX 2
#endif
#ifdef CONFIG_REQUIRE_SERIAL_CONSOLE
#if CONFIG_CONS_INDEX == 1
#ifdef CONFIG_MACH_SUN9I
#define OF_STDOUT_PATH "/soc/serial@07000000:115200"
#else
#define OF_STDOUT_PATH "/soc@01c00000/serial@01c28000:115200"
#endif
#elif CONFIG_CONS_INDEX == 2 && defined(CONFIG_MACH_SUN5I)
#define OF_STDOUT_PATH "/soc@01c00000/serial@01c28400:115200"
#elif CONFIG_CONS_INDEX == 3 && defined(CONFIG_MACH_SUN8I)
#define OF_STDOUT_PATH "/soc@01c00000/serial@01c28800:115200"
#elif CONFIG_CONS_INDEX == 5 && defined(CONFIG_MACH_SUN8I)
#define OF_STDOUT_PATH "/soc@01c00000/serial@01f02800:115200"
#else
#error Unsupported console port nr. Please fix stdout-path in sunxi-common.h.
#endif
#endif /* ifdef CONFIG_REQUIRE_SERIAL_CONSOLE */
\u-boot\arch\arm\dts\suniv.dtsi
uart0_pins_a: uart-pins-pe {
pins = "PE0", "PE1";
function = "uart0";
};
uart1_pins_a: uart-pins-pa {
pins = "PA2", "PA3";
function = "uart1";
};
uart0: serial@1c25000 {
compatible = "snps,dw-apb-uart";
reg = <0x01c25000 0x400>;
interrupts = <1>;
reg-shift = <2>;
reg-io-width = <4>;
clocks = <&ccu CLK_BUS_UART0>;
resets = <&ccu RST_BUS_UART0>;
status = "disabled";
};
uart1: serial@1c25400 {
compatible = "snps,dw-apb-uart";
reg = <0x01c25400 0x400>;
interrupts = <2>;
reg-shift = <2>;
reg-io-width = <4>;
clocks = <&ccu CLK_BUS_UART1>;
resets = <&ccu RST_BUS_UART1>;
status = "enabled";
};
\u-boot\arch\arm\dts\suniv-f1c100s-licheepi-nano.dts
aliases {
serial0 = &uart0;
spi0 = &spi0;
serial1 = &uart1;
};
chosen {
stdout-path = "serial1:115200n8";
};
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_pins_a>;
status = "okay";
};
&uart1 {
pinctrl-names = "default";
pinctrl-0 = <&uart1_pins_a>;
status = "okay";
};
离线
\u-boot\arch\arm\mach-sunxi\board.c
#elif CONFIG_CONS_INDEX == 1 && defined(CONFIG_MACH_SUNIV)
sunxi_gpio_set_cfgpin(SUNXI_GPE(0), SUNIV_GPE_UART0);
sunxi_gpio_set_cfgpin(SUNXI_GPE(1), SUNIV_GPE_UART0);
sunxi_gpio_set_pull(SUNXI_GPE(1), SUNXI_GPIO_PULL_UP);
#elif CONFIG_CONS_INDEX == 2 && defined(CONFIG_MACH_SUNIV)
sunxi_gpio_set_cfgpin(SUNXI_GPA(2), SUNIV_GPA_UART1);
sunxi_gpio_set_cfgpin(SUNXI_GPA(3), SUNIV_GPA_UART1);
sunxi_gpio_set_pull(SUNXI_GPA(3), SUNXI_GPIO_PULL_UP);
#elif CONFIG_CONS_INDEX == 1 && (defined(CONFIG_MACH_SUN4I) || \
defined(CONFIG_MACH_SUN7I) || \
defined(CONFIG_MACH_SUN8I_R40))
离线
照这个帖子,药到病除: https://whycan.cn/t_4017.html#p37402
就是照着这个帖子改的,还是不行
离线
那现在是什么情况呢?串口一点输出都没有吗?cp2104?
对,是CP2104,串口什么输出都没有,芯片应该是正常的,烧过其它固件
离线
固件不好改,可以考虑改硬件,好像widora保留了修改的方法。看下图:
https://whycan.cn/files/members/1315/none_20200412-1238.png
现在手上没工具,只能在软件上想办法
离线
#ifndef CONFIG_CONS_INDEX
#define CONFIG_CONS_INDEX 2
#endif
按照上面的写法,你去看下autoconf.h,可能CONFIG_CONS_INDEX = 1
把上面试下改为:
#undef CONFIG_CONS_INDEX
#define CONFIG_CONS_INDEX 2
说不定有惊喜。
真的有惊喜。。。。。这个我之前我照着改过,会报错,刚看到你的回复想到可以把这两条语句放到后面,这样就不会报无端口的错误了
离线
我也是tiny200,我在修改u-boot的串口,改了arch/arm/mach-sunxi/clock_sun6i.c和arch/arm/mach-sunxi/board.c,但还是不能正常使用,感觉是串口没有配置为UART1,但是不知道在哪里配置,谁能告诉下
看上面的连接,基本都有了
离线