您尚未登录。

#3 Re: 全志 SOC » 请教各位大佬,tiny200v2怎么修改uboot打印串口为uart1 » 2020-05-01 20:04:33

zwanh 说:

我也是tiny200,我在修改u-boot的串口,改了arch/arm/mach-sunxi/clock_sun6i.c和arch/arm/mach-sunxi/board.c,但还是不能正常使用,感觉是串口没有配置为UART1,但是不知道在哪里配置,谁能告诉下

看上面的连接,基本都有了

#4 Re: 全志 SOC » 请教各位大佬,tiny200v2怎么修改uboot打印串口为uart1 » 2020-04-13 00:57:02

MK-2020 说:

#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
说不定有惊喜。

真的有惊喜。。。。。这个我之前我照着改过,会报错,刚看到你的回复想到可以把这两条语句放到后面,这样就不会报无端口的错误了

#5 Re: 全志 SOC » 请教各位大佬,tiny200v2怎么修改uboot打印串口为uart1 » 2020-04-12 12:45:14

kekemuyu 说:

固件不好改,可以考虑改硬件,好像widora保留了修改的方法。看下图:
https://whycan.cn/files/members/1315/none_20200412-1238.png

现在手上没工具,只能在软件上想办法

#6 Re: 全志 SOC » 请教各位大佬,tiny200v2怎么修改uboot打印串口为uart1 » 2020-04-12 11:56:09

有梦的地方 说:

那现在是什么情况呢?串口一点输出都没有吗?cp2104?

对,是CP2104,串口什么输出都没有,芯片应该是正常的,烧过其它固件

#7 Re: 全志 SOC » 请教各位大佬,tiny200v2怎么修改uboot打印串口为uart1 » 2020-04-12 11:48:46

有梦的地方 说:

照这个帖子,药到病除: https://whycan.cn/t_4017.html#p37402

就是照着这个帖子改的,还是不行

#8 Re: 全志 SOC » 请教各位大佬,tiny200v2怎么修改uboot打印串口为uart1 » 2020-04-12 11:31:02

\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))

#9 全志 SOC » 请教各位大佬,tiny200v2怎么修改uboot打印串口为uart1 » 2020-04-12 11:27:27

zhanshi445
回复: 17

照着 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";
};

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn