Ubuntu-core-image

hi,

We build the ubuntu-core-image.img (kernel, gadget… snaps) and dd to the sdcard. After the first boot “run reflash_ubuntu” to flash it to the board.

Once i use this sdcard to one board, i cannot use the same sdcard to flash the image to another board. i need to do dd again the .img and use it.

Is it possible to use the same sdcard to flash the same image to multiple boards? Everytime i use this sdcard it should go to uboot prompt, so that i can use “run reflash_ubuntu” to flash it to the boards.

regards,
vinaysimha

This is a question for @ondra to answer, he wrote that feature for the dragonboard (iirc we mark the card as “having been used” so if you forget to pull it out before reboot you dont accidentially end up booting from the wrong device)

@ogra is right once we boot we mark that SD card as used. uboot will determine what is boot device and stores it. Once value is stored, refresh is disabled, this is to prevent flashing image to emmc which would try to boot from SD…
You can try following:
once you interrupt boot into shell

setenv load_device “”

saveenv

run reflash_ubuntu

Now power off, don’t continue boot!
Just make sure you never continue boot from SD card, this would produce unpredictable image in emmc!

@ondra ,
We want to use single sdcard to flash many boards.

if we try the above step you had mentioned, i cannot use the same sdcard to flash multiple boards.

U-Boot 2017.05-00003-g7f85a2a (Jan 05 2018 - 11:39:55 +0530)
Qualcomm-DragonBoard 410C

DRAM:  986 MiB
MMC:   sdhci@07824000: 0, sdhci@07864000: 1
reading uboot.env
In:    serial@78b0000
Out:   serial@78b0000
Err:   serial@78b0000
Net:   Net Initialization Skipped
No ethernet found.
Hit any key to stop autoboot:  0 
ENVCMD
** Bad device specification mmc “” **
** Bad device specification mmc “” **
** Bad device specification mmc “” **
Bad Linux ARM64 Image magic!
dragonboard410c => run reflash_ubuntu
Aborted!! use fresh sdcard image
dragonboard410c => 

Instead of hitting any key to stop autoboot, is it possible to set by default to boot the sdcard into dragonbaoard410c prompt , so that we can run reflash_ubuntu and use the same sdcard to flash the images to multiple boards.

enabled the below configs/dragonboard410c_defconfig in u-boot, to get the prompt rather than entering the keyboard, but it did not work.
+CONFIG_AUTOBOOT_KEYED=y
+CONFIG_BOOTDELAY=30
+CONFIG_MENU_SHOW

please suggest,

Instead of hitting any key to stop autoboot, is it possible to set by default to boot the sdcard into dragonbaoard410c prompt , so that we can run reflash_ubuntu and use the same sdcard to flash the images to multiple boards.

enabled the below configs/dragonboard410c_defconfig in u-boot, to get the prompt rather than entering the keyboard, but it did not work.
+CONFIG_AUTOBOOT_KEYED=y
+CONFIG_BOOTDELAY=30
+CONFIG_MENU_SHOW

Hi I am struggling to flash the ubuntu core image to the dragonboard emmc. My main challenge is that I never see the u-boot on the serial port console with the option to stop and get to the u-boot prompt. The first text that appears on the serial console takes me to the configuration options

Any info on how to stop u-boot or how to flash ubuntu core to the emmc will be appreciated.

Lee

Lee,

dd if=ubuntu-core-image-63b0-87.img of=/dev/mmcblk1 bs=32M

It should be dd to sdcard and it will flash to the emmc.

Hi Vinay

Thanks, I have followed that (used both dd and etcher to image the SD card) and the SD card boots, and takes me to the ubuntu core config. However what is the step/command to get the image onto the eMMC. The dragonbaord already has (shipped from the factory) with Android.

Once console conf shows on the screen, I do the configuration but dont get any options to flash to eMMC.

Lee

Lee,

Insert the sdcard to db410c after dd from host machine.

Change the switch settings of db410c to boot to SD card mode.

After the boot, In the debug uart dragonboard410c => run reflash_ubuntu

On next boot connect ethernet to configure the ubuntu core

regards, vinaysimha

Hi Vinay

This is the part that I have the problem with After the boot, In the debug uart dragonboard410c => run reflash_ubuntu.

My boot never lets me interrupt so I can get to the dragonboard410c =>

The uart stays blank until the following comes up 000uV [ 7.354504] l14: supplied by regulator-dummy [ 7.363448] l15: Bringing 0uV into 1750000-1750000uV [ 7.364154] l15: supplied by regulator-dummy [ 7.372652] l16: Bringing 0uV into 1750000-1750000uV [ 7.372851] l16: supplied by regulator-dummy [ 7.381851] l17: Bringing 0uV into 3300000-3300000uV [ 7.382059] l17: supplied by regulator-dummy [ 7.391053] l18: Bringing 0uV into 1750000-1750000uV [ 7.391244] l18: supplied by regulator-dummy [ 7.462485] mmc0: SDHCI controller on 7824900.sdhci [7824900.sdhci] using ADMA 64-bit [ 7.463622] sdhci_msm 7864900.sdhci: Got CD GPIO [ 7.523808] mmc1: SDHCI controller on 7864900.sdhci [7864900.sdhci] using ADMA 64-bit [ 7.528585] mmc0: new HS200 MMC card at address 0001 [ 7.531386] mmcblk0: mmc0:0001 EH8EE8 7.13 GiB [ 7.536731] mmcblk0boot0: mmc0:0001 EH8EE8 partition 1 4.00 MiB [ 7.540410] mmcblk0boot1: mmc0:0001 EH8EE8 partition 2 4.00 MiB [ 7.546081] mmcblk0rpmb: mmc0:0001 EH8EE8 partition 3 4.00 MiB, chardev (244:0) [ 7.558945] mmcblk0: p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 [ 7.606454] random: fast init done . . . .

press enter to configure

How to get to dragonboard410c =>

Do I need to edit the u-boot env file. Bootdelay =0

Lee

The image you build may have some issue, try to build the emmc flashable image. If on the first time sdcard booted and run reflash_ubuntu not runt, it will boot directly from sdcard always. Try to do dd the image to sdcard and recheck again.

Just tried the latest ubuntu core 18 image from https://ubuntu.com/download/qualcomm-dragonboard-410c

flashed the image and same effect - no u-boot on the serial console. No way to interrupt the u-boot process. After ~7sec the SD card boots into ubuntu and takes me to the config console.

Is there an issue with U-boot in the ubuntu core image? @ondra

Try to build the ubuntu core image and check if core18 image not working, try if older image is available.

Recheck rx,tx working fine with the db410c and the uart debugger used.

I managed to finally interrupt the u-boot. Issue was my UART to USB connection.

Does the emmc flash usually take a long time - its been busy for about 1hr now?

Hi Vinay

Still need some help please. I managed to stop interrupt the u-boot and run reflash_ubuntu. Results are as follows:

U-Boot 2019.07-dirty (Mar 24 2022 - 14:28:19 +0200) Qualcomm-DragonBoard 410C

DRAM: 986 MiB MMC: sdhci@07824000: 0, sdhci@07864000: 1 Loading Environment from FAT… OK In: serial@78b0000 Out: serial@78b0000 Err: serial@78b0000 Net: Net Initialization Skipped No ethernet found. Hit any key to stop autoboot: 10 9 0 dragonboard410c => run reflash_ubuntu starting USB… Bus ehci@78d9000: USB EHCI 1.00 scanning bus ehci@78d9000 for devices… 2 USB Device(s) found scanning usb for storage devices… 0 Storage Device(s) found scanning usb for ethernet devices… 0 Ethernet Device(s) found stopping USB… switch to partitions #0, OK mmc1 is current device switch to partitions #0, OK mmc0(part 0) is current device 34304 bytes read in 30 ms (1.1 MiB/s)

MMC write: dev # 0, block # 0, count 67 … 67 blocks written: OK 258568 bytes read in 61 ms (4 MiB/s)

MMC write: dev # 0, block # 34, count 4 … 4 blocks written: OK 154804 bytes read in 42 ms (3.5 MiB/s)

MMC write: dev # 0, block # 38, count 2048 … 2048 blocks written: OK 605312 bytes read in 83 ms (7 MiB/s)

MMC write: dev # 0, block # 2086, count 2048 … 2048 blocks written: OK 61440 bytes read in 30 ms (2 MiB/s)

MMC write: dev # 0, block # 4134, count 2048 … 2048 blocks written: OK

MMC write: dev # 0, block # 6182, count 2048 … 2048 blocks written: OK 545956 bytes read in 77 ms (6.8 MiB/s)

MMC write: dev # 0, block # 10240, count 2048 … 2048 blocks written: OK 569344 bytes read in 88 ms (6.2 MiB/s)

MMC write: dev # 0, block # 12288, count 4096 … 4096 blocks written: OK blobs reflash completed r_start=4800 w_start=4000 size=40000 part 8 replicated r_start=44800 w_start=4800 size=dd788 part 9 replicated r_start=44800 w_start=4800 size=dd788 part a replicated r_start=44800 w_start=4800 size=dd788 part b replicated r_start=44800 w_start=4800 size=dd788 part c replicated r_start=44800 w_start=4800 size=dd788 part d replicated r_start=44800

The serial console continues with r_start=44800 w_start=4800 size=dd788 part d replicated etc etc

and doesnt seem to end (it ran for >8 hrs).

When I reboot without the SD-CARD the dragonboard doesnt boot up… no uboot etc.

I reimaged the SD CARD and redid the run reflash_ubuntu, same situation

Any information on what might be going on?

Thanks Lee

Try with a good class10 or better performance sdcard and recheck. Connect the ethernet when reflash_ubuntu is executed.

Ok thanks. Do you recall which ubuntu core image and gadget you used?

I retried with the latest ubuntu core image (https://cdimage.ubuntu.com/ubuntu-core/18/stable/current/ubuntu-core-18-arm64+snapdragon.img.xz?_ga=2.12016445.80341438.1648389440-653618935.1644904518)

I had used this snappy/ubuntu core on 2018

version after boot - Welcome to Ubuntu Core 16 (GNU/Linux 4.4.97 aarch64)

git://kernel.ubuntu.com/ubuntu/ubuntu-xenial.git git id : Ubuntu-snapdragon-4.4.0-1087.92

git id : 6f3b56eec425ebf8f42b4faf7781f7ca50636cc1

We had create our custom ubuntu-core-image-xx-8 .img by xenial and gadget.

check with @ondra @ogra for latest releases or any issues.

Sorry Vinay but I need to find out what the serial console displays after the run reflash_ubuntu command:

Is this the expected output as below:

starting USB… Bus ehci@78d9000: USB EHCI 1.00 scanning bus ehci@78d9000 for devices… 2 USB Device(s) found scanning usb for storage devices… 0 Storage Device(s) found scanning usb for ethernet devices… 0 Ethernet Device(s) found stopping USB… switch to partitions #0, OK mmc1 is current device switch to partitions #0, OK mmc0(part 0) is current device 34304 bytes read in 30 ms (1.1 MiB/s)

MMC write: dev # 0, block # 0, count 67 … 67 blocks written: OK 258568 bytes read in 61 ms (4 MiB/s)

MMC write: dev # 0, block # 34, count 4 … 4 blocks written: OK 154804 bytes read in 42 ms (3.5 MiB/s)

MMC write: dev # 0, block # 38, count 2048 … 2048 blocks written: OK 605312 bytes read in 83 ms (7 MiB/s)

MMC write: dev # 0, block # 2086, count 2048 … 2048 blocks written: OK 61440 bytes read in 30 ms (2 MiB/s)

MMC write: dev # 0, block # 4134, count 2048 … 2048 blocks written: OK

MMC write: dev # 0, block # 6182, count 2048 … 2048 blocks written: OK 545956 bytes read in 77 ms (6.8 MiB/s)

MMC write: dev # 0, block # 10240, count 2048 … 2048 blocks written: OK 569344 bytes read in 88 ms (6.2 MiB/s)

MMC write: dev # 0, block # 12288, count 4096 … 4096 blocks written: OK blobs reflash completed r_start=4800 w_start=4000 size=40000 part 8 replicated r_start=44800 w_start=4800 size=dd788 part 9 replicated r_start=44800 w_start=4800 size=dd788 part a replicated r_start=44800 w_start=4800 size=dd788 part b replicated r_start=44800 w_start=4800 size=dd788 etc etc etc