Jump to content

armbian on Compulab Utilite Pro ?


Zibc

Recommended Posts

Hello everyone,

 

Over the past year or so, I've been getting back to my utilite pro board that bought quite a while back.

After asking a few things to Compulab, and figuring out some of the bad download links to get their latest resources, I could finally upgrade to their latest Ubuntu build, that was based on 12.04.

So not so recent. I am not the most aware user when it comes to arm devices, but a page on the Debian wiki pointed out to running buster on the board.

 

Then, I came across the armbian ecosystem, and thought, well, I'll give it a try. Kudos to the work done. This looks impressive.

 

The past days I've been trying to compile an image, just to see if it would succeed. That is without luck so far.

What I've done is pulling the armbian:build docker image, started it and ran the compile.sh script. I go through the wizard, and things start, but at some point, I get greeted with a chroot error and the process then stops.

I am not sure what is causing this, so I thought I would ask.

 

Some other questions: my goal would be to try making a config that boot on the Utilite Pro. from the Linux kernel source, I see stuff related to the utilite-pro, so I have good hope that something is possible, and same story for the u-boot.

I understood that easiest way to get to this is to start from an existing board, and adapting the configuration. Ok, that sounds like something i could do and potentially succeed at.

 

What I do not understand until know is what I should change in the config file to specifically point at the utilite setup from u-boot and the linux kernel (like the right dts/dtb files).

 

I also face some interesting challenges: it seems like I can't get the serial connection to work for some reasons, so it is not very straightforward to get very meaningful hints from u-boot. I could get the u-boot output from HDMI and type commands in it via a hdmi capture card. so I can record what's going on on boot, but more than this is ... complicated if not impossible.

 

So I am hoping somebody could point me in the right directions since I am willing to spend a bit of time trying this out.

 

Thanks for reading!

I hope I can get something useful from that device.

Link to comment
Share on other sites

Hello everyone,

 

I've been playing with the docker build script for about two weeks now.

I am now able to build images. At least I had a few successful builds. (buster, with desktop)

It seems like I can't build kernel above v5.10 because "gmp.h" is missing. I have no clue how to fix that. I thought it would be built-in the cross-compilation tools, but maybe I am wrong.

 

I could compile kernel v5.4, so I am working with that at the moment.

 

I also figured out that my board does not seem to load u-boot from the sd-card.

So I am questioning whether or not u-boot was included in the image built, or if I had to dump it myself onto the sd card ?

 

I also understood how the u-boot now present on my utilite works, and was able to make a boot script that loads the zImage abd dtb file.

When this goes, I see u-boot loading the dtb and kernel into memory, but then, only a black screen unfortunately.

All I get from, u-boot is:

 

Kernel image @ 0x10800000 [ 0x000000 - 0x959598 ]

## Flattened DEvice Tree Blob at 11000000

Booting using the fdt blob at 0x11000000

Loading device tree to 187f3000, end 187ffebd ... OK

 

I am not sure where I should look into from this on. If anybody could give a hint, that would be very much appreciated.

 

I saw a few post from @umiddelb mentioning the utilite pro board dating from a few years back, but I could not use any of his hints to get something to work. Maybe a hint from him could make it work ?

 

Thanks in advance.

Link to comment
Share on other sites

Hi Zibc,

 

hopefully I can give you some answers to your questions.

 

The Utilite Pro boots from an internal spi flash memory. There has been an update in 2015 which adds the feature to load the firmware from sd-card (if present). 

Honestly it takes a few steps only to make the Utilite boot an image built for the Cubox-i:

 

Spoiler

uli@upro:/boot$ cat armbianEnv.txt
console=serial
verbosity=7
bootlogo=false
rootdev=UUID=9b483858-2b02-4576-b004-c8fa88d07714
disp_mode=1920x1080M-24@50
extraargs=net.ifnames=0 mtdparts=spi0.0:768k(uboot),256k(uboot-environment),-(reserved)
rootfstype=ext4
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u

 

Spoiler

uli@upro:/boot$ cat boot.cmd
# DO NOT EDIT THIS FILE
#
# Please edit /boot/armbianEnv.txt to set supported parameters
#

# default values
setenv rootdev "/dev/mmcblk0p1"
setenv verbosity "1"
setenv console "display"
setenv bootlogo "false"
setenv rootfstype "ext4"
setenv disp_mode "1920x1080m60"
setenv earlycon "off"

# additional values
setenv satadev 0:2
setenv fdt_file "imx6q-utilite-pro.dtb"
setenv load_addr "0x10800000"
setenv ramdisk_addr "0x18000000"
setenv fdt_addr "0x15000000"

if load sata ${satadev} ${load_addr} /boot/armbianEnv.txt ; then
    env import -t ${load_addr} ${filesize}
fi

if test "${console}" = "display" || test "${console}" = "both"; then setenv consoleargs "console=tty1"; fi
if test "${console}" = "serial" || test "${console}" = "both"; then setenv consoleargs "${consoleargs} console=ttymxc3,115200 earlyprintk"; fi
if test "${earlycon}" = "on"; then setenv consoleargs "earlycon ${consoleargs}"; fi
if test "${bootlogo}" = "true"; then setenv consoleargs "bootsplash.bootfile=bootsplash.armbian ${consoleargs}"; fi

setenv bootargs "root=${rootdev} rootfstype=${rootfstype} rootwait ${consoleargs} consoleblank=0 video=mxcfb0:dev=hdmi,${disp_mode},if=RGB24,bpp=32 coherent_pool=2M cma=128M rd.dm=0 rd.luks=0 rd.lvm=0 raid=noautodetect pci=nomsi vt.global_cursor_default=0 loglevel=${verbosity} usb-storage.quirks=${usbstoragequirks} ${extraargs}"
load sata ${satadev} ${fdt_addr} /boot/dtb/${fdt_file}
load sata ${satadev} ${ramdisk_addr} /boot/uInitrd
load sata ${satadev} ${load_addr} /boot/zImage

bootz ${load_addr} ${ramdisk_addr} ${fdt_addr}

# Recompile with:
# mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr

This one is hard-wired to boot from the second SATA-0 partition (which is not very portable). Recent u-boot environments come with a "standard" distroboot feature which makes it very easy to write portable boot-scripts and to boot the same image from usb, sd-card or SATA without modification. 

 

Having this easy way to make my Utilite run Armbian made for the CuBox-i,  I've stopped my own developments.

The serial console (ttymxc3) runs perfectly well if you connect the adapter cable with the left-most receptacle on the front side 

 

Cheers

Uli

Link to comment
Share on other sites

Hi Uli,

 

Thanks a lot for taking the time to post this info. I'll try that in the next few days for sure.

It gives my back some hope that I can do something with this device.

 

I understood indeed how the boot process goes. I was able to update the firm to compulab's latest u-boot. see the picture:

u-boot.png.fd34738704107a65faa5dcb4ed5189db.png

 

I am however not sure whether loading directly from the sd-card works.

 

I see that your boot script loads from sata. I guess I need to adapt it to make it boot from the sd-card instead ?

 

I also saw that the u-boot expects to see a boot script at the root of the partition, or the uImage/zImage. I am seeing this correctly ?

 

Thanks in advance for your further help.

Link to comment
Share on other sites

Hi Zibc,

 

u-boot executes by default a macro called bootcmd. Can you post here the output of 

printenv

(within the u-boot console)

 

in my case, bootcmd looks as follows:

load sata 0:2 $scriptaddr /boot/boot.scr; source $scriptaddr;

 

in your case (boot from sd_card) it should be like this (or you just interrupt the boot process and issue the command sequence)

 

load mmc 0:1 $scriptaddr /boot/boot.scr; source $scriptaddr;

 

This command sequence loads a precompiled script from your preferred storage and executes it. The rest is done within the script itself.

 

This script is taken from here (with some small differences due to the different model):

 

# DO NOT EDIT THIS FILE
#
# Please edit /boot/armbianEnv.txt to set supported parameters
#

# default values
setenv rootdev "/dev/mmcblk0p1"
setenv verbosity "1"
setenv console "display"
setenv bootlogo "false"
setenv rootfstype "ext4"
setenv disp_mode "1920x1080m60"
setenv earlycon "off"

setenv fdt_file "imx6q-utilite-pro.dtb"

# additional values
setenv load_addr "0x10800000"
setenv ramdisk_addr "0x14800000"
setenv fdt_addr "0x15000000"

if ext2load mmc 0 ${load_addr} /boot/armbianEnv.txt || ext2load mmc 0 ${load_addr} armbianEnv.txt; then
	env import -t ${load_addr} ${filesize}
fi

if test "${console}" = "display" || test "${console}" = "both"; then setenv consoleargs "console=tty1"; fi
if test "${console}" = "serial" || test "${console}" = "both"; then setenv consoleargs "${consoleargs} console=ttymxc3,115200"; fi
if test "${earlycon}" = "on"; then setenv consoleargs "earlycon ${consoleargs}"; fi
if test "${bootlogo}" = "true"; then setenv consoleargs "bootsplash.bootfile=bootsplash.armbian ${consoleargs}"; fi

setenv bootargs "root=${rootdev} rootfstype=${rootfstype} rootwait ${consoleargs} consoleblank=0 video=mxcfb0:dev=hdmi,${disp_mode},if=RGB24,bpp=32 coherent_pool=2M cma=256M@2G rd.dm=0 rd.luks=0 rd.lvm=0 raid=noautodetect pci=nomsi vt.global_cursor_default=0 loglevel=${verbosity} usb-storage.quirks=${usbstoragequirks} ${extraargs}"
ext2load mmc 0 ${fdt_addr} /boot/dtb/${fdt_file} || fatload mmc 0 ${fdt_addr} /dtb/${fdt_file} || ext2load mmc 0 ${fdt_addr} /dtb/${fdt_file}
ext2load mmc 0 ${ramdisk_addr} /boot/uInitrd || fatload mmc 0 ${ramdisk_addr} uInitrd || ext2load mmc 0 ${ramdisk_addr} uInitrd
ext2load mmc 0 ${loadaddr} /boot/zImage || fatload mmc 0 ${loadaddr} zImage || ext2load mmc 0 ${loadaddr} zImage

bootz ${loadaddr} ${ramdisk_addr} ${fdt_addr}

# Recompile with:
# mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr

 

Link to comment
Share on other sites

Hi Uli,

 

here is what the current environment looks like: (unmodified, so should be the original one from compulab ?)

autoload=no
baudrate=115200
bootcmd=run setupmmcboot;mmc dev ${storagedev};if mmc rescan; then run trybootsmz;fi;run setupusbboot;if usb start; then if run loadscript; then run bootscript;fi;fi;run setupsataboot;if sata init; then run trybootsmz;fi;run setupnandboot;run nandboot;
bootm_low=18000000
bootscript=echo Running bootscript from ${storagetype} ...;source ${loadaddr};
console=ttymxc3,115200
doboot=bootm ${loadaddr}
doloadfdt=false
dtb=cm-fx6.dtb
ethprime=FEC0
fdtaddr=0x11000000
kernel=uImage-cm-fx6
loadaddr=0x10800000
loadfdt=load ${storagetype} ${storagedev} ${fdtaddr} ${dtb};
loadkernel=load ${storagetype} ${storagedev} ${loadaddr} ${kernel};
loadscript=load ${storagetype} ${storagedev} ${loadaddr} ${script};
mmcargs=setenv bootargs console=${console} root=${mmcroot} ${video}
mmcroot=/dev/mmcblk0p2 rw rootwait
nandargs=setenv bootargs console=${console} root=${nandroot} rootfstype=${nandrootfstype} ${video}
nandboot=if run nandloadkernel; then run nandloadfdt;run setboottypem;run storagebootcmd;run setboottypez;run storagebootcmd;fi;
nandloadfdt=nand read ${fdtaddr} 780000 80000;
nandloadkernel=nand read ${loadaddr} 0 780000;
nandroot=/dev/mtdblock4 rw
nandrootfstype=ubifs
panel=HDMI
preboot=usb start
run_eboot=echo Starting EBOOT ...; mmc dev 2 && mmc rescan && mmc read 10042000 a 400 && go 10042000
sataargs=setenv bootargs console=${console} root=${sataroot} ${video}
sataroot=/dev/sda2 rw rootwait
script=boot.scr
setboottypem=setenv kernel uImage-cm-fx6;setenv doboot bootm ${loadaddr};setenv doloadfdt false;
setboottypez=setenv kernel zImage-cm-fx6;setenv doboot bootz ${loadaddr} - ${fdtaddr};setenv doloadfdt true;
setupmmcboot=setenv storagetype mmc; setenv storagedev 2;
setupnandboot=setenv storagetype nand;
setupsataboot=setenv storagetype sata; setenv storagedev 0;
setupusbboot=setenv storagetype usb; setenv storagedev 0;
stderr=serial,vga
stdin=serial,usbkbd
stdout=serial,vga
storagebootcmd=echo Booting from ${storagetype} ...;run ${storagetype}args; run doboot;
trybootk=if run loadkernel; then if ${doloadfdt}; then run loadfdt;fi;run storagebootcmd;fi;
trybootsmz=if run loadscript; then run bootscript;fi;run setboottypem;run trybootk;run setboottypez;run trybootk;
video_dvi=mxcfb0:dev=dvi,1280x800M-32@50,if=RGB32
video_hdmi=mxcfb0:dev=hdmi,1920x1080M-32@50,if=RGB32
bootdelay=5

 

I've modified a little bit the setup script to load from usb instead of mmc (to try)

 

# DO NOT EDIT THIS FILE
#
# Please edit /boot/armbianEnv.txt to set supported parameters
#

# default values
setenv rootdev "/dev/mmcblk0p1"
setenv verbosity "1"
setenv console "display"
setenv bootlogo "false"
setenv rootfstype "ext4"
setenv disp_mode "1920x1080m60"
setenv earlycon "off"

# additional values
setenv satadev 0:2
setenv fdt_file "imx6q-utilite-pro.dtb"
setenv load_addr "0x10800000"
setenv ramdisk_addr "0x18000000"
setenv fdt_addr "0x15000000"

#if load sata ${satadev} ${load_addr} /boot/armbianEnv.txt ; then
if load usb 0 ${load_addr} /boot/armbianEnv.txt ; then
    env import -t ${load_addr} ${filesize}
fi

if test "${console}" = "display" || test "${console}" = "both"; then setenv consoleargs "console=tty1"; fi
if test "${console}" = "serial" || test "${console}" = "both"; then setenv consoleargs "${consoleargs} console=ttymxc3,115200 earlyprintk"; fi
if test "${earlycon}" = "on"; then setenv consoleargs "earlycon ${consoleargs}"; fi
if test "${bootlogo}" = "true"; then setenv consoleargs "bootsplash.bootfile=bootsplash.armbian ${consoleargs}"; fi

setenv bootargs "root=${rootdev} rootfstype=${rootfstype} rootwait ${consoleargs} consoleblank=0 video=mxcfb0:dev=hdmi,${disp_mode},if=RGB24,bpp=32 coherent_pool=2M cma=128M rd.dm=0 rd.luks=0 rd.lvm=0 raid=noautodetect pci=nomsi vt.global_cursor_default=0 loglevel=${verbosity} usb-storage.quirks=${usbstoragequirks} ${extraargs}"
#load sata ${satadev} ${fdt_addr} /boot/dtb/${fdt_file}
#load sata ${satadev} ${ramdisk_addr} /boot/uInitrd
#load sata ${satadev} ${load_addr} /boot/zImage

load usb 0 ${fdt_addr} /boot/dtb/${fdt_file}
load usb 0 ${ramdisk_addr} /boot/uInitrd
load usb 0 ${load_addr} /boot/zImage

bootz ${load_addr} ${ramdisk_addr} ${fdt_addr}

# Recompile with:
# mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr 

 

and made a symlink boot.scr to /boot/boot.scr since that's the script u-boot tries to read.

unfortunately, no success with that either until now. But, that was with a config different from the cubox-i, so this week-end, I'll built the cubox-i image and try again with this.

 

Thanks for your help!

Link to comment
Share on other sites

Hi Zibc,

 

this environment seems to be the original one, somehow. You may interrupt the automatic boot process by pressing <enter> when the counter runs down from 5 to 0 and issue the following commands

 

usb start
load usb 0:1 $loadaddr /boot/boot.scr; 
source $loadaddr;

 

I don't think that you need to build the image for the CuBox-i. Just try one of the existing images first. 

Link to comment
Share on other sites

Hi Zibc,

 

in the meantime I've backported the essential part of the Cubox-i distroboot macro set to the Utilite. You may import the following u-boot environment:

 

cons=ttymxc3,115200
devplist=1 2 3
fdt_addr_r=0x15000000
fdt_high=0xffffffff
ramdisk_addr_r=0x18000000
initrd_high=0xffffffff
kernel_addr_r=0x10800000
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_prefixes=/ /boot/
boot_scripts=boot.scr.uimg boot.scr
boot_targets=mmc0 usb0 sata0
bootcmd=run findfdt; run distro_bootcmd
bootcmd_mmc0=setenv devnum 0; run mmc_boot
bootcmd_sata0=setenv devnum 0; run sata_boot
bootcmd_usb0=setenv devnum 0; run usb_boot
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
fdtfile=undefined
findfdt=setenv fdtfile imx6q-utilite-pro.dtb
mmc_boot=if mmc dev ${devnum}; then setenv devtype mmc; run scan_dev_for_boot_part; fi
sata_boot=if sata dev ${devnum}; then setenv devtype sata; run scan_dev_for_boot_part; fi
usb_boot=usb start; if usb dev ${devnum}; then setenv devtype usb; run scan_dev_for_boot_part; fi
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_scripts; done;
scan_dev_for_boot_part=for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done

 

e.g. by issuing the following command within the u-boot console:

load usb 0:1 ${loadaddr} /distroboot.txt
env import -t ${loadaddr} ${filesize}
saveenv

 

I've reworked the boot.cmd in a way that it boots both the Cubox-i and the Utilite and does not rely on a specific storage device (e.g. hardcoded mmc 0:1 ext4):

# DO NOT EDIT THIS FILE
#
# Please edit /boot/armbianEnv.txt to set supported parameters
#

# default values
setenv rootdev "/dev/mmcblk0p1"
setenv verbosity "1"
setenv console "display"
setenv bootlogo "false"
setenv disp_mode "1920x1080m60"
setenv earlycon "off"
if test -z "${bootfstype}"; then setenv rootfstype "ext4"; else setenv rootfstype "${bootfstype}"; fi

if test "${board}" = mx6cuboxi; then
  setenv ramdisk_addr_r "0x14800000"
  if test -z "${fdtfile}"; then setenv fdtfile "imx6q-cubox-i.dtb"; fi
  if test -z "${cons}"; then setenv cons "ttymxc0,115200"; fi
fi

if load ${devtype} ${devnum}:${distro_bootpart} ${loadaddr} ${prefix}armbianEnv.txt ; then
        env import -t ${loadaddr} ${filesize}
fi

if test "${console}" = "display" || test "${console}" = "both"; then setenv consoleargs "console=tty1"; fi
if test "${console}" = "serial" || test "${console}" = "both"; then setenv consoleargs "${consoleargs} console=${cons}"; fi
if test "${earlycon}" = "on"; then setenv consoleargs "earlycon ${consoleargs}"; fi
if test "${bootlogo}" = "true"; then setenv consoleargs "bootsplash.bootfile=bootsplash.armbian ${consoleargs}"; fi

setenv bootargs "root=${rootdev} rootfstype=${rootfstype} rootwait ${consoleargs} consoleblank=0 video=mxcfb0:dev=hdmi,${disp_mode},if=RGB24,bpp=32 coherent_pool=2M cma=256M@2G rd.dm=0 rd.luks=0 rd.lvm=0 raid=noautodetect pci=nomsi vt.global_cursor_default=0 loglevel=${verbosity} usb-storage.quirks=${usbstoragequirks} ${extraargs}"
load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}dtb/${fdtfile}
load ${devtype} ${devnum}:${distro_bootpart} ${ramdisk_addr_r} ${prefix}uInitrd
load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} ${prefix}zImage

bootz ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}

# Recompile with:
# mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr

May be I'll find the time to file a PR on Github.

 

Link to comment
Share on other sites

Hi Uli,

 

Impressive work I must say. I was not expecting you to rewrite the whole boot environment and boot script!

I'll definitely give it a try when I have a chance to!

 

I attempted a few things on my own: your suggestion to just use the cubox-i image worked for the most part of it.

So I am able to boot the armbian image, but from usb only.

I tried from the sd-card, but all I get is a black screen, like the u-boot would not work properly.

It does not boot on the u-boot of the spi flash. and also, whatever I am doing, the serial port does not output anything.

I am using a usb to serial adapter for this purpose, and read fro, ttyUSB0 of some name of that sort: it remains silent. so definitely not easy to understand what is going on!

For that reason, I am also a bit relunctant at overwriting the original boot environment, because I am afraid I'll brick the board if something wrong happens ...

 

Regarding your boot environment, I believe the device for mmc boot is device 2, not 0. at least that is what I have in my environment.

 

 

From my side, I am facing interesting issues, now that I can boot the image:

Once booted, I get greeted with "waiting for the setup to finish" (or something like this). It went into the first boot options once. Not really sure why. do you have any ideas about this ?

 

At some point I'll have to transfer the image to the sata ssd. Now it is partitioned with a first fat partition with the uImage and zImage, and a second partition with the rest of the system.

Do I need to re-format to ext4 with only one partition (like the sd card essentially) ?

Also, will the installer overwrite the spi u-boot ? (afraid to brick the board)

 

I am very hopeful I can get un functional board !

 

Thanks a lot for your contribution!

Link to comment
Share on other sites

Hi Zibc,

 

3 hours ago, Zibc said:

Regarding your boot environment, I believe the device for mmc boot is device 2, not 0. at least that is what I have in my environment.

You might be right, honestly I haven't tried it with mmc,  due to the difficulties when you want to remove the mmc from the Utilite again. 

 

3 hours ago, Zibc said:

Do I need to re-format to ext4 with only one partition (like the sd card essentially) ?

As long as you have the original 32GB msata-ssd, I'd recommend to do so.  After that you can issue the following command:

sudo nand-sata-install

and select the first item: "Boot from SD - system on SATA, USB or NVME"  and select your recently formatted SATA partition as target.

This will copy the root filesystem to your SSD (the directory /boot is skipped for some reason, you will need to copy it by hand (including the folders inside) to your SSD).

 

3 hours ago, Zibc said:

Also, will the installer overwrite the spi u-boot ? (afraid to brick the board)

 

The "installer" (I don't know what you actually mean: nand-sata-install or the script which runs at the first boot?) doesn't care about the spi flash memory because the cubox-i doesn't have one. 

 

Link to comment
Share on other sites

3 hours ago, Zibc said:

For that reason, I am also a bit relunctant at overwriting the original boot environment, because I am afraid I'll brick the board if something wrong happens ...

You won't overwrite the entire u-boot environment when you import the textfile, the contents will be merged instead.

 

As long as you don't issue the

saveenv

 

command the changes won't be permanent and the old u-boot environment will be used during next boot. 

 

If you wand to try the new settings first, you may enter the following command:

 

usb start
load usb 0:1 ${loadaddr} /distroboot.txt
env import -t ${loadaddr} ${filesize}
run bootcmd

 

And this environment is supposed to work with the mmc

cons=ttymxc3,115200
devplist=1 2 3
fdt_addr_r=0x15000000
fdt_high=0xffffffff
ramdisk_addr_r=0x18000000
initrd_high=0xffffffff
kernel_addr_r=0x10800000
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_prefixes=/ /boot/
boot_scripts=boot.scr.uimg boot.scr
boot_targets=mmc0 usb0 sata0
bootcmd=run findfdt; run distro_bootcmd
bootcmd_mmc0=setenv devnum 2; run mmc_boot
bootcmd_sata0=setenv devnum 0; run sata_boot
bootcmd_usb0=setenv devnum 0; run usb_boot
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
fdtfile=undefined
findfdt=setenv fdtfile imx6q-utilite-pro.dtb
mmc_boot=if mmc dev ${devnum}; then setenv devtype mmc; run scan_dev_for_boot_part; fi
sata_boot=if sata dev ${devnum}; then setenv devtype sata; run scan_dev_for_boot_part; fi
usb_boot=usb start; if usb dev ${devnum}; then setenv devtype usb; run scan_dev_for_boot_part; fi
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_scripts; done;
scan_dev_for_boot_part=for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done

 

Link to comment
Share on other sites

Happy to write that I've got it to work on the SSD!

 

Thanks you for your help @umiddelb.

 

This week-end I formatted the SSD and ran the nand-sata-installer. Then copied the boot folder as you mentioned.

but the board would then not boot without the usb plugged into it ...

after some time I found out that the u-boot wasn't able to read the boot folder from the SSD.

So I made another attempt: made one first partition of 200Mb for the boot, and a second one for the rest of the system: literally the same as compulab's image.

then copied the boot folder to the first partition, rebooted, and that worked!

 

and the boot script I used that seems to be compatible with USB and SSD boot:

# DO NOT EDIT THIS FILE
#
# Please edit /boot/armbianEnv.txt to set supported parameters
#

# default values
setenv rootdev "/dev/mmcblk0p1"
setenv verbosity "1"
setenv console "display"
setenv bootlogo "false"
setenv rootfstype "ext4"
setenv disp_mode "1920x1080m60"
setenv earlycon "off"

# additional values
#setenv satadev 0:2
setenv satadev 0
setenv fdt_file "imx6q-utilite-pro.dtb"
setenv load_addr "0x10800000"
setenv ramdisk_addr "0x18000000"
setenv fdt_addr "0x15000000"
setenv bootstoragetype "none"
setenv bootstorageprefix "none"

echo "***** Trying usb boot *****"
for devnum in 0 1 2 3 4
do
    if test "${bootstoragetype}" = "none"
    then
        echo "***** USB ${devnum} *****"
        if load usb ${devnum} ${load_addr} /boot/armbianEnv.txt
        then
            echo "***** Using usb ${devnum} *****"
            setenv bootstoragetype "usb"
            setenv bootstoragedev ${devnum}
            setenv bootstorageprefix "/boot"
        fi
    fi
done

if test "${bootstoragetype}" = "none"
then
    if mmc rescan
    then
        echo "***** Trying SDCard boot *****"
        if load mmc 2 ${load_addr} /boot/armbianEnv.txt;
        then
            echo "***** Using sd card *****"
            setenv bootstoragetype "mmc";
            setenv bootstoragedev 2;
            setenv bootstorageprefix "/boot"
        fi
    fi
fi

if test "${bootstoragetype}" = "none"
then
    if sata init
    then
        echo "***** Trying SATA boot *****"
        if load sata 0 ${load_addr} /armbianEnv.txt
        then
            echo "***** Using SATA *****"
            setenv bootstoragetype "sata";
            setenv bootstoragedev 0;
            setenv bootstorageprefix ""
        fi
    fi
fi

echo "***** Importing environment *****"
env import -t ${load_addr} ${filesize};

if test "${console}" = "display" || test "${console}" = "both"; then setenv consoleargs "console=tty1"; fi
if test "${console}" = "serial" || test "${console}" = "both"; then setenv consoleargs "${consoleargs} console=ttymxc3,115200 earlyprintk"; fi
if test "${earlycon}" = "on"; then setenv consoleargs "earlycon ${consoleargs}"; fi
if test "${bootlogo}" = "true"; then setenv consoleargs "bootsplash.bootfile=bootsplash.armbian ${consoleargs}"; fi

setenv bootargs "root=${rootdev} rootfstype=${rootfstype} rootwait ${consoleargs} consoleblank=0 video=mxcfb0:dev=hdmi,${disp_mode},if=RGB24,bpp=32 coherent_pool=2M cma=128M rd.dm=0 rd.luks=0 rd.lvm=0 raid=noautodetect pci=nomsi vt.global_cursor_default=0 loglevel=${verbosity} usb-storage.quirks=${usbstoragequirks} ${extraargs}"

load ${bootstoragetype} ${bootstoragedev} ${fdt_addr} ${bootstorageprefix}/dtb/${fdt_file}
load ${bootstoragetype} ${bootstoragedev} ${ramdisk_addr} ${bootstorageprefix}/uInitrd
load ${bootstoragetype} ${bootstoragedev} ${load_addr} ${bootstorageprefix}/zImage

bootz ${load_addr} ${ramdisk_addr} ${fdt_addr}

# Recompile with:
# mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr

 

Now I've got to get a few python scripts to run, and I'll call that a success!

 

I'll try to also get the fw_printenv and fw_setenv utilities to run, but I have a feeling that the mtd dive is not read properly, so the system can't access it unfortunately.

maybe you have a remedy for that ?

Link to comment
Share on other sites

9 hours ago, Zibc said:

Happy to write that I've got it to work on the SSD!

Cool, congrats!

 

9 hours ago, Zibc said:

after some time I found out that the u-boot wasn't able to read the boot folder from the SSD.

Yes, the filesystem uses features u-boot doesn't know about (u-boot is simply too old). You can circumvent this issue by modifying nand-sata-install:

 

upro:build:% diff ./packages/bsp/common/usr/sbin/nand-sata-install /usr/sbin/nand-sata-install
56c56
< if [[ $LINUXFAMILY == mvebu ]]; then
---
> if [[ $LINUXFAMILY == mvebu || $LINUXFAMILY == imx6 ]]; then

There is already a hook in this script which disables this feature during file-system creation.

 

# for ARMv7 remove 64bit feature from default mke2fs format features
if [[ $LINUXFAMILY == mvebu ]]; then
        mkopts[ext2]='-O ^64bit -qF'
        mkopts[ext3]='-O ^64bit -qF'
        mkopts[ext4]='-O ^64bit -qF'
else
        mkopts[ext2]='-qF'
        mkopts[ext3]='-qF'
        mkopts[ext4]='-qF'
fi

 

10 hours ago, Zibc said:

the boot script I used that seems to be compatible with USB and SSD boot

Looks like you were trying to implement the distroboot feature within you script. I believe the SATA part should also use the /boot/ prefix ... 

Link to comment
Share on other sites

First, great article. I am glad to see there are people with Utilite Pro outside. I followed the old article of Ulf on his GitHub Page and built Ubuntu 14.04. with 3.14 Kernel. I use the Utilite as a small home server for vintage computing :) I updated Ubuntu up to 22.04. LTS, but now the kernel is too old and several things are not working anymore, even apache2 (random number generator missing). 

 

So I tried to built a new kernel, 4.X but I am unable to do so. Do you have any advise how can I built a more recent kernel for my Utilite Pro? 

 

Thank you in advanced.

Jan

Link to comment
Share on other sites

On 10/20/2022 at 1:58 PM, thafaker said:

So I tried to built a new kernel, 4.X but I am unable to do so. Do you have any advise how can I built a more recent kernel for my Utilite Pro? 

You'd better go with a fresh Armbian install. The Cubox-I image works for the Utilite Pro as well.

Just write the Cubox-i image onto USB or µSD card and modify the u-boot environment in a way mentioned above.

If you are afraid to render the Utilite Pro unusable, you can omit the saveenv command and try out the modified environment before you make the change permanent.

Before issuing the nand-sata-install command you should modify this shell-script in a way that u-boot can access the filesystem contents during boot.

 

Cheers

Uli

Link to comment
Share on other sites

Hi Uli,

thank you very much for your reply. I can't find my serial cable so I need to order a new one. I thought I can recompile a new kernel on the device and install it in /boot but I have no output so I can't see why they are not booting. I used the 4.1.15 with all the cmfx6 patches, but it won't boot. 

 

Cheery,

Jan

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines