Post flash of ubuntu fails

I just got my Zero today, and spent this evening working to start it up. Mostly, all the operations appear to work, but I can’t get ubuntu to boot. I can run the erase, the rz-udisk-loader.bin, and use etcher to write the image. That all works. I have my serial console running so I can see each operation, not report and error, and run the correct commands. But I cannot get it to boot from emmc once Etcher is done. The closest I got was t unplug it for about 60 seconds, at which point it did actually boot Linux, but then rebooted and went back to this state. I have run the erase, udisk, etcher 4 times now, always with the same results.

See below for a full dump from minicom after an erase and reload of the latest Ubuntu image from the wiki (radxa-zero-ubuntu-focal-server-arm64-20220401-0338-mbr.img, checksum matched). @RadxaYuntian, I suspect this is either a broken bootloader, or something is wrong with the HW. I can’t seem to fix the bootloader though, and I have been through the troubleshooting wiki a few times. I expect I did something I can’t remember, and that caused all of this trouble. However, I haven’t found a solution, and my meager uboot skill isn’t helping me out here.

=> ls mmc 2
            extlinux/
     3188   boot.cmd
     3260   boot.scr
            dtbs/
      383   uEnv.txt
   226556   config-5.10.69-11-amlogic-g57a25a2f2f47
 25166336   vmlinuz-5.10.69-11-amlogic-g57a25a2f2f47
  4935080   System.map-5.10.69-11-amlogic-g57a25a2f2f47
 16542361   initrd.img-5.10.69-11-amlogic-g57a25a2f2f47

7 file(s), 2 dir(s)
\G12A:BL:0253b8:61aa2d;FEAT:E0F83180:2000;POC:F;RCY:0;EMMC:0;READ:0;0.0
                                                                       l2_stage_init 0x01
bl2_stage_init 0x81
hw id: 0x0001 - pwm id 0x00
bl2_stage_init 0xc0
bl2_stage_init 0x02

L0:00000000
L1:00000703
L2:00008067
L3:04000000
S1:00000000
B2:00002000
B1:e0f83180

TE: 205104

BL2 Built : 15:21:48, Aug 28 2019. g12a g1bf2b53 - luan.yuan@droid15-sz

Board ID = 2
Set cpu clk to 24M
Set clk81 to 24M
CPU clk: 1200 MHz
Set clk81 to 166.6M
eMMC boot @ 0
sw8 s
DDR driver_vesion: LPDDR4_PHY_V_0_1_18 build time: Aug 28 2019 15:21:45
board id: 2
Load FIP HDR from eMMC, src: 0x00010200, des: 0xfffd0000, size: 0x00004000, part: 0
fw parse done
Load ddrfw from eMMC, src: 0x00060200, des: 0xfffd0000, size: 0x0000c000, part: 0
Load ddrfw from eMMC, src: 0x00038200, des: 0xfffd0000, size: 0x00004000, part: 0
PIEI prepare done
fastboot data load
00000000
emmc switch 1 ok
00000000
emmc switch 2 ok
fastboot data verify
verify result: 265
Cfg max: 2, cur: 1. Board id: 255. Force loop cfg
LPDDR4 probe
ddr clk to 792MHz
Load ddrfw from eMMC, src: 0x0003c200, des: 0xfffd0000, size: 0x0000c000, part: 0
00000000
emmc switch 0 ok

dmc_version 0000
Check phy result
INFO : ERROR : Training has failed!
1D training failed
Cfg max: 2, cur: 2. Board id: 255. Force loop cfg
LPDDR4 probe
ddr clk to 792MHz
Load ddrfw from eMMC, src: 0x0003c200, des: 0xfffd0000, size: 0x0000c000, part: 0

dmc_version 0000
Check phy result
INFO : End of CA training
INFO : End of initialization
INFO : Training has run successfully!
Check phy result
INFO : End of initialization
INFO : End of read enable training
INFO : End of fine write leveling
INFO : End of Write leveling coarse delay
INFO : Training has run successfully!
Check phy result
INFO : End of initialization
INFO : End of read dq deskew training
INFO : End of MPR read delay center optimization
INFO : End of write delay center optimization
INFO : End of read delay center optimization
INFO : End of max read latency training
INFO : Training has run successfully!
1D training succeed
Load ddrfw from eMMC, src: 0x00048200, des: 0xfffd0000, size: 0x0000c000, part: 0
Check phy result
INFO : End of initialization
INFO : End of 2D read delay Voltage center optimization
INFO : End of 2D read delay Voltage center optimization
INFO : End of 2D write delay Voltage center optimization
INFO : End of 2D write delay Voltage center optimization
INFO : Training has run successfully!

channel==0
RxClkDly_Margin_A0==256 ps 13
TxDqDly_Margin_A0==256 ps 13
RxClkDly_Margin_A1==0 ps 0
TxDqDly_Margin_A1==0 ps 0
TrainedVREFDQ_A0==75
TrainedVREFDQ_A1==0
VrefDac_Margin_A0==32
DeviceVref_Margin_A0==39
VrefDac_Margin_A1==0
DeviceVref_Margin_A1==0


channel==1
RxClkDly_Margin_A0==236 ps 12
TxDqDly_Margin_A0==256 ps 13
RxClkDly_Margin_A1==0 ps 0
TxDqDly_Margin_A1==0 ps 0
TrainedVREFDQ_A0==75
TrainedVREFDQ_A1==0
VrefDac_Margin_A0==30
DeviceVref_Margin_A0==39
VrefDac_Margin_A1==0
DeviceVref_Margin_A1==0

 dwc_ddrphy_apb_wr((0<<20)|(2<<16)|(0<<12)|(0xb0):0004 

soc_vref_reg_value 0x 0000001c 0000001e 0000001c 0000001c 0000001c 0000001c 0000001b 0000001e 0000001d 0000001e 0000001b 0000001b 0000001a 0000001c 00000017
2D training succeed
aml_ddr_fw_vesion: LPDDR4_PHY_V_0_1_18 build time: Aug 28 2019 13:53:31
auto size-- 65535DDR cs0 size: 2048MB
DDR cs1 size: 0MB
DMC_DDR_CTRL: 00c0002cDDR size: 2048MB
cs0 DataBus test pass
cs0 AddrBus test pass

100bdlr_step_size ps== 478
result report
boot times 0Enable ddr reg access
00000000
emmc switch 3 ok
Authentication key not yet programmed
get rpmb counter error 0x00000007
00000000
emmc switch 0 ok
Load FIP HDR from eMMC, src: 0x00010200, des: 0x01700000, size: 0x00004000, part: 0
Load BL3X from eMMC, src: 0x0006c200, des: 0x0175c000, size: 0x000ec000, part: 0
bl2z: ptr: 05129330, size: 00001e40
0.0;M3 CHK:0;cm4_sp_mode 0
MVN_1=0x00000000
MVN_2=0x00000000
[Image: g12a_v1.1.3390-6ac5299 2019-09-26 14:09:46 luan.yuan@droid15-sz]
OPS=0x30
ring efuse init
28 0b 30 00 01 2e 35 00 00 09 38 38 34 55 30 50 
[0.017150 Inits done]
secure task start!
high task start!
low task start!
run into bl31
NOTICE:  BL31: v1.3(release):4fc40b1
NOTICE:  BL31: Built : 15:57:33, May 22 2019
NOTICE:  BL31: G12A normal boot!
ERROR:   Error initializing runtime service opteed_fast


U-Boot 2021.07-24129-g105a2deb65 (Dec 14 2021 - 14:20:39 +0800) radxa-zero

Model: Radxa Zero
SoC:   Amlogic Meson G12A (S905Y2) Revision 28:b (30:2)
DRAM:  2 GiB
MMC:   sd@ffe03000: 0, sd@ffe05000: 1, mmc@ffe07000: 2
Loading Environment from nowhere... OK
In:    serial
Out:   serial
Err:   serial
Net:   Net Initialization Skipped
No ethernet found.
Hit any key to stop autoboot:  0 
Card did not respond to voltage select! : -110
Card did not respond to voltage select! : -110
switch to partitions #0, OK
mmc2(part 0) is current device
** No partition table - mmc 2 **
Couldn't find partition mmc 2:1
starting USB...
Bus usb@ff500000: Register 3000140 NbrPorts 3
Starting the controller
USB XHCI 1.10
scanning bus usb@ff500000 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

Device 0: unknown device
No ethernet found.
missing environment variable: pxeuuid
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm-meson-u200
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm-meson
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default
No ethernet found.
Config file not found
No ethernet found.
No ethernet found.
=> mmc list
sd@ffe03000: 0
sd@ffe05000: 1
mmc@ffe07000: 2 (eMMC)
=> mmc dev 1
Card did not respond to voltage select! : -110
=> mmc dev 2
switch to partitions #0, OK
mmc2(part 0) is current device

The first reboot is entirely normal. If it failed in that screen just unplug and let it rest for a while, and then try plug it back in. It should work fine afterwards.

I unplugged and let it sit overnight, no change in behavior. I have flashed and let sit unplugged now a few times, and no change in behavior. It has only ever actually started Linux one time, but after the reboot, it went back to not working.

Now I see this when I run the emmc bin before using etcher.

[949744.448817] usb 3-2: USB disconnect, device number 53
[949744.468773] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[949744.468860] sd 0:0:0:0: [sda] Synchronize Cache(10) failed: Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK

And of course Etcher never sees the device.

I’ve tested with a few more images, and longer delays completely powered down. Debian actually boots after the flash, but only once, and never again after that first boot. Otherwise, no luck, and the board does not run.

Last update, but this was frustrating. After many attempts, I got Debian running on EMMC consistently. I don’t know that I did anything interesting, but something changed. Now it seems to reboot consistently and come back up connected to WiFi.

Is it possible that the extra 3 pin UART to TX/RX/GND has an effect on how the device remains powered and resets? I had consistently connected a USB serial device to help me debug, and am wondering if that’s doing something to make this worse?

Will there be similar issues with the Zero 2? I am looking forward to using that when available as a replacement for this as it has the external antenna which is a critical point in my design (Zero sized, emmc, and external WiFi antenna to work outdoors).

I’d like to know more about why it was so difficult to get either distro running? I don’t need X, so I’m disabling that in this image, and space isn’t a real problem, so I don’t care. I would rather run Ubuntu honestly, but Debian should work almost as well (package version issues). It just feels like there is something about this board that makes boot finicky in a way that hasn’t been explained that I can find, other than completely power down for a while.

Zero 2 will be bigger and more expensive than Zero. As for external antenna there should be some models of Zero with that option.

I have an sample of Zero that also have eMMC issues. Unfortunately I haven’t been able to pinpoint what the problem is on this specific board. I have a feeling that there might be some initializing issue in U-Boot script but don’t have enough time to test my hypothesis.