How to boot FreeBSD installed on the sd card on the Khadas Edge-V instead of Android

I've understood that the image named "Edge_Ubuntu-gnome-focal_Linux-5.7_arm64_SD-USB_V0.9.1-20200602.img" can boot from the sd card,but the image named "edge-freebsd-aarch64-13.0-release-20210613.img" can't do it. Why ? I've crudely identified some crucial differences that make the magic.

1) the structure of the disk partitions that comes after having written "Edge_Ubuntu-gnome-focal_Linux-5.7_arm64_SD-USB_V0.9.1-20200602.img" to the sd card :

Code:
=>      63  62333889  da1  MBR  (30G)
        63     32705       - free -  (16M)
     32768    491520    1  fat32  [active]  (240M)
    524288  61808640    2  linux-data  (29G)
  62332928      1024       - free -  (512K)

I suspect that MBR here is important. Anyway,not totally sure.

2) inside the fat32 partition there is a script like this :

Code:
echo "Run Khadas boot script"

# Constant
setenv BOARD_TYPE_NONE        0
setenv BOARD_TYPE_EDGE        1
setenv BOARD_TYPE_EDGE_V    2
setenv BOARD_TYPE_CAPTAIN    3

# Detect board type
kbi boarddetect

if test ${board_type} = ${BOARD_TYPE_NONE}; then
    echo "Unsupported board detected! Stop here. Reboot...";
    sleep 5;
    reset;
fi

setenv emmc_root_part        7
setenv emmc_boot_part        7
setenv emmc_mbr_root_part    2
setenv emmc_mbr_boot_part    1
setenv sd_root_part            2
setenv sd_boot_part            1

if test ${devnum} = 0; then
    echo "Uboot loaded from eMMC.";
    if test -e mmc ${devnum}:${emmc_root_part} zImage; then
        setenv imagetype "EMMC";
        setenv boot_env_part ${emmc_boot_part};
        setenv root_part ${emmc_root_part};
        setenv mark_prefix "boot/";
    else
        setenv imagetype "EMMC_MBR";
        setenv boot_env_part ${emmc_mbr_boot_part};
        setenv root_part ${emmc_mbr_root_part};
        setenv mark_prefix "";
    fi;

    if test -e mmc ${devnum}:${boot_env_part} ${mark_prefix}.next; then
        setenv default_rootdev "/dev/mmcblk2p${root_part}"
    else
        setenv default_rootdev "/dev/mmcblk1p${root_part}"
    fi
else if test ${devnum} = 1; then
    echo "Uboot loaded from SD.";
    setenv boot_env_part ${sd_boot_part};
    setenv root_part ${sd_root_part}
    setenv mark_prefix ""
    if test -e mmc ${devnum}:${boot_env_part} ${mark_prefix}.next; then
        setenv default_rootdev "/dev/mmcblk1p${sd_root_part}"
    else
        setenv default_rootdev "/dev/mmcblk0p${sd_root_part}"
    fi
    setenv imagetype "SD-USB";
fi;fi;

# Import environment from env.txt
if load ${devtype} ${devnum}:${boot_env_part} ${ramdisk_addr_r} /boot/env.txt || load ${devtype} ${devnum}:${boot_env_part} ${ramdisk_addr_r} env.txt; then
    echo "Import env.txt";
    env import -t ${ramdisk_addr_r} ${filesize}
fi

# Check root part filesystem UUID
fsuuid ${devtype} ${devnum}:${root_part} root_uuid
if test "UUID=${root_uuid}" != "${rootdev}"; then
    echo "Rootfs UUID mismatch! Set rootfs part to default: ${default_rootdev}"
    setenv rootdev ${default_rootdev}
fi

# Check MIPI
if test "${mipi_lcd_enabled}" = "true"; then
    setenv dtb_suffix "-mipi";
else
    setenv dtb_suffix "";
fi

if test -e mmc ${devnum}:${boot_env_part} ${mark_prefix}.next; then
    if test ${board_type} = ${BOARD_TYPE_EDGE}; then
        setenv boot_dtb "rk3399-khadas-edge.dtb";
    else if test ${board_type} = ${BOARD_TYPE_EDGE_V}; then
        setenv boot_dtb "rk3399-khadas-edge-v.dtb";
    else if test ${board_type} = ${BOARD_TYPE_CAPTAIN}; then
        setenv boot_dtb "rk3399-khadas-edge-captain.dtb";
    fi;fi;fi
else
    if test ${board_type} = ${BOARD_TYPE_EDGE}; then
        setenv boot_dtb "rk3399-khadas-edge-linux.dtb";
    else if test ${board_type} = ${BOARD_TYPE_EDGE_V}; then
        setenv boot_dtb "rk3399-khadas-edgev${dtb_suffix}-linux.dtb";
    else if test ${board_type} = ${BOARD_TYPE_CAPTAIN}; then
        setenv boot_dtb "rk3399-khadas-captain${dtb_suffix}-linux.dtb";
    fi;fi;fi
fi

if test ${devnum} = 0; then
    if test -e mmc ${devnum}:${boot_env_part} ${mark_prefix}.next; then
        if test ${imagetype} = EMMC_MBR; then
            setenv dtb_prefix "/dtb/rockchip/";
        else
            setenv dtb_prefix "/boot/dtb/rockchip/";
        fi
    else
        if test ${imagetype} = EMMC_MBR; then
            setenv dtb_prefix "/dtb/";
        else
            setenv dtb_prefix "/boot/dtb/";
        fi
    fi
else if test ${devnum} = 1; then
    if test -e mmc ${devnum}:${boot_env_part} ${mark_prefix}.next; then
        setenv dtb_prefix "/dtb/rockchip/";
    else
        setenv dtb_prefix "/dtb/";
    fi
fi;fi;

echo DTB: ${dtb_prefix}${boot_dtb}

if test -e mmc ${devnum}:${boot_env_part} ${mark_prefix}.next; then
    setenv condev "earlyprintk console=ttyS2,1500000n8 console=tty0"
else
    setenv condev "earlyprintk console=ttyFIQ0,1500000n8 console=tty0"
fi

setenv boot_start booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}

part uuid mmc ${devnum}:1 ubootpartuuid;
if test "X${ubootpartuuid}" = "X"; then
    echo "Can not get u-boot part UUID, set to NULL";
    setenv ubootpartuuid "NULL";
fi;

kbi ethmac
if test -e ${custom_ethmac}; then
    echo "Found custom ethmac: ${custom_ethmac}, overwrite eth_mac!";
    setenv eth_mac ${custom_ethmac}
fi

if test "X${eth_mac}" = "X" || test "X${eth_mac}" = "X00:00:00:00:00:00"; then
    echo "Set default mac address to ethaddr: ${ethaddr}!";
    setenv eth_mac ${ethaddr};
    setenv saveethmac "save_ethmac=yes";
fi;

if test -e ${loglevel}; then
    setenv log "loglevel=${loglevel}"
fi

setenv bootargs "${bootargs} ${condev} ${log} rw root=${rootdev} rootfstype=ext4 init=/sbin/init rootwait ubootpart=${ubootpartuuid} board_type=${board_type} board_type_name=${board_type_name} khadas_board=${board_type_name} fan=${fan_mode} mac=${eth_mac} androidboot.mac=${eth_mac} ${saveethmac} coherent_pool=${dma_size} imagetype=${imagetype}"

for distro_bootpart in ${devplist}; do
    echo "Scanning ${devtype} ${devnum}:${distro_bootpart}..."

    if load ${devtype} ${devnum}:${distro_bootpart} ${ramdisk_addr_r} uInitrd; then
        if load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} zImage; then
            if load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${dtb_prefix}${boot_dtb}; then
                run boot_start;
            fi;
        fi;
    fi;

done

# Rebuilt
# mkimage -A arm64 -O linux -T script -C none -a 0 -e 0 -n "rk3399 autoscript" -d /boot/rk3399_autoscript.cmd /boot/boot.scr

I suspect that it has been compiled and it became the file "boot.scr" that's the responsible for the booting of Ubuntu from the sd card. This script is not present on the EFI partition of the sd card where is installed FreeBSD :

Code:
=>       40  500006832  da3  GPT  (238G)
         40      32728       - free -  (16M)
      32768     102400    1  efi  (50M)
     135168  483708928    2  freebsd-ufs  (231G)
  483844096   16154624    3  freebsd-swap  (7.7G)
  499998720       8152       - free -  (4.0M)

anyway,I tried to put it there :

Code:
marietto# cd /mnt/da3p1
marietto# ls

EFI            dtb            dtb-rock        u-boot~1.bin
Edge-V            dtb-RK3399        rk3399_autoscript.cmd    ubootefi.var
boot.scr        dtb-pinebook-pro    splash.bmp        ubootefi_.var

what happened ? that FreeBSD does not boot,but is Android that's installed on the internal EMMC that makes the boot. I'm pretty sure that the script has been written specially for Ubuntu and it should be modified to work with FreeBSD. Is my intention to make some modifications,but I feel that this job is not that easy.
 
I suspect that it has been compiled and it became the file "boot.scr" that's the responsible for the booting of Ubuntu from the sd card.
Yes they boot a whole different way. Minimal u-boot but add everything in via boot.scr.

At this point you are wasting your time. Use Ubuntu and blank eMMC.

Prepare a microSD with your custom u-boot for edge-v built on FreeBSD.

Get it booting up on edge-v. No operating system. Just u-boot from microSD card.

Once you achieve that flash ROCKPRO64 14.3-RELEASE to a microSD. Then flash your edge-v u-boot to card and you are done.
 
Yes they boot a whole different way. Minimal u-boot but add everything in via boot.scr.

At this point you are wasting your time. Use Ubuntu and blank eMMC.

Prepare a microSD with your custom u-boot for edge-v built on FreeBSD.

Get it booting up on edge-v. No operating system. Just u-boot from microSD card.

Once you achieve that flash ROCKPRO64 14.3-RELEASE to a microSD. Then flash your edge-v u-boot to card and you are done.

So you think that if the eMMC is empty,the script will boot the OS that it finds on the sd card ?

---> At this point you are wasting your time. Use Ubuntu and blank eMMC.

Is very hard to modify that script for booting FreeBSD ?
 
Check this :

Code:
if test ${devnum} = 0; then
    echo "Uboot loaded from eMMC.";
    if test -e mmc ${devnum}:${emmc_root_part} zImage; then
        setenv imagetype "EMMC";
        setenv boot_env_part ${emmc_boot_part};
        setenv root_part ${emmc_root_part};
        setenv mark_prefix "boot/";
    else
        setenv imagetype "EMMC_MBR";
        setenv boot_env_part ${emmc_mbr_boot_part};
        setenv root_part ${emmc_mbr_root_part};
        setenv mark_prefix "";
    fi;

    if test -e mmc ${devnum}:${boot_env_part} ${mark_prefix}.next; then
        setenv default_rootdev "/dev/mmcblk2p${root_part}"
    else
        setenv default_rootdev "/dev/mmcblk1p${root_part}"
    fi
else if test ${devnum} = 1; then
    echo "Uboot loaded from SD.";
    setenv boot_env_part ${sd_boot_part};
    setenv root_part ${sd_root_part}
    setenv mark_prefix ""
    if test -e mmc ${devnum}:${boot_env_part} ${mark_prefix}.next; then
        setenv default_rootdev "/dev/mmcblk1p${sd_root_part}"
    else
        setenv default_rootdev "/dev/mmcblk0p${sd_root_part}"
    fi
    setenv imagetype "SD-USB";
fi;fi;

maybe I can try to do this :

Code:
if test ${devnum} = 0; then
    echo "Uboot loaded from SD.";
    setenv boot_env_part ${sd_boot_part};
    setenv root_part ${sd_root_part}
    setenv mark_prefix ""
    if test -e mmc ${devnum}:${boot_env_part} ${mark_prefix}.next; then
        setenv default_rootdev "/dev/mmcblk1p${sd_root_part}"
    else
        setenv default_rootdev "/dev/mmcblk0p${sd_root_part}"
    fi
    setenv imagetype "SD-USB";
fi;
 
I would like to add one ufs2 partition on da0,on the free space :

Code:
=>      63  62333889  da0  MBR  (30G)
        63     32705       - free -  (16M)
     32768    491520    1  fat32  [active]  (240M)
    524288  61809664       - free -  (29G)

I think that the right command is this :

Code:
marietto# gpart add -t freebsd-ufs -a 4k -l data da0

but it gives this error :

Code:
gpart: Invalid argument
 
Code:
# sgdisk -g /dev/sdi

======>

Disk /dev/sdi: 29.72 GiB, 31914983424 bytes, 62333952 sectors
Disk model: STORAGE DEVICE  
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: F36CA327-5194-4815-A69E-11ADBB6A4053

Dispositivo Start   Fine Settori  Size Tipo
/dev/sdi1   32768 524287  491520  240M Microsoft basic data

 
Following the man page I have created da7 with the MBR scheme and I've added the second partition as UFS2 giving the following commands :

Code:
# gpart create -s MBR da7
# gpart add -t freebsd  -s 119G -a 4k da7
# gpart set -a  active -i 1 da7
# gpart bootcode -b /boot/boot0 da7
# gpart create -s BSD -n 20 da7s1

=>       63  249737153  da7  MBR  (119G)
         63       1985       - free -  (993K)
       2048     102400    1  fat32lba  [active]  (50M)
     104448  249561088    2  freebsd  (119G)
  249665536      71680       - free -  (35M)

Now the problem is that I'm not able to determine the uuid of da7s2a,that is required by the boot.scr script that should be stored on da7s1 :

Code:
# gpart list da7 | grep rawuuid
nothing.

Why ? How to fix it ? thanks.
 
FreeBSD does not need boot.scr as it boots via the U-boot build method called FIT image.
Everything is included on the u-boot image and it has a copy of the DTB build in. Nothing more is needed.

Have you built the FreeBSD U-boot port for khadis eddge-v that I wrote for you and tested? Sure does not sound like it.
It is really disappointing to try and lead someone and then watch them fall into a volcano.

https://www.yahoo.com/news/hiking-influencer-juliana-marins-cause-113434531.html
 
Code:
marietto# tune2fs -U random /dev/da7s2a

tune2fs 1.47.2 (1-Jan-2025)
tune2fs: Bad magic number in super-block while trying to open /dev/da7s2a

/dev/da7s2a contains `Unix Fast File system [v2] (little-endian) last mounted on /mnt/da7s2a, 
volume name rootfs, last written at Sun Jul 13 17:13:21 2025, clean flag 1, readonly flag 0, 
number of blocks 1297648, number of data blocks 1252407, number of cylinder groups 9, 
block size 32768, fragment size 4096, average file size 16384, average number of files in dir 64, 
pending blocks to free 0, pending inodes to free 0, system-wide uuid 0, 
minimum percentage of free blocks 8, TIME optimization' data
 
FreeBSD does not need boot.scr as it boots via the U-boot build method called FIT image.
Everything is included on the u-boot image and it has a copy of the DTB build in. Nothing more is needed.

FreeBSD does not need boot.scr,but it seems that the KHADAS Edge-V needs it. I'm not following your directions at the moment because I'm "scared" that if I don't use the informations stored inside the boot.scr file,FreeBSD will not boot. Why I think like this ? Because I've already tried to boot the official supported FreeBSD img file but it never booted. So I started thinking that it depends by the fact that it wants an MBR formatted sd card and / or the boot.scr file.

Anyway I found the file that you asked :


is the right file ?

It is really disappointing to try and lead someone and then watch them fall into a volcano.

This is the same sensation that I feel when I realize that (some ? a lot of ?) users don't read my old posts. Just like in this post :


when I asked "So you think that if the eMMC is empty,the script will boot the OS that it finds on the sd card ?"

but you didn't reply.

Furthermore,the FreeBSD img offered as compatibile by the developers of KHADAS uses u-boot. The image has been created by SleepWalker. So I'm pretty sure that he already did what you are suggesting me to do here.

I think that a good idea is if you want to give a look at it :


Is not a good idea to try to understand what has been included on that image and what's missing ? Just because the work has already been done. And a KHADAS developer showed me that the image is able to boot. For him,but not for me.

(The SleepWalker FreeBSD image marked as compatible is not stored on a MBR disk and the boot.scr file is missing)
 
Here is step by step what I do to build u-boot for this platform.
All you have to do is create a directory and 2 files...

You do not have to worry about messing up Ubuntu because it resides on a microSD card correct?
Remove your booting Ubuntu card and try your FreeBSD built u-boot card.

If you have trouble building this port then we can troubleshoot.
 
Do you understand this part? You are looking for a default configuration file for Khadis Edge V. I am using another port to do this.

You could just as easily build any board port for this u-boot source tree.

Once you have this information (the name of defconfig file)

Is this the file that are you asking ?


PS :

Please try to answer my questions,very thanks. Just because I'm here to experiment / learn and the questions I make define the road to take and they remove some dark zones.
 
Code:
marietto# pwd
                                                           
/usr/ports/sysutils/u-boot-khadas-edge-v

marietto#  make build-depends-list | cut -c 12- | xargs pkg install -A -y

Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
pkg: No packages available to install matching 'misc/e2fsprogs-libuuid' have been found in the repositories
 
make build-depends-list | cut -c 12- | xargs pkg install -A -y
You can skip the whole line. What it does is download the package instead of building a port.
If you skip the line there could be problems with mixing of ports and packages. Luckily the dependencies of u-boot are not great.

Skip that line an run make install. It will take a bit longer.

I assume you are using QUARTERLY packages for your build system?
 
on my PC (X64 bit) :

Code:
marietto# MAKE_JOBS_UNSAFE=yes make install

.....
In file included from tools/aisimage.c:7:
In file included from tools/imagetool.h:24:
In file included from include/image.h:19:
In file included from ./arch/arm/include/asm/byteorder.h:18:
In file included from ./arch/arm/include/asm/types.h:4:
include/asm-generic/int-ll64.h:28:44: error: typedef redefinition with different types ('long long' vs 'int64_t' (aka 'long'))
   28 | __extension__ typedef __signed__ long long __s64;
      |                                            ^
/usr/local/include/linux/types.h:22:17: note: previous definition is here
   22 | typedef int64_t __s64;
      |                 ^
In file included from tools/aisimage.c:7:
In file included from tools/imagetool.h:24:
In file included from include/image.h:19:
In file included from ./arch/arm/include/asm/byteorder.h:18:
In file included from ./arch/arm/include/asm/types.h:4:
include/asm-generic/int-ll64.h:29:42: error: typedef redefinition with different types ('unsigned long long' vs 'uint64_t' (aka 'unsigned long'))
   29 | __extension__ typedef unsigned long long __u64;
      |                                          ^
/usr/local/include/linux/types.h:9:18: note: previous definition is here
    9 | typedef uint64_t __u64;
      |                  ^
In file included from tools/aisimage.c:7:
In file included from tools/imagetool.h:24:
In file included from include/image.h:19:
In file included from ./arch/arm/include/asm/byteorder.h:28:
include/linux/byteorder/little_endian.h:45:15: error: unknown type name '__le64'
   45 | static inline __le64 __cpu_to_le64p(const __u64 *p)
      |               ^
include/linux/byteorder/little_endian.h:47:18: error: use of undeclared identifier '__le64'
   47 |         return (__force __le64)*p;
      |                         ^
include/linux/byteorder/little_endian.h:49:42: error: unknown type name '__le64'
   49 | static inline __u64 __le64_to_cpup(const __le64 *p)
      |                                          ^
include/linux/byteorder/little_endian.h:53:15: error: unknown type name '__le32'
   53 | static inline __le32 __cpu_to_le32p(const __u32 *p)
      |               ^
include/linux/byteorder/little_endian.h:55:18: error: use of undeclared identifier '__le32'
   55 |         return (__force __le32)*p;
      |                         ^
include/linux/byteorder/little_endian.h:57:42: error: unknown type name '__le32'
   57 | static inline __u32 __le32_to_cpup(const __le32 *p)
      |                                          ^
include/linux/byteorder/little_endian.h:61:15: error: unknown type name '__le16'
   61 | static inline __le16 __cpu_to_le16p(const __u16 *p)
      |               ^
include/linux/byteorder/little_endian.h:63:18: error: use of undeclared identifier '__le16'
   63 |         return (__force __le16)*p;
      |                         ^
include/linux/byteorder/little_endian.h:65:42: error: unknown type name '__le16'
   65 | static inline __u16 __le16_to_cpup(const __le16 *p)
      |                                          ^
include/linux/byteorder/little_endian.h:69:15: error: unknown type name '__be64'
   69 | static inline __be64 __cpu_to_be64p(const __u64 *p)
      |               ^
include/linux/byteorder/little_endian.h:71:18: error: use of undeclared identifier '__be64'
   71 |         return (__force __be64)__swab64p(p);
      |                         ^
include/linux/byteorder/little_endian.h:73:42: error: unknown type name '__be64'
   73 | static inline __u64 __be64_to_cpup(const __be64 *p)
      |                                          ^
include/linux/byteorder/little_endian.h:77:15: error: unknown type name '__be32'
   77 | static inline __be32 __cpu_to_be32p(const __u32 *p)
      |               ^
include/linux/byteorder/little_endian.h:79:18: error: use of undeclared identifier '__be32'
   79 |         return (__force __be32)__swab32p(p);
      |                         ^
include/linux/byteorder/little_endian.h:81:42: error: unknown type name '__be32'
   81 | static inline __u32 __be32_to_cpup(const __be32 *p)
      |                                          ^
include/linux/byteorder/little_endian.h:85:15: error: unknown type name '__be16'
   85 | static inline __be16 __cpu_to_be16p(const __u16 *p)
      |               ^
include/linux/byteorder/little_endian.h:87:18: error: use of undeclared identifier '__be16'
   87 |         return (__force __be16)__swab16p(p);
      |                         ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
gmake[1]: *** [scripts/Makefile.host:112: tools/aisimage.o] Error 1
gmake: *** [Makefile:1918: tools] Error 2
*** Error code 1

Stop.
make: stopped in /usr/ports/sysutils/u-boot-khadas-edge-v
 
I can't do any more. Maybe make clean? It looks like your toolchain is not setup right.

Deleting make.conf and src.conf are my first thoughts. You may have settings there messing with your compilation.

I really am burnout This port took me 45mins to whip up. Tested on my machine.

I would post my files but I don't have a good way.
 
Compiled succesfully....

Screenshot_2025-07-13_23-22-36.jpg
 
Code:
Disk /dev/sdg: 29.72 GiB, 31914983424 bytes, 62333952 sectors
Disk model: STORAGE DEVICE 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: C06DC639-CC50-11EB-B8A0-D03745CD5653

Dispositivo  Start    Fine Settori  Size Tipo
/dev/sdg1    32768  135167  102400   50M EFI System
/dev/sdg2   135168  659455  524288  256M FreeBSD swap
/dev/sdg3   659456 2874879 2215424  1.1G FreeBSD UFS

# dd if=edge-freebsd-aarch64-13.0-release-20210613.img | pv | dd of=/dev/sdg
# dd if=idbloader.img of=/dev/sdg seek=64 conv=sync
# dd if=u-boot.itb of=/dev/sdg seek=16384 bs=512 conv=sync

inserted the sd card into the khadas-edge-V and....Android booted instead of FreeBSD.
 
What kind of SD / microSD card socket is on the Khadas? Some have a "push in until it clicks" type socket.
Are you certain that the SD / microSD card is properly inserted?
 
What kind of SD / microSD card socket is on the Khadas? Some have a "push in until it clicks" type socket.
Are you certain that the SD / microSD card is properly inserted?

yes,I'm sure that it is properly inserted. It makes a click.
 
What about the buttons. Now that you have a bootable card you need the proper button sequence.

From here :

https://forum.khadas.com/t/freebsd-for-edge-edge-v/5794/121 :

We need to check why you cant boot from the SD card, please follow the below steps to provide the full serial debug console log to us.

  1. Setup the serial debug console [1]
  2. Write FreeBSD [2] image to the SD card
  3. Insert the SD card to Edge-V
  4. Quick press the Func 3 times, you will see the Blue LED flash and the board will reboot
  5. Provide the full serial debug console log to us

my answer :

I can’t provide the full serial debug to you because when I quick press the Func 3 times, the board will reboot in Android. I don’t have any log from the serial console to provide because minicom on Linux and SecureCRT in Windows do not show any log message :

WhatsApp Image 2025-07-09 at 00.39.59.jpeg



Untitled.jpg
 
OK I am really glad you built u-boot on FreeBSD. You will be able to further your skills with that and we can try and get you booting..
How to troubleshoot.
First thing comes to mind is where u-boot starts on disk is critical. The so called offset (seek=16384).
I would be checking the working Ubuntu microSD and see where bootloader starts. It must start at address 08000 on disk.
Disk does not have to be mounted.

dd if=/dev/da0 | hexdump -C | more
You are looking for the bootloader with the text RKNS in the right hand panel.

Maybe Khadis starts at another location? Compare your new u-boot to Khadis Ubuntu. Is the text RKNS at the same address? Also look at your FreeBSD 13.0 image bootloader details.
Skip right to the chase for checking microSD on usb adapter:
dd if=/dev/da0 | hexdump -C | grep RK

00008000 52 4b 4e 53 00 00 00 00 80 01 02 00 01 00 00 00 |RKNS............|

Also be aware you should have HDMI output available. Have you checked that with Ubuntu or FreeBSD microSD images? How about your custom port u-boot disk with HDMI? It is enabled.
 
Back
Top