您尚未登录。

楼主 #1 2020-04-12 11:27:27

zhanshi445
会员
注册时间: 2020-04-07
已发帖子: 11
积分: 6

请教各位大佬,tiny200v2怎么修改uboot打印串口为uart1

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

离线

楼主 #2 2020-04-12 11:31:02

zhanshi445
会员
注册时间: 2020-04-07
已发帖子: 11
积分: 6

Re: 请教各位大佬,tiny200v2怎么修改uboot打印串口为uart1

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

离线

#3 2020-04-12 11:45:51

有梦的地方
会员
注册时间: 2020-03-17
已发帖子: 284
积分: 284

Re: 请教各位大佬,tiny200v2怎么修改uboot打印串口为uart1

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

离线

楼主 #4 2020-04-12 11:48:46

zhanshi445
会员
注册时间: 2020-04-07
已发帖子: 11
积分: 6

Re: 请教各位大佬,tiny200v2怎么修改uboot打印串口为uart1

有梦的地方 说:

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

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

离线

#5 2020-04-12 11:51:56

有梦的地方
会员
注册时间: 2020-03-17
已发帖子: 284
积分: 284

Re: 请教各位大佬,tiny200v2怎么修改uboot打印串口为uart1

zhanshi445 说:

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

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

离线

楼主 #6 2020-04-12 11:56:09

zhanshi445
会员
注册时间: 2020-04-07
已发帖子: 11
积分: 6

Re: 请教各位大佬,tiny200v2怎么修改uboot打印串口为uart1

有梦的地方 说:

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

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

离线

#7 2020-04-12 12:38:49

kekemuyu
会员
注册时间: 2018-12-13
已发帖子: 841
积分: 721

Re: 请教各位大佬,tiny200v2怎么修改uboot打印串口为uart1

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

离线

楼主 #8 2020-04-12 12:45:14

zhanshi445
会员
注册时间: 2020-04-07
已发帖子: 11
积分: 6

Re: 请教各位大佬,tiny200v2怎么修改uboot打印串口为uart1

kekemuyu 说:

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

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

离线

#9 2020-04-12 15:02:06

迪卡
会员
所在地: 河北
注册时间: 2018-11-02
已发帖子: 916
积分: 903
个人网站

Re: 请教各位大佬,tiny200v2怎么修改uboot打印串口为uart1

按照5楼的来
如果你需要UART1 那么其他的不要写。

离线

#10 2020-04-12 21:18:02

MK-2020
会员
注册时间: 2020-01-02
已发帖子: 51
积分: 46

Re: 请教各位大佬,tiny200v2怎么修改uboot打印串口为uart1

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

离线

楼主 #11 2020-04-13 00:57:02

zhanshi445
会员
注册时间: 2020-04-07
已发帖子: 11
积分: 6

Re: 请教各位大佬,tiny200v2怎么修改uboot打印串口为uart1

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

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

离线

#12 2020-04-16 19:16:30

liuchangyin
会员
注册时间: 2020-03-17
已发帖子: 204
积分: 199

Re: 请教各位大佬,tiny200v2怎么修改uboot打印串口为uart1

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

big_smile

离线

#13 2020-04-23 22:37:24

motata
会员
注册时间: 2020-01-20
已发帖子: 2
积分: 2

Re: 请教各位大佬,tiny200v2怎么修改uboot打印串口为uart1

我传个改好的NorFlash的固件, root登陆,密码:123,分辨率是480*272的。Tiny200SV2_uart1_480x272_spiflash_root_123.rar

离线

#14 2020-04-24 19:36:05

sean68
会员
注册时间: 2020-04-24
已发帖子: 7
积分: 7

Re: 请教各位大佬,tiny200v2怎么修改uboot打印串口为uart1

应该在sys_config.fex里面改

离线

#15 2020-05-01 19:46:31

zwanh
会员
注册时间: 2020-04-11
已发帖子: 16
积分: 11

Re: 请教各位大佬,tiny200v2怎么修改uboot打印串口为uart1

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

离线

楼主 #16 2020-05-01 20:04:33

zhanshi445
会员
注册时间: 2020-04-07
已发帖子: 11
积分: 6

Re: 请教各位大佬,tiny200v2怎么修改uboot打印串口为uart1

zwanh 说:

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

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

离线

#17 2020-05-01 21:23:57

Laoyuan
会员
注册时间: 2020-05-01
已发帖子: 7
积分: 7

Re: 请教各位大佬,tiny200v2怎么修改uboot打印串口为uart1

UART是需要TTL转USB吗

离线

#18 2020-05-03 21:35:16

zwanh
会员
注册时间: 2020-04-11
已发帖子: 16
积分: 11

Re: 请教各位大佬,tiny200v2怎么修改uboot打印串口为uart1

zhanshi445 说:

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

谢谢,按照上面的相关教程,已经完全可以了

离线

页脚

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

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