USB-Ethernet with latest Debian build

Hi @foxen,

Below is detailed steps what I tried at my side:

  • Step 1: Power off board and change the switch to recovery mode (switch 1 & 2 to ON state and switch 3 to OFF state)

  • Step 2: Power on board and the board enters recovery mode, so cannot see any output in the console

  • Step 3: Use the script ‘recovery-flash-uefi-prebuilt.sh’ with the command:

sudo ./recovery-flash-uefi-prebuilt.sh -d -t /dev/ttyUSB3 -v 95

On my PC, the USB node is /dev/ttyUSB3; and please note now the latest release is broken so I rollback to use build 95 with debug version.

  • Step 4: The script hikey_idt downloads binaries into SRAM:
Running hikey_idt...
Config name: config
Port name: /dev/ttyUSB3
0: Image: hisi-sec_usb_xloader.img Downalod Address: 0x20000
1: Image: hisi-sec_uce_boot.img Downalod Address: 0x6a908000
2: Image: recovery.bin Downalod Address: 0x1ac00000
Serial port open successfully!
Start downloading hisi-sec_usb_xloader.img@0x20000...
file total size 99584
downlaod address 0x20000
Finish downloading
Start downloading hisi-sec_uce_boot.img@0x6a908000...
file total size 23680
downlaod address 0x6a908000
Finish downloading
Start downloading recovery.bin@0x1ac00000...
file total size 1179648
downlaod address 0x1ac00000
Finish downloading
Sleeping till device resets... zzz
  • Step 5: On the console, press f so let the board enter into fastboot mode. Since you didn’t press f thus the system booted Linux kernel.

  • Step 6: On the window for running script recovery-flash-uefi-prebuilt.sh, it will output logs as below:

target reported max download size of 134217728 bytes
sending 'ptable' (24 KB)...
OKAY [  0.008s]
writing 'ptable'...
OKAY [  0.003s]
finished. total time: 0.011s
target reported max download size of 134217728 bytes
sending 'xloader' (151 KB)...
OKAY [  0.010s]
writing 'xloader'...
OKAY [  0.011s]
finished. total time: 0.021s
target reported max download size of 134217728 bytes
sending 'fastboot' (25 KB)...
OKAY [  0.008s]
writing 'fastboot'...
OKAY [  0.053s]
finished. total time: 0.061s
target reported max download size of 134217728 bytes
sending 'fip' (1482 KB)...
OKAY [  0.063s]
writing 'fip'...
OKAY [  0.062s]
finished. total time: 0.125s
  • Step 7: Don’t reboot the board, directly flash boot and rootFS images:
sudo fastboot flash boot boot-linaro-stretch-developer-hikey-20190822-37.img                                                                                           
sudo fastboot flash system rootfs-linaro-stretch-developer-hikey-20190822-37.img                                                                                       
  • Step 8: Power off the board, change switch to normal mode (set switch 1 to ON and switch 2 & 3 to OFF state); power on the board again.

  • Step 9: After the sytem boot up, use modprobe to insmod module:

root@linaro-developer:~# modprobe mcs7830
root@linaro-developer:~# lsmod
Module                  Size  Used by
mcs7830                16384  0

Hi @leo-yan,

Trying to access Fastboot by pressing f does not appear to do anything for me. Scrolling down to the option and hitting enter gives:

error: no such device: boot.
error: no server is specified.

Press any key to continue...

I think I may have broken something while trying the earlier recommendations.

You need to press F in the short time, especially after the string “UEFI firmware (version Alpha built at 00:59:22 on May 17 2019)”. Otherwise, after timeout (three seconds?), it will continue to run and you might see the logs for “error: no such device: boot.”.

Hi @leo-yan,

Thanks, hitting the F key earlier worked for getting the image to flash. However, trying to use modprobe gives me:

root@linaro-developer:~# modprobe mcs7830
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.
14.0-rc7-linaro-hikey960+/modules.dep.bin'
modprobe: FATAL: Module mcs7830 not found in directory /lib/modules/4.14.0-rc7-linaro-hikey960+

Yeah, we come back to the original issue :slight_smile:

How about below steps when board is in fastboot mode (Or press F after UEFI booting)?

$ sudo fastboot erase system                      
$ sudo fastboot erase userdata                    

$ sudo fastboot flash system rootfs-linaro-stretch-developer-hikey-20190822-37.img                                                                                       

Hi @leo-yan,

This worked, thank you. I think that erasing the userdata must have been required.

I will mark your answer as the solution.

You are welcome! and thanks a lot for reporting back.

This means there has potential bug in UEFI; if both ‘userdata’ and ‘system’ partitions flash root FS images, it will by default load kernel images from ‘userdata’ partition rather than ‘system’ partition.

If wrongly flash an old root.img into ‘userdata’ partition, later UEFI will load kernel images from ‘userdata’ partition but it boots rootFS from ‘system’ partition based on kernel command line. So the kernel version and modules version cannot match with each other.

Updated: I tried to flash another rootFS image into ‘userdata’ partition, and I can confirm the UEFI will load kernel image from ‘userdata’ partition rather than ‘system’ partition.