frank-w
(Frank W.)
April 9, 2020, 7:32pm
74
As i see you use a modified version of my environment…
If you call newboot, buildargs is used to override buildargs you see…here console var is used…
console=earlyprintk console=ttyS0,115200 console=tty1 fbcon=map:0
Just try change this before loading kernel
cioby23
(Cioby23)
April 9, 2020, 7:46pm
75
Sorry excuse my ignorance I’m not very familiar with U-boot Uenv.txt file syntax. Is this the way how I should configure it and run it ?
setenv newboot "console=earlyprintk console=ttyS0,115200 console=tty1 fbcon=map:0"
run newboot
frank-w
(Frank W.)
April 9, 2020, 8:13pm
76
In uenv.txt:
console=earlyprintk console=ttyS2,115200 console=tty1 fbcon=map:0
Or in uboot itself
setenv console "earlyprintk console=ttyS2,115200 console=tty1 fbcon=map:0"
Before calling newboot you have to set kernel var…maybe also by uenv.txt…
How have you configured it?
cioby23
(Cioby23)
April 9, 2020, 8:19pm
77
I see the console line is already set and has all options from this output
bootargs=console=earlyprintk console=ttyS0,115200 console=tty1 fbcon=map:0 root=/dev/mmcblk1p2 rootfstype=ext4 rootwait vmalloc=496M debug=7 7
3154366 bytes read in 163 ms (18.5 MiB/s)
## Booting kernel from Legacy Image at 80200000 ...
Image Name: ARM OpenWrt Linux-5.4.31
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3154302 Bytes = 3 MiB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
Loading Kernel Image
Starting kernel ...
I tried also manually to boot the kernel using U-boot menu and below is the output:
4586 uEnv.txt
3154366 uImage
2 file(s), 0 dir(s)
enter uImage-name: uImage
kernelinput=uImage
enter dtb-name:
## Error: "dtbinput" not defined
It does not have any dtb file. This might be the issue why it freezes ?
frank-w
(Frank W.)
April 9, 2020, 8:44pm
78
Your bootargs showing ttyS0…you need dtb only if it is not appended to kernel binary…
cioby23
(Cioby23)
April 9, 2020, 10:41pm
79
Ok i got a little further. I enabled earlyprintk and debug and after booting I see the kernel boots fine but no console
bootargs=console=earlyprintk console=ttyS0,115200 console=tty1 fbcon=map:0 root=/dev/mmcblk1p2 rootfstype=ext4 rootwait vmalloc=496M debug=7 7
3152846 bytes read in 163 ms (18.4 MiB/s)
## Booting kernel from Legacy Image at 80200000 ...
Image Name: ARM OpenWrt Linux-5.4.31
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3152782 Bytes = 3 MiB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
Loading Kernel Image
Starting kernel ...
Uncompressing Linux... done, booting the kernel.
Also I modified in this patch 0006-dts-fix-bpi2-console.patch on the bootargs line the console value from ttyS2 to ttyS0 but no luck yet
— a/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts
+++ b/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts
@@ -19,6 +19,7 @@
chosen {
stdout-path = "serial2:115200n8";
frank-w
(Frank W.)
April 10, 2020, 6:55am
80
I guess you use mainline kernel where debuguart is (not moved) uart2. Why you change choosen-node? And ttyS2 is right for mainline…
Your uboot still shows ttyS0 before starting kernel
cioby23
(Cioby23)
April 10, 2020, 7:04am
81
Yes you are right I change it back to ttyS2 and managed to boot it successfully but now I’m back to that issue that after booting I cannot see the console prompt.
I guess that is because I need to change also tty1 with ttyS0 also as you mentioned in the below post
As i said above…you need to swap tty1 (hdmi) and ttyS0 (serial)
console=ttyS0,115200 console=tty1 fbcon=map:0
In your uEnv.txt (BPI-BOOT/bananapi/bpi-r2/linux/uEnv.txt
frank-w
(Frank W.)
April 10, 2020, 7:19am
82
No,this swaps only serial console and hdmi…
You need to set console var as i wrote above…best way should be uenv.txt else you need to set it on every boot
Or you swap uart like i do in my kernels…put uart2 first in mt7623.dtsi
cioby23
(Cioby23)
April 10, 2020, 8:03am
83
So when looking at this line in uEnv.txt
setenv console "earlyprintk console=ttyS2,115200 console=tty1 fbcon=map:0"
First console entry should be ttyS2 which is good but the second should be tty1 ? or should be other tty like 0 or 2 ?
frank-w
(Frank W.)
April 10, 2020, 8:05am
84
tty1 (without S) is right as this is hdmi-console…there is no 0.
Does serial console work now?
cioby23
(Cioby23)
April 10, 2020, 8:22am
85
Serial console works up to where the kernel messages finish with no prompt being displayed
[ 13.673373] mt7530 mdio-bus:00 wan: Link is Up - 1Gbps/Full - flow control rx/tx
[ 13.680794] IPv6: ADDRCONF(NETDEV_CHANGE): wan: link becomes ready
[ 32.472893] vusb: disabling
[ 32.475706] vmc: disabling
[ 32.478411] vmch: disabling
[ 32.481205] vgp1: disabling
[ 32.484050] vcamaf: disabling
^C
frank-w
(Frank W.)
April 10, 2020, 8:33am
86
Was os loaded? Which one do you try (openwrt,debian,…)?
cioby23
(Cioby23)
April 10, 2020, 8:49am
87
It’s OpenWRT trunk kernel 5.4.31
frank-w
(Frank W.)
April 10, 2020, 8:51am
88
In openwrt you have to put ttyS2 first and no setenv in uenv.txt…see my post above for uenv-format…
console=ttyS2,115200 ....
cioby23
(Cioby23)
April 10, 2020, 9:48am
89
I do not have setenv configured in my uEnv.txt file. I have uploaded it here
uEnv-default.txt (4.5 KB)
I also attached the full serial console boot log
openwrt-serial-console-boot-log.txt (32.4 KB)
I managed to connect to OpenWRT using ssh and default IP/credentials, but the CLI prompt on the serial console still cannot be accessed.
frank-w
(Frank W.)
April 10, 2020, 10:33am
90
Have you tried pressing enter? Bootlog looks good so far…
Btw. If you use my uboot you do not need full environment in uenv.txt…only parts that you want to change
cioby23
(Cioby23)
April 10, 2020, 10:54am
91
Ok I have managed to fix the serial console issue. I had a look at @lexa2 OpenWRT fork and he has a patch to fix the serial console access
I applied it to my repo and change it to ttyS2 and then it worked fine.
1 Like
frank-w
(Frank W.)
April 10, 2020, 11:12am
92
I wondering why i do not run into this issue while booting my kernel with actual openwrt rootfs
have tested the rootfs-method on r64 too got working console
looked in my /etc/inittab and have only the first 3 entries (sysinit,shutdown,askconsole) (on r64)
LeXa2
(Alexey Loukianov)
May 5, 2020, 2:43am
93
It remains a kind-a-mistery for me too, check my commit message that @cioby23 refferenced. “::askconsole” is expected to work out of the box providing login on the /dev/console but for some unknown reason it wasn’t working for me in OpenWRT 18.06 fork. As my time working on that was really limited I preferred not to waste it investigating what’s the deal and simply implemented a workaround by adding an explicit line into inittab.