Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => A20 => Topic started by: 3ksolutions on July 22, 2021, 12:24:12 am

Title: U-Boot Verifying data: Error for A20-SOM rev.D
Post by: 3ksolutions on July 22, 2021, 12:24:12 am
I am not able to properly boot image A20-OLinuXino-buster-base-20210707-172415.img. Every time there is error in U-Boot. I have tried to configure board info many times with no success.

boot log:
U-Boot SPL 2021.04+olimex-1-20210707.070354 (Jul 07 2021 - 07:05:22 +0000)
DRAM: 1024 MiB
CPU: 912000000Hz, AXI/AHB/APB: 3/2/2
Loading configuration from EEPROM: Error
Loading configuration from MMC: OK
Verifying data: Error
Error

WARNING: The board cannot be detected!
Please run:
        'olinuxino config list' - Select your board
        'olinuxino config write' - Store the board configuration
        'reset' - Reset the board and load the configuration

Using 'A20-OLinuXino-LIME' as fallback configuration.

Trying to boot from MMC1


U-Boot 2021.04+olimex-1-20210707.070354 (Jul 07 2021 - 07:05:22 +0000) Allwinner Technology

CPU:   Allwinner A20 (SUN7I)
ID:    A20-OLinuXino-LIME Rev.A
SN:    00000000
MAC:   FF:FF:FF:FF:FF:FF
I2C:   ready
DRAM:  1 GiB
MMC:   mmc@1c0f000: 0
Loading Environment from EXT4... OK
Setting up a 1024x600 lcd console (overscan 0x0)
In:    serial
Out:   vga
Err:   vga
Allwinner mUSB OTG (Peripheral)
Net:   eth0: ethernet@1c50000, eth1: usb_ether
starting USB...
Bus usb@1c14000: USB EHCI 1.00
Bus usb@1c14400: USB OHCI 1.0
Bus usb@1c1c000: USB EHCI 1.00
Bus usb@1c1c400: USB OHCI 1.0
scanning bus usb@1c14000 for devices... 1 USB Device(s) found
scanning bus usb@1c14400 for devices... 1 USB Device(s) found
scanning bus usb@1c1c000 for devices... 1 USB Device(s) found
scanning bus usb@1c1c400 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:  0
=>

I have tried this commands to set board configuration:
olinuxino config write 4673 d
saveenv
reset

and

olinuxino config write 7664 d
saveenv
reset
Title: Re: U-Boot Verifying data: Error for A20-SOM rev.D
Post by: 3ksolutions on July 22, 2021, 02:58:30 am
I find out that there is bug in u-boot code.

FILE: u-boot-olinuxino/board/olimex/a20_olinuxino/board.c
LINES: 42-47
       /* If booted from eMMC/MMC try loading configuration */
        bootdev = spl_boot_device();
        if (bootdev == BOOT_DEVICE_MMC1 || bootdev == BOOT_DEVICE_MMC2) {
                printf("Loading configuration from MMC: ");
                if (!olinuxino_mmc_eeprom_read()) {
                        printf("OK\n");
                        printf("Verifying data: ");

                        if (olinuxino_eeprom_is_valid()) {
                                printf("OK\n");
                                return;
                        }
                        printf("Error\n");
                }
                printf("Error\n");
        }

On line 50 there is called function olinuxino_eeprom_is_valid() but probably should be olinuxino_mmc_eeprom_is_valid().
Title: Re: U-Boot Verifying data: Error for A20-SOM rev.D
Post by: LubOlimex on July 22, 2021, 09:43:11 am
I think the problem comes because A20-SOM revision D has no EEPROM to save the values that you set with olinuxino config write.

As you can see even after you set it manually on next boot, no config is recognized and wrong script gets loaded.

In cases where the board has no EEPROM, the config should be written to the card instead, but I am not sure if that happens.
Title: Re: U-Boot Verifying data: Error for A20-SOM rev.D
Post by: 3ksolutions on July 24, 2021, 05:27:46 am
Config is probably written to card but it is not properly validated. There is an bug in U-Boot which is validating eeprom twice. It should validate eeprom and then sd card.
Title: Re: U-Boot Verifying data: Error for A20-SOM rev.D
Post by: gamelaster on May 04, 2022, 12:36:03 pm
Sadly, I'm encountering the same issue (my board don't have a NAND), and even after saveenv and olimex config write, it still fallbacks to LIME :-(
Title: Re: U-Boot Verifying data: Error for A20-SOM rev.D
Post by: andium on May 18, 2022, 07:05:20 am
I have the same problem on a Rev D SOM.  After running olinuxino config write 4673 d I get
Erasing EEPROM configuration...
ERROR: Failed to init eeprom!
Erasing MMC configuration...
Writting EEPROM configuration...
ERROR: Failed to init eeprom!
Writting MMC configuration...

saveenv seems to be successful but olinuxino config info returns
ID:      Rev.D
SN:    FFFFFFFF
MAC:  XX:XX:XX:XX:XX:XX

Note the empty board ID.  After reset I'm back to Lime :(.

Is there an even more manual way to set the board configuration?
Title: Re: U-Boot Verifying data: Error for A20-SOM rev.D
Post by: kimfaint on May 18, 2022, 11:32:35 am
We have the same issue in not having reliable access to the EEPROM (https://www.olimex.com/forum/index.php?topic=8735.0) and need a method to force u-boot to default to a different board.  Being able to tweak some config in the /boot directory would be great.