MiSTer-devel / SD-Installer-Win64_MiSTer

MiSTer SD card installer (Windows 64bit)
GNU General Public License v2.0
78 stars 27 forks source link

uboot image with latest release (20220413) boots unreliably #14

Open StiNKzz opened 2 years ago

StiNKzz commented 2 years ago

I bought a brand new de 10 nano direct from Terasic in August. I have found the uboot image with the latest release (20220413) to boot unreliably, approximately 10% success rate.

However if I build my own uboot image from https://github.com/MiSTer-devel/u-boot_MiSTer and flash that directly on top of the sd cards uboot image, the boot is successful every time.

No additional boards, nor any sdram were attached, the nano was entirely by itself. Multiple sd cards of different brands and sizes were tested with this issue, they all produced the same results.

The uboot image bundled with the release may work with 99% of the nano boards out there, but my nano board appears to be 'special'. With that said, once I've flashed it with my own uboot image, my board works perfectly. I might also add the uboot image that Mr Fusion uses to start the installation process works fine as well.

This issue has been raised out of a discussion at https://misterfpga.org/viewtopic.php?t=5292

The UART output from a bad boot (uboot from release_20220413):

Trying to boot from MMC1

U-Boot 2017.03+ (Oct 18 2021 - 19:11:36 +0800)

       Watchdog enabled
DRAM:  1 GiB
socfpga_bridges_reset: FPGA not ready, aborting.
MMC:   dwmmc0@ff704000: 0

From a successful boot (uboot from release_20220413):

U-Boot SPL 2017.03+ (Oct 18 2021 - 19:11:36)
Trying to boot from MMC1

U-Boot 2017.03+ (Oct 18 2021 - 19:11:36 +0800)

       Watchdog enabled
DRAM:  1 GiB
socfpga_bridges_reset: FPGA not ready, aborting.
MMC:   dwmmc0@ff704000: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Autoboot in 0 seconds
reading menu.rbf
2467916 bytes read in 260 ms (9.1 MiB/s)
reading /linux/zImage_dtb
6765321 bytes read in 704 ms (9.2 MiB/s)
## Flattened Device Tree blob at 0166ecd8
   Booting using the fdt blob at 0x166ecd8
   reserving fdt memory region: addr=0 size=1000
   Loading Device Tree to 03ff8000, end 03fffe30 ... OK

Starting kernel ...

[    0.307905] rtc-pcf8563 2-0051: pcf8563_write_block_data: err=-6 addr=0e, data=03
[    0.315400] rtc-pcf8563 2-0051: pcf8563_probe: write error
[    0.332681] rtc-m41t80 2-0068: Can't clear HT bit
Starting syslogd: OK
Starting klogd: OK
Populating /dev using udev:
Minimig by Dennis van Weeren
ARM Controller by Jakub Bednarski
MiSTer code by Sorgelig

Version 220413

Looking for root device...
FileOpenEx(open) File:/media/fat/config/device.bin, error: No such file or directory.
Using SD card as a root device
Identified 8BIT core*** SDRAM config not found
Core name is "MENU"
** altcfg: no cfg
INI_PARSER : Start INI parser for core "MENU"(MENU), video mode "0x0@0.0".
FileOpenEx(open) File:/media/fat/MiSTer.ini, error: No such file or directory.
get cfgstring 0 = MENU
get cfgstring 1 = UART31250,MIDI
Got UART speeds: 31250 0 0 0 0 0 0 0 0 0
Got MIDI speeds: 31250 0 0 0 0 0 0 0 0 0
get cfgstring 2 = V,v220413
get cfgstring 3 = NULL

// Status Bit Map:
//              Upper                          Lower
// 0         1         2         3          4         5         6
// 01234567890123456789012345678901 23456789012345678901234567890123
// 0123456789ABCDEFGHIJKLMNOPQRSTUV 0123456789ABCDEFGHIJKLMNOPQRSTUV
// X

Incorrect amount of items in video_mode parameter: 0
Calculate PLL for 74.2500 MHz:
Fvco=445.500000, C=6, M=8, K=0.910000(3908420239) -> Fpix=74.250000
Incorrect amount of items in video_mode parameter: 0
Calculate PLL for 74.2500 MHz:
Fvco=445.500000, C=6, M=8, K=0.910000(3908420239) -> Fpix=74.250000
Incorrect amount of items in video_mode parameter: 0
Calculate PLL for 74.2500 MHz:
Fvco=445.500000, C=6, M=8, K=0.910000(3908420239) -> Fpix=74.250000
FileOpenEx(open) File:/media/fat/config/MENU_gamma.cfg, error: No such file or directory.
FileOpenEx(open) File:/media/fat/config/MENU_scaler.cfg, error: No such file or directory.
FileOpenEx(open) File:/media/fat/filters/, error: No such file or directory.
Filter '', phases: 0 adaptive: false
FileOpenEx(open) File:/media/fat/filters/, error: No such file or directory.
Filter '', phases: 0 adaptive: false
FileOpenEx(open) File:/media/fat/filters/, error: No such file or directory.
Filter '', phases: 0 adaptive: false
video_set_filter: flt_flags=7
FileOpenEx(open) File:/media/fat/filters/, error: No such file or directory.
Filter '', phases: 0 adaptive: false
Send HDMI parameters:
video: 1280(1280), 110(110), 40(40), 220(220), 720(720), 5(5), 5(5), 20(20), -hsync, -vsync
PLL: 0x4, 0x404, 0x3, 0x10000, 0x5, 0x303, 0x9, 0x2, 0x8, 0x7, 0x7, 0xE8F5C28F, Fpix=74.250000
FileOpenEx(open) File:/media/fat/config/MENU_shmask.cfg, error: No such file or directory.
FileOpenEx(open) File:/media/fat/shadow_masks/, error: No such file or directory.
FileOpenEx(open) File:/media/fat/config/MENU_afilter.cfg, error: No such file or directory.
FileOpenEx(open) File:/media/fat/config/Volume.dat, error: No such file or directory.
sending keymap: 0
Loading config MENU.CFG
FileOpenEx(open) File:/media/fat/config/MENU.CFG, error: No such file or directory.
Switch to core frame buffer
FileOpenEx(open) File:/media/fat/config/uartmode.MENU, error: No such file or directory.
FileOpenEx(open) File:/media/fat/config/uartspeed.MENU, error: No such file or directory.
UART bauds: 31250/31250/31250
ttyS1: 31250
ttyS1: 31250
Open up to 30 input devices.
make_unique(289B,0057,-1)
make_unique(0E8F,3013,1)
make_unique(16C0,05E1,1)
make_unique(045E,02A1,1)
make_unique(8282,3201,1)
make_unique(1209,FACA,1)
pFileExt = (null)
Start to scan dir: /media/fat/
Position on item:
Got 0 dir entries
*** Got SDRAM module type: 0
INFO: Video resolution: 529 x 240, fHorz = 15.7KHz, fVert = 59.8Hz, fPix = 10.00MHz
INFO: Frame time (100MHz counter): VGA = 1671559, HDMI = 1666665
done
Starting system message bus: done
Starting network: Failed to bring up wlan0.
Failed to bring up wlan1.
FAIL
Starting dhcpcd...
dhcpcd-9.4.0 starting
sandbox unavailable: seccomp
dev: loaded udev
sandbox unavailable: seccomp
forked to background, child pid 587
Checking for Bluetooth storage
32+0 records in
32+0 records out
2097152 bytes (2.1 MB, 2.0 MiB) copied, 0.355341 s, 5.9 MB/s
mke2fs 1.45.6 (20-Mar-2020)
*** reset bt ***
Creating filesystem with 2048 1k blocks and 256 inodes

Allocating group tables: done
Writing inode tables: done
Creating journal (1024 blocks): done
Writing superblocks and filesystem accounting information: done

Starting bluetoothd: OK
Starting ntpd: OK
Starting ProFTPD: done
Starting sshd: OK

Welcome to MiSTer (www.MiSTerFPGA.org)
login:
sorgelig commented 2 years ago

It's hard to understand what's the problem. According to forum, only you have this problem. So it's possible there is some specific setup causes this problem. I think you know that uboot.img laying in linux folder is not used for booting. You(or some script) need to execute updateboot which will flash uboot.img into special place of sd card. After that you can simply delete uboot.img - it's not needed.

aeberbach commented 2 years ago

It's not only him, I have put away my DE-10 after it stopped booting. Will no longer boot to GUI, only to prompt shown through serial. I have described this in the forum also. Mr. Fusion never gets to the second boot.

mjtorn commented 11 months ago

Coming from the thread at https://misterfpga.org/viewtopic.php?t=5292 I apologize if this isn't the best issue for it. There are so many repositories to choose from where to post, I'll gladly copypaste this somewhere else if you just tell me where.

For what it's worth, I tried the 20221224 release and have abysmal luck. This is installed by mr-fusion 2.9 (unlike what this repo's about, but isn't the resulting sd card the same anyway).

I also tried to downgrade to the 2021-08-29 release of uboot.img because I think that's the latest when people say 20210917 at https://misterfpga.org/viewtopic.php?t=3724 but it's not really better.

U-Boot 2017.03+ (Dec 24 2022 - 15:55:06 +0800)

       Watchdog enabled
DRAM:  1 GiB
socfpga_bridges_reset: FPGA not ready, aborting.
MMC:   dwmmc0@ff704000: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Autoboot in 0 seconds
reading menu.rbf
2484588 bytes read in 273 ms (8.7 MiB/s)
reading /linux/u-boot.txt
39 bytes read in 8 ms (3.9 KiB/s)
## Info: input data size = 1005 = 0x3ED
reading /linux/zImage_dtb
** Unable to read file /linux/zImage_dtb **
ERROR: Did not find a cmdline Flattened Device Tree
Could not find a valid device tree
=>

but when it works, it's like this

U-Boot 2017.03+ (Dec 24 2022 - 15:55:06 +0800)

       Watchdog enabled
DRAM:  1 GiB
socfpga_bridges_reset: FPGA not ready, aborting.
MMC:   dwmmc0@ff704000: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Autoboot in 0 seconds
reading menu.rbf
2484588 bytes read in 264 ms (9 MiB/s)
reading /linux/u-boot.txt
26 bytes read in 5 ms (4.9 KiB/s)
## Info: input data size = 1005 = 0x3ED
reading /linux/zImage_dtb
7378793 bytes read in 803 ms (8.8 MiB/s)
## Flattened Device Tree blob at 01704938
   Booting using the fdt blob at 0x1704938
   reserving fdt memory region: addr=0 size=1000
   Loading Device Tree to 03ff8000, end 03fffe30 ... OK

Starting kernel ...

[    1.223369] rtc-pcf8563 2-0051: pcf8563_write_block_data: err=-6 addr=0e, data=03
[    1.230865] rtc-pcf8563 2-0051: pcf8563_probe: write error
[    1.243374] rtc-m41t80 2-0068: Can't clear HT bit
Starting syslogd: OK
Starting klogd: OK
Populating /dev using udev: 
Minimig by Dennis van Weeren
ARM Controller by Jakub Bednarski
MiSTer code by Sorgelig

Version 231018

Looking for root device...
FileOpenEx(open) File:/media/fat/config/device.bin, error: No such file or directory.
Using SD card as a root device
Identified 8BIT core*** SDRAM config not found
Core name is "MENU"
** altcfg: no cfg
INI_PARSER : Start INI parser for core "MENU"(MENU), video mode "0x0@0.0".
INI_PARSER : Opened file MiSTer.ini with size 14336 bytes.

I have tried two SD cards; one old one and the one that came with the FPGA. I don't think I've reinstalled this enough times to burn a hole in it, even though I did do that downgrade of uboot.img and update_boot song and dance.

This is made more frustrating by the fact there's no real way to know if the device is about to come online or not. Except using a laptop and the usb uart. I was thinking there would be a small oled-type monitor that could read the serial data and display it, so I'd at least know if there's any point in jiggling the power switch, but I have it on good authority it's a non-trivial thing to build, as no over-the-counter solutions exist.

Is the DE10-Nano just a :hankey: that works by accident for enough people that the ones who don't get it going complain on the forums for a while until they stop trying? Or is there something fundamentally wrong in using mr-fusion as-is, and using mr-fusion with installing only some cores, and using mr-fusion and restoring a bigger backup of the conf files? I mean, the vanilla second boot essentially never works :man_shrugging: so I'd think it's not about the installation.

Where would I check my board version number, for example?

The post https://misterfpga.org/viewtopic.php?p=59472#p59472 seems like it would be best to build my own uboot.img, maybe that's in the future.

sorgelig commented 11 months ago

May be your DE10-nano is faulty. May be power supply circuit on your DE10-nano has problem and prevent it from booting. Every device may have problem including DE10-nano. If the problem you described was common then many people would complain. So it makes me think there is a problem with specific DE10-nano. But you may investigate further if you like. Source code for uboot is available.

mjtorn commented 11 months ago

Now I've conducted some more experiments, like in getting a 5V/5A PSU. I also built my kernel and bootloader and all that stuff.

The PSU is not proven to be relevant right now.

The DE10-nano doesn't boot 100% of the times, but it's as if there was some initial contact flaw and after one or two more attempts at booting, it starts up every time.

It should also be said that I have the MiSTress 500 daughterboard here, which I didn't think was pertinent information until I pulled the 10-pin GPIO1 bridge from between the DE10-nano and the mistress.

That seems to be the biggest single factor at play, so maybe some day I'll hotwire each of the pins, and/or try to measure the bridge with a multimeter, but this is too consistent to not be a lead.

Why it doesn't always boot might be a contact issue, as I routinely jiggle the MicroSD and everything when I mess with the system, so it could be that.

But what I'm currently seeing for errors, though I'm not certain this is a MiSTer issue per se anymore:

U-Boot SPL 2017.03-MiSTer-mjtorn+ (Dec 04 2023 - 12:00:53)
Trying to boot from MMC1
mmc_load_image_raw_sector: mmc block read error
mmc_load_image_raw_sector: mmc block read error
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###