Latest bullseye-minimal image olinuxino-sd-to-emmc not boot on A20

Started by timnis76, December 27, 2021, 10:42:46 AM

Previous topic - Next topic

timnis76

Hello, fetched "20-OLinuXino-bullseye-minimal-20211223-102355.img.7z" and it working fine on SD, but when I run "olinuxino-sd-to-emmc" script to it to emmc and try to boot from emmc, it won't boot. It stuck on uboot.

Board is T2-OLinuXino-LIME2-e8Gs16M-IND Rev.L and powered from DC barrel connector with sufficient power supply.

switch to partitions #0, OK
mmc1(part 0) is current device
** Unrecognized filesystem type **
Card did not respond to voltage select! : -110
scanning bus for devices...
SATA link 0 timeout.
AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
flags: ncq stag pm led clo only pmp pio slum part ccc apst

Device 0: unknown device

Device 0: unknown device
ethernet@1c50000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
Could not initialize PHY ethernet@1c50000
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC de:ad:be:ef:00:01
HOST MAC de:ad:be:ef:00:00
RNDIS ready
The remote end did not respond in time.missing environment variable: pxeuuid
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/01-30-1f-9a-d0-dc-41
ethernet@1c50000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
Could not initialize PHY ethernet@1c50000
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC de:ad:be:ef:00:01
HOST MAC de:ad:be:ef:00:00
RNDIS ready
The remote end did not respond in time.missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000000
ethernet@1c50000 Waiting for PHY auto negotiation to complete.....


LubOlimex

Did you also test with the base image? Are the results similar?
Technical support and documentation manager at Olimex

bboyadzhiev

Hello!

I have the exactly same problem on A20-OLinuXino-LIME2-e16Gs16M Rev.L

I tried both base and minimal images
A20-OLinuXino-bullseye-base-20211223-102355
A20-OLinuXino-bullseye-minimal-20211223-102355

eMMC doesn't boot:
mmc1(part 0) is current device
** Unrecognized filesystem type **

I think something went wrong during eMMC partitioning.

This is the olinuxino-sd-to-emmc log:
root@a20-olinuxino:~# olinuxino-sd-to-emmc

Detecting board...

Detecting the root device...
Root partition:         /dev/mmcblk0p1
Root device:            /dev/mmcblk0

Detecting eMMC device...
eMMC partition:         /dev/mmcblk1p1
eMMC device:            /dev/mmcblk1

Checking disk size...
Required blocks:        5108800
Available blocks:       30535680

Unmount target device...
umount: /dev/mmcblk1p1: no mount point specified.

Copying MBR record...
No free sectors available.
Failed to add #1 partition: No space left on device

Resizing partition...
lsblk: /dev/mmcblk1p1: not a block device
lsblk: /dev/mmcblk1p1: not a block device

Welcome to fdisk (util-linux 2.36.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xd083341e.

Command (m for help): No partition is defined yet!

Command (m for help): 1: unknown command

Command (m for help): Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): Partition number (1-4, default 1): First sector (2048-30535679, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-30535679, default 30535679):
Created a new partition 1 of type 'Linux' and of size 14.6 GiB.

Command (m for help): The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

e2fsck 1.46.2 (28-Feb-2021)
ext2fs_open2: Bad magic number in super-block
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/mmcblk1p1

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
 or
    e2fsck -b 32768 <device>

resize2fs 1.46.2 (28-Feb-2021)
resize2fs: Bad magic number in super-block while trying to open /dev/mmcblk1p1
Couldn't find valid filesystem superblock.

Formating disk...

Copying disk...
  1,814,408,560  98%    6.45MB/s    0:04:28 (xFailed to add #1 partition: No space left on device
  2,819,172,774  99%    3.41MB/s    0:13:09 (xfr#95798, to-chk=0/136557)

Configuring...

Cleanup...

Writing bootloader...
Writing u-boot-sunxi-with-spl
1020+1 records in
1020+1 records out
1044896 bytes (1.0 MB, 1020 KiB) copied, 0.249391 s, 4.2 MB/s
Writing u-boot-sunxi-with-spl
^[[Droot@a20-olinuxino:~# Failed to add #1 partition: No space left on device
-bash: Failed: command not found




LubOlimex

I just tested with same image and board and this doesn't happen here. It shouldn't be related to the software. Maybe try to manually erase the SPI and the eMMC and then boot from the SD card and run the script again. To erase eMMC and SPI do the following:

stop boot at start and in u-boot write:

sf probe

sf erase 0 200000

to erase eMMC, boot the board, login and type:

dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=100
Technical support and documentation manager at Olimex

IvanSB

After following your suggested procedure I still get this on 2 different boards.

Loading Environment from EXT4...
** Unable to use mmc 1:auto for loading the env **
Loading Environment from FAT... ** No device specified **
In:    serial
Out:   serial
Err:   serial
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
switch to partitions #0, OK
mmc1(part 0) is current device
** Unrecognized filesystem type **
Card did not respond to voltage select! : -110
scanning bus for devices...

It works fine from SD.

Latest minimal image.
Just boot from sd
olinuxino-sd-to-emmc
boot from emmc

thanks

LubOlimex

1. Can you show us a picture of the top of the two boards? Upload it to an image hosting web site and give us the link here.

2. How do you power the boards and what else do you have attached to them?
Technical support and documentation manager at Olimex

IvanSB

These are the images:

https://www.webthatworks.it/files/IMG_20220204_141208.jpg
https://www.webthatworks.it/files/IMG_20220204_141346.jpg

I'm powering the boards with a 5V 2A transformer that worked perfectly with another LIME2 bought several months ago.
Same microSD.

this is what I get running again olinuxino-sd-to-emmc

Detecting board...

Detecting the root device...
Root partition:        /dev/mmcblk0p1
Root device:            /dev/mmcblk0

Detecting eMMC device...
eMMC partition:        /dev/mmcblk1p1
eMMC device:            /dev/mmcblk1

Checking disk size...
Required blocks:        1558224
Available blocks:      30535680

Unmount target device...
umount: /dev/mmcblk1p1: not mounted.

Copying MBR record...
No free sectors available.
Failed to add #1 partition: No space left on device

Resizing partition...
lsblk: /dev/mmcblk1p1: not a block device
lsblk: /dev/mmcblk1p1: not a block device

Welcome to fdisk (util-linux 2.36.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x815eb4a1.

Command (m for help): No partition is defined yet!

Command (m for help): 1: unknown command

Command (m for help): Partition type
  p  primary (0 primary, 0 extended, 4 free)
  e  extended (container for logical partitions)
Select (default p): Partition number (1-4, default 1): First sector (2048-30535679, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-30535679, default 30535679):
Created a new partition 1 of type 'Linux' and of size 14.6 GiB.

Command (m for help): The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

e2fsck 1.46.2 (28-Feb-2021)
ext2fs_open2: Bad magic number in super-block
e2fsck: Superblock invalid, trying backup blocks...
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Block bitmap differences:  +(98304--99330) +(163840--164866) +(229376--230402) +(294912--295938) +(819200--820226) +(884736--885762)
Fix? yes

Free blocks count wrong for group #1 (31741, counted=1655).
Fix? yes

Free blocks count wrong for group #2 (32768, counted=12535).
Fix? yes

Free blocks count wrong for group #16 (24576, counted=24574).
Fix? yes

Free blocks count wrong for group #32 (24576, counted=23892).
Fix? yes

Free blocks count wrong for group #33 (32768, counted=0).
Fix? yes

Free blocks count wrong for group #34 (32768, counted=7032).
Fix? yes

Free blocks count wrong for group #35 (32768, counted=28066).
Fix? yes

Free blocks count wrong for group #48 (24576, counted=23601).
Fix? yes

Free blocks count wrong for group #50 (32768, counted=1219).
Fix? yes

Free blocks count wrong for group #64 (24576, counted=23720).
Fix? yes

Free blocks count wrong for group #65 (32768, counted=548).
Fix? yes

Free blocks count wrong for group #80 (24576, counted=24129).
Fix? yes

Free blocks count wrong for group #81 (31741, counted=16467).
Fix? yes

Free blocks count wrong for group #96 (24576, counted=24573).
Fix? yes

Free blocks count wrong (3730140, counted=3534605).
Fix? yes

Free inodes count wrong for group #0 (8149, counted=8145).
Fix? yes

Free inodes count wrong for group #16 (8160, counted=8158).
Fix? yes

Directories count wrong for group #16 (0, counted=2).
Fix? yes

Free inodes count wrong for group #32 (8160, counted=2206).
Fix? yes

Directories count wrong for group #32 (0, counted=670).
Fix? yes

Free inodes count wrong for group #48 (8160, counted=1).
Fix? yes

Directories count wrong for group #48 (0, counted=828).
Fix? yes

Free inodes count wrong for group #49 (8160, counted=7698).
Fix? yes

Directories count wrong for group #49 (0, counted=22).
Fix? yes

Free inodes count wrong for group #64 (8160, counted=2334).
Fix? yes

Directories count wrong for group #64 (0, counted=854).
Fix? yes

Free inodes count wrong for group #80 (8160, counted=0).
Fix? yes

Directories count wrong for group #80 (0, counted=418).
Fix? yes

Free inodes count wrong for group #81 (8160, counted=7505).
Fix? yes

Free inodes count wrong for group #96 (8160, counted=8157).
Fix? yes

Directories count wrong for group #96 (0, counted=3).
Fix? yes

Free inodes count wrong (954709, counted=925484).
Fix? yes

Padding at end of inode bitmap is not set. Fix? yes


/dev/mmcblk1p1: ***** FILE SYSTEM WAS MODIFIED *****
/dev/mmcblk1p1: 29236/954720 files (0.1% non-contiguous), 282099/3816704 blocks
resize2fs 1.46.2 (28-Feb-2021)
The filesystem is already 3816704 (4k) blocks long.  Nothing to do!


Formating disk...


First run didn't show the

No free sectors available.
Failed to add #1 partition: No space left on device

...

After rerunning

sf probe
SF: Detected w25q128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB
sf erase 0 200000
SF: 2097152 bytes @ 0x0 Erased: OK
dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=100

Detecting board...

Detecting the root device...
Root partition:        /dev/mmcblk0p1
Root device:            /dev/mmcblk0

Detecting eMMC device...
eMMC partition:        /dev/mmcblk1p1
eMMC device:            /dev/mmcblk1

Checking disk size...
Required blocks:        1558544
Available blocks:      30535680

Unmount target device...
umount: /dev/mmcblk1p1: not mounted.

Copying MBR record...
No free sectors available.
Failed to add #1 partition: No space left on device

Resizing partition...
lsblk: /dev/mmcblk1p1: not a block device
lsblk: /dev/mmcblk1p1: not a block device

Welcome to fdisk (util-linux 2.36.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x681a0e17.

Command (m for help): No partition is defined yet!

Command (m for help): 1: unknown command

Command (m for help): Partition type
  p  primary (0 primary, 0 extended, 4 free)
  e  extended (container for logical partitions)
Select (default p): Partition number (1-4, default 1): First sector (2048-30535679, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-30535679, default 30535679):
Created a new partition 1 of type 'Linux' and of size 14.6 GiB.

Command (m for help): The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

e2fsck 1.46.2 (28-Feb-2021)
ext2fs_open2: Bad magic number in super-block
e2fsck: Superblock invalid, trying backup blocks...
Superblock has an invalid journal (inode 8).
Clear? yes

*** journal has been deleted ***

Resize inode not valid.  Recreate? yes

Pass 1: Checking inodes, blocks, and sizes
Root inode is not a directory.  Clear? yes

Pass 2: Checking directory structure
Entry '..' in <2>/<130561> (130561) has deleted/unused inode 2.  Clear? yes

Entry '..' in <2>/<130562> (130562) has deleted/unused inode 2.  Clear? yes

Entry '..' in <2>/<261121> (261121) has deleted/unused inode 2.  Clear? yes

Entry '..' in <2>/<261122> (261122) has deleted/unused inode 2.  Clear? yes

Entry '..' in <2>/<261123> (261123) has deleted/unused inode 2.  Clear? yes

Entry '..' in <2>/<391681> (391681) has deleted/unused inode 2.  Clear? yes

Entry '..' in <2>/<391682> (391682) has deleted/unused inode 2.  Clear? yes

Entry '..' in <2>/<522241> (522241) has deleted/unused inode 2.  Clear? yes

Entry '..' in <2>/<522242> (522242) has deleted/unused inode 2.  Clear? yes

Entry '..' in <2>/<522243> (522243) has deleted/unused inode 2.  Clear? yes

Entry '..' in <2>/<652801> (652801) has deleted/unused inode 2.  Clear? yes

Entry '..' in <2>/<652802> (652802) has deleted/unused inode 2.  Clear? yes

Entry '..' in <2>/<783361> (783361) has deleted/unused inode 2.  Clear? yes

Entry '..' in <2>/<783362> (783362) has deleted/unused inode 2.  Clear? yes

Entry '..' in <2>/<783363> (783363) has deleted/unused inode 2.  Clear? yes

Pass 3: Checking directory connectivity
Root inode not allocated.  Allocate? yes

Unconnected directory inode 130561 (...)
Connect to /lost+found? yes

/lost+found not found.  Create? yes

Unconnected directory inode 130562 (...)
Connect to /lost+found? yes

Unconnected directory inode 261121 (...)
Connect to /lost+found? yes

Unconnected directory inode 261122 (...)
Connect to /lost+found? yes

Unconnected directory inode 261123 (...)
Connect to /lost+found? yes

Unconnected directory inode 391681 (...)
Connect to /lost+found? yes

Unconnected directory inode 391682 (...)
Connect to /lost+found? yes

Unconnected directory inode 522241 (...)
Connect to /lost+found? yes

Unconnected directory inode 522242 (...)
Connect to /lost+found? yes

Unconnected directory inode 522243 (...)
Connect to /lost+found? yes

Unconnected directory inode 652801 (...)
Connect to /lost+found? yes

Unconnected directory inode 652802 (...)
Connect to /lost+found? yes

Unconnected directory inode 783361 (...)
Connect to /lost+found? yes

Unconnected directory inode 783362 (...)
Connect to /lost+found? yes

Unconnected directory inode 783363 (...)
Connect to /lost+found? yes

Pass 4: Checking reference counts
Inode 130561 ref count is 3, should be 2.  Fix? yes

Inode 130562 ref count is 3, should be 2.  Fix? yes

Inode 261121 ref count is 3, should be 2.  Fix? yes

Inode 261122 ref count is 3, should be 2.  Fix? yes

Inode 261123 ref count is 12, should be 11.  Fix? yes

Inode 391681 ref count is 5, should be 4.  Fix? yes

Inode 391682 ref count is 3, should be 2.  Fix? yes

Inode 522241 ref count is 3, should be 2.  Fix? yes

Inode 522242 ref count is 3, should be 2.  Fix? yes

Inode 522243 ref count is 3, should be 2.  Fix? yes

Inode 652801 ref count is 3, should be 2.  Fix? yes

Inode 652802 ref count is 3, should be 2.  Fix? yes

Inode 783361 ref count is 75, should be 74.  Fix? yes

Inode 783362 ref count is 3, should be 2.  Fix? yes

Inode 783363 ref count is 3, should be 2.  Fix? yes

Pass 5: Checking group summary information
Block bitmap differences:  +(0--9218) +9221 +(32768--33794) +(33798--34786) +(34816--40813) +(40960--47103) +(98304--99330) +(163840--164866) +(229376--230402) +(294912--295938) +(819200--820226) )
Fix? yes

Free blocks count wrong for group #0 (23541, counted=23546).
Fix? yes

Free blocks count wrong for group #1 (31741, counted=18610).
Fix? yes

Free blocks count wrong for group #16 (24576, counted=24574).
Fix? yes

Free blocks count wrong for group #17 (32768, counted=30241).
Fix? yes

Free blocks count wrong for group #32 (24576, counted=24283).
Fix? yes

Free blocks count wrong for group #33 (32768, counted=6711).
Fix? yes

Free blocks count wrong for group #48 (24576, counted=24563).
Fix? yes

Free blocks count wrong for group #49 (15357, counted=31741).
Fix? yes

Free blocks count wrong for group #50 (32768, counted=32755).
Fix? yes

Free blocks count wrong for group #64 (24576, counted=24573).
Fix? yes

Free blocks count wrong for group #80 (24576, counted=24574).
Fix? yes

Free blocks count wrong for group #96 (24576, counted=24304).
Fix? yes

Free blocks count wrong for group #97 (32768, counted=32150).
Fix? yes

Free blocks count wrong (3730138, counted=3703596).
Fix? yes

Inode bitmap differences:  +1 +(3--10)
Fix? yes

Free inodes count wrong for group #0 (8148, counted=8149).
Fix? yes

Directories count wrong for group #0 (3, counted=2).
Fix? yes

Free inodes count wrong for group #16 (8160, counted=8149).
Fix? yes

Directories count wrong for group #16 (0, counted=2).
Fix? yes

Free inodes count wrong for group #32 (8160, counted=6596).
Fix? yes

Directories count wrong for group #32 (0, counted=285).
Fix? yes

Free inodes count wrong for group #48 (8160, counted=8134).
Fix? yes

Directories count wrong for group #48 (0, counted=13).
Fix? yes

Free inodes count wrong for group #64 (8160, counted=8157).
Fix? yes

Directories count wrong for group #64 (0, counted=3).
Fix? yes

Free inodes count wrong for group #80 (8160, counted=8158).
Fix? yes

Directories count wrong for group #80 (0, counted=2).
Fix? yes

Free inodes count wrong for group #96 (8160, counted=7139).
Fix? yes

Directories count wrong for group #96 (0, counted=177).
Fix? yes

Free inodes count wrong (954708, counted=952082).
Fix? yes

Padding at end of inode bitmap is not set. Fix? yes

Recreate journal? yes

Creating journal (16384 blocks):  Done.

*** journal has been regenerated ***

/dev/mmcblk1p1: ***** FILE SYSTEM WAS MODIFIED *****
/dev/mmcblk1p1: 2638/954720 files (0.2% non-contiguous), 129492/3816704 blocks
resize2fs 1.46.2 (28-Feb-2021)
The filesystem is already 3816704 (4k) blocks long.  Nothing to do!


Formating disk...


Boot without microSD

      scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc1(part 0) is current device
** Unrecognized filesystem type **
Card did not respond to voltage select! : -110
scanning bus for devices...
SATA link 0 timeout.
AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
flags: ncq stag pm led clo only pmp pio slum part ccc apst

[HERE IT TAKES A LONG TIME]


timeout exit!
....

Boot with microSD

      scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot/boot.scr



thanks

bboyadzhiev

Hi there!
I managed to setup a-sort-of stable eMMC install.

First, my last and unsuccessful attempt with the Olimex setup:
U-Boot SPL 2021.04+olimex-1-20211223.094223 (Dec 23 2021 - 09:43:25 +0000)
DRAM: 1024 MiB
CPU: 912000000Hz, AXI/AHB/APB: 3/2/2
Loading configuration from EEPROM: OK
Verifying data: OK
Trying to boot from sunxi SPI


U-Boot 2021.04+olimex-1-20211223.094223 (Dec 23 2021 - 09:43:25 +0000) Allwinner Technology

CPU:   Allwinner A20 (SUN7I)
ID:    A20-OLinuXino-LIME2-e16Gs16M Rev.L
SN:    0001EEEE
MAC:   30:1F:9A:D0:FF:42
I2C:   ready
DRAM:  1 GiB
SF: Detected w25q128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB
MMC:   mmc@1c0f000: 0, mmc@1c11000: 1
Loading Environment from EXT4... ** File not found /uboot.env **

** Unable to read "/uboot.env" from mmc1:1 **
Loading Environment from FAT... ** No device specified **
In:    serial
Out:   serial
Err:   serial
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
switch to partitions #0, OK
mmc1(part 0) is current device
Scanning mmc 1:1...
Found U-Boot script /boot.scr
2628 bytes read in 1 ms (2.5 MiB/s)
## Executing script at 43100000
Mainline u-boot / new-style environment detected.
5030400 bytes read in 280 ms (17.1 MiB/s)
Failed to load '/dtbs/5.10.0-10-armmp-lpae/sun7i-a20-olinuxino-micro.dtb'
SCRIPT FAILED: continuing...
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Card did not respond to voltage select! : -110
Scanning disk mmc@1c0f000.blk...
Disk mmc@1c0f000.blk not ready
Scanning disk mmc@1c11000.blk...
** Unrecognized filesystem type **
** Unrecognized filesystem type **
Found 4 disks
No EFI system partition
BootOrder not defined
EFI boot manager: Cannot load any image
Card did not respond to voltage select! : -110
scanning bus for devices...
SATA link 0 timeout.
AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
flags: ncq stag pm led clo only pmp pio slum part ccc apst
timeout exit!

Device 0: unknown device

I believe the problem is with the second stage of the u-boot, it just won't load from eMMC.

After many trials I finally installed the Debian stable release from scratch, combining the partition and firmware images.
In setup I used the eMMC, LVM mode for partitioning.

After this it still didn't boot from eMMC.
The first stage of u-boot was still using the U-Boot SPL 2021.04+olimex-1-20211223.094223, but still not loading from eMMC.

But I noticed that if I keep the install SD card in the slot and remove it quickly on power-up, then it successfully boots from eMMC! (But on reboot - no go!)

Then I prepared a small SD card I had around (512MB) with only the partition.img.
Now, as long as the SD card is in the slot, it boots without a problem!
Now first and second stage of u-boot are "2021.01+dfsg-5".

Here is the serial log:
U-Boot SPL 2021.01+dfsg-5 (May 23 2021 - 04:32:45 +0000)
DRAM: 1024 MiB
CPU: 912000000Hz, AXI/AHB/APB: 3/2/2
Trying to boot from MMC1




U-Boot 2021.01+dfsg-5 (May 23 2021 - 04:32:45 +0000) Allwinner Technology

CPU:   Allwinner A20 (SUN7I)
Model: Olimex A20-OLinuXino-LIME2-eMMC
I2C:   ready
DRAM:  1 GiB
MMC:   mmc@1c0f000: 0, mmc@1c11000: 1
Loading Environment from FAT... Unable to use mmc 1:1... In:    serial
Out:   serial
Err:   serial
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
unable to select a mode
switch to partitions #0, OK
mmc1(part 0) is current device
Scanning mmc 1:1...
Found U-Boot script /boot.scr
2628 bytes read in 1 ms (2.5 MiB/s)
## Executing script at 43100000
Mainline u-boot / new-style environment detected.
5030400 bytes read in 280 ms (17.1 MiB/s)
26587 bytes read in 3 ms (8.5 MiB/s)
32255438 bytes read in 1785 ms (17.2 MiB/s)
Booting Debian 5.10.0-10-armmp-lpae from mmc 1:1...
## Flattened Device Tree blob at 43000000
   Booting using the fdt blob at 0x43000000
EHCI failed to shut down host controller.
   Loading Ramdisk to 4813d000, end 49fffdce ... OK
   Loading Device Tree to 48133000, end 4813c7da ... OK

Starting kernel ...

Now, based on my limited knowledge on u-boot and linux, this is what I think is happening:
On power-on the board detects the SD card and boots the first stage from there, instead of the SPI memory and proceeds to eMMC second-stage boot.

I actually prefer this setup, as I can customize it and it has a lower RAM usage than the Olimex distribution ;D.
I plan on sticking with this one, works for a couple of weeks now without any problems so far!



LubOlimex

I think there is some issue with eMMC memory. If you want to check - boot Linux from the SD card and run some tests. Maybe it can be fixed by software means.
Technical support and documentation manager at Olimex

IvanSB

I connected to a previously configured LIME2 that doesn't have this problem to see if there were any differences.

I'm not planning to re-run olinuxino-sd-to-emmc on that board to see if it's an hardware problem or a software problem but during the lifetime of that board these seems to be the relevant packages that were updated:

olinuxino-overlays
u-boot-olinuxino
u-boot-tools-olinuxino
olinuxino-tools

olinuxino-tools contains olinuxino-sd-to-emmc

I've been trying to track down any interesting commit to these packages but I haven't been able to find anything relevant but judging by the errors of the script I'd guess some binary (sfdisk?) changed interface and the script can't perform as expected or the script find an unexpected status of the emmc and misbehave

Even after removing manually any partition from the device and dd as suggested by @LubOlimex I get:

Copying MBR record...
No free sectors available.
Failed to add #1 partition: No space left on device

...

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x9bae6ce6.

Command (m for help): No partition is defined yet!

Command (m for help): 1: unknown command

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

...

e2fsck 1.46.5 (30-Dec-2021)
ext2fs_open2: Bad magic number in super-block
e2fsck: Superblock invalid, trying backup blocks...
Superblock has an invalid journal (inode 8).
Clear? yes

*** journal has been deleted ***

Resize inode not valid.  Recreate? yes

and other errors.

BTW @LubOlimex which kind of tests should we run to check?
I ran
mmc extcsd read /dev/mmcblk1
and I couldn't spot anything that could put me in the right direction to solve the problem



thanks

LubOlimex

I meant something to check for bad blocks. Usually mmc-utils. Boot from card, identify what device is the eMMC, and run mmc-utils.

You can also try something like badblocks or e2fsck or fsck on the eMMC. But mmc-utils is usually what reports the health of the eMMC.
Technical support and documentation manager at Olimex

IvanSB

I did a

mmc extcsd read /dev/mmcblk1

on a working/not working emmc and they are the same

creating partition manually does work.
creating an ext4 fs works
e2fsck -fv /dev/mmcblk1p1 doesn't report any error
copying /usr in the newly created partition doesn't report any error
running again e2fsck doesn't report any problem

After rebooting the /usr copy is still where I expect it to be.

There is something that goes wrong in the olinuxino-sd-to-emmc or u-boot.
Probably the latter.

After creating the partition manually, formatting etc... I re-run olimexino-sd-to-emmc, booted from sd... and...

mount /dev/mmcblk1p1 ./m/
mount: /root/m: wrong fs type, bad option, bad superblock on /dev/mmcblk1p1, missing codepage or helper program, or other error.

and booting without the sd

Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc1(part 0) is current device
** Unrecognized filesystem type **
Card did not respond to voltage select! : -110

So there seems to be something wrong with the olinuxino-sd-to-emmc script.



IvanSB

@LubOlimex

Nearly got it...

fdisk manually, mkfs manually, rsync manually
just
u-boot-install /dev/mtd0

#### HERE #########################
but I DIDN'T

u-boot-install /dev/mmcblk1
###################################

I can boot from emmc but

Begin: Running /scripts/local-bottom ... done.
Begin: Running /scripts/init-bottom ... mount: mounting /dev on /root/dev failed: No such file or directory
mount: mounting /dev on /root/dev failed: No such file or directory
done.
mount: mounting /sys on /root/sys failed: No such file or directory
mount: mounting [    4.618987] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000100

I think I can fix this too. Probably didn't rsync correctly or didn't edit fstab manually...

Still there is something wrong in the olinuxino-sd-to-emmc or u-boot

thanks

IvanSB

GOT it working.

I fixed some minor error in the rsync parameters I used and manually edited fstab and I got it working.

u-boot-install /dev/mmcblk1

mangle the ext4 partition, so something has to be fixed in the olimexino-sd-to-emmc script or in u-boot-install

It'd be nice if it can be fixed in the package.

thanks

LubOlimex

Thanks for the contribution, we will investigate. It is interesting how this situation occurred at all, it is not something that we have observed here happing. Maybe it is related to something else like interruption of script executing or sudden power down or some other specific event that might have corrupted the file system in specific way.
Technical support and documentation manager at Olimex