YuzukiHD / TinyVision

TinyVision - A Tiny Linux Board / IPC / Server / Router / And so on...
https://yuzukihd.top/TinyVision/#/
GNU Lesser General Public License v2.1
151 stars 19 forks source link

TinyVision reboot failure with v851se_linux_tinyvision_uart0_raw.zip.zip #31

Closed DeqingSun closed 1 week ago

DeqingSun commented 3 months ago

It happens both with the official image or my built from source.

When I run reboot in adb shell,

the serial port prints following code and freezes.


starting pid 942, tty '': '/etc/init.d/rcK'
/etc/init.d/rcK: line 7: /etc/init.d/S01app: not found
Not defined "stop" functions!!!
Stopping network: FAIL
Saving random seed... done.
stop...
Stopping audio: playing '/home/res/audio/shutdown.wav': 2 ch, 48000 hz, 16 bit
Successfully play shutdown music
Stopping logging: OK
Unload mpp modules
rmmod: can't unload module 'sunxi_eise': No such file or directory
rmmod: can't unload module 'sunxi_aio': No such file or directory
rmmod: can't unload module 'videobuf2_v4l2': No such file or directory
rmmod: can't unload module 'videobuf2_memops': No such file or directory
rmmod: can't unload module 'videobuf2_core': No such file or directory

starting pid 1037, tty '': '/sbin/swapoff -a'

can't run '/sbin/swapoff': No such file or directory

starting pid 1038, tty '': '/bin/umount -a -r'
umount: can't remount adb read-only
umount: /dev/pts busy - remounted read-only
umount: devpts busy - remounted read-only
umount: devtmpfs busy - remounted read-only

The system is going down NOW!

Sent SIGTERM to all processes[   70.250067] android_work: sent uevent USB_STATE=DISCONNECTED

Sen
Requesting system reboot
[   72.261834] sunxi-mmc sdc0: sdc set ios:clk 0Hz bm PP pm OFF vdd 0 width 1 timing LEGACY(SDR12) dt B
[   72.486375] [alarmtimer] have no shutdown alarm! alarmtimer_shutdown 322
[   72.494210] sunxi_ohci_hcd_shutdown, ohci0-controller is disable, need not shutdown
[   72.502945] sunxi_ehci_hcd_shutdown, ehci0-controller is disable, need not shutdown
[   72.511677] reboot: Restarting system
[   72.515804] 
[   72.517470] Restarting Linux version 4.9.191 (yuzuki@YuzukiKoddo) (gcc version 5.3.1 20160412 (Linaro GCC 5.3-2016.05) ) #3 PREEMPT Sun Feb 18 18:44:27 CST 2024
[   72.517470] 
CCC
YuzukiTsuru commented 3 months ago

CCC means you enter the USB FEL, maybe it's a RTC reg set error.

DeqingSun commented 2 months ago

Do you have any recommendations to debug such an error? Reboot is useful in many cases.

DeqingSun commented 2 months ago

Do you mean it might be related to the lichee/brandy-2.0/spl/nboot/main/boot0_main.c

And rtc_probe_fel_flag() became true?

DeqingSun commented 2 months ago

Some notes:

Adding parameters to reboot or run a command like "echo "efex" > "/sys/devices/platform/soc/rtc/flag" can change global_pgregbase,which is 0x07090118 (sun8iw21p1.dtsi, rtc: rtc@7090000)

And this seems would be read by "rtc_get_bootmode_flag" in brandy/brandy-2.0/u-boot-2018/board/sunxi/board_helper.c But that code is a part of uboot.

The serial output @ 115200 outputs

[ 1161.288910] sunxi-mmc sdc0: sdc set ios:clk 0Hz bm PP pm OFF vdd 0 width 1 timing LEGACY(SDR12) dt B
[ 1161.516272] [alarmtimer] have no shutdown alarm! alarmtimer_shutdown 322
[ 1161.524105] sunxi_ohci_hcd_shutdown, ohci0-controller is disable, need not shutdown
[ 1161.532740] sunxi_ehci_hcd_shutdown, ehci0-controller is disable, need not shutdown
[ 1161.541462] reboot: Restarting system
[ 1161.545674] 
[ 1161.547343] Restarting Linux version 4.9.191 (root@01b553b5a3ac) (gcc version 5.3.1 20160412 (Linaro GCC 5.3-2016.05) ) #1 PREEMPT Tue Jun 4 02:40:11 UTC 2024
[ 1161.547343] 
CCC

I feel the uboot has not been reached?

YuzukiTsuru commented 2 months ago

image

After trying many times, I still couldn't reproduce your error, like your SD Card not did not respond to the second startup

DeqingSun commented 2 months ago

Oh it might be the reason. I have not tried another sd card.

I will try another sd card and also try to solder the nand flash for testing. If this is the issue, I will dump the sd signal for further analysis.

DeqingSun commented 2 months ago

It is a card issue. I was using a Sandisk Ultra 32GB card, and there was a reboot issue. I changed a ATP 4GB card, and the reboot worked well!

When it works reboot will do a regular reboot and reboot efex will enter enter the USB FEL.