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

Probably my adapter does not work because the pin at 3.3V should be closed with a jumper.

I'm not sure anyway. I see that it is not short and it does not make a lot of sense to e to put a jumper there...


Screenshot_2025-08-05_01-58-14.jpg



On the tutorial,dude did it using your adapter,which sounds have a better look and it seems better engineered :


Screenshot_2025-08-05_02-04-06.jpg



That's probably the reason why my adapter doesn't work....
 
Probably my adapter does not work because the pin at 3.3V should be closed with a jumper..

in order to maximize your chances try out these things:
1. check the logic hi voltage level on the adapter and the minicomputer. they must match.

completely disconnect the adapter from minicomputer, but keep both powered up. with a multimeter that reads DC volts check out the voltage between ground and RX, then TX on both devices. common UART voltages can be 1.8V, 3.3V or 5V. if your board is 3.3v your adapter must also be prepared for that level. some adapters indeed have a jumper that select the logic hi voltage. if you have a matching combination then you don't need to worry about any missing jumper.

2. in minicom try different combinations of flow control and reboot the board each time to generate input data
CTRL+ALT+Z O (configuration) -> serial port setup -> F,G. most common is hardware flow control off, software flow control off.
also make sure you have sane stop bits configured. 8N1 is most common. goes without saying that you also need to have the proper speed configured, otherwise you get trash on your terminal. try to flip RX/TX in case you got them wrong.

3. use a laptop that is battery powered to connect to that adapter via USB. sometimes when devices are plugged in and have long ground (Protected Earth) loops small voltage differences in that common ground can cause havoc on small signals like that UART. if you don't have a laptop with minicom at least make sure both the PC and the minicomputer are plugged in the same wall power socket.
 
Thanks for your help.

This time I used this adapter :

https://www.amazon.it/dp/B08T24NML9

It looks like the original pine one,but I am still not able to display the messages on the screen as soon as I turn on the RockPro64 board.


1) The yellow jumper on the serial console is set to 3V3 (I didn't touch the yellow jumper as it have been placed by default

2) I've connected a wire to the ground (GND) on the adapter and the other end to pin#6 of the board (red cable)

3) I've connected a wire to RTX on the adapter and the other end to pin#8 of the board (orange cable)

4) I've connected anoter (red) wire to TXD to the adapter and the other end to pin#10 of the ROCKPro64,but I have also tried without

Please give a look at this picture :


5.jpeg



Then,on Linux I put hardware and software flow control = yes and :

On Terminal 1 :

Code:
# screen /dev/ttyUSB0 1500000


On Terminal 2 :

Code:
# minicom -D /dev/ttyUSB0 -b 1500000

And then I attached an HDMI cable to my monitor,to see if it was able to boot and I powered on the board. Well,it booted regularly,but on the Minicom console I didn't see any message :

https://ibb.co/7NzmpgFK
https://ibb.co/s96D21pN
 
As u can see,black = GND = pin 6 ; brown = RTX = pin 8. The author says that the white wire is not necessary to display the messages.
 
yes in your red/orange pic gnd goes to 8

Now it's working. I can't believe that after "1000" tries,I have placed the wires to the wrong pins all the time.

Now that's working on the RockPro,I will try with the KHADAS EDGE-V board. My real target.
 
Anyway I suspect that, generally speaking, the problem was to run "screen /dev/ttyUSB0 1500000". I didn't run it before minicom and it worked...
 
Et voila'. Below there is / are the reason(s) why the KHADAS-Edge V does not boot if on the sd card is installed UEFI instead of u-boot :

Code:
Boot1: 2018-08-06, version: 1.15                                 
CPUId = 0x0                                                      
ChipType = 0x10, 218                                            
SdmmcInit=2 0                                                    
BootCapSize=100000
UserCapSize=29820MB
FwPartOffset=2000 , 100000
mmc0:cmd5,20
SdmmcInit=0 0
BootCapSize=0
UserCapSize=121942MB
FwPartOffset=2000 , 0                                                                              
run on sd0                                                                                        
StorageInit ok = 89823                                                                            
SecureMode = 0                                                                                    
SecureInit read PBA: 0x4                                                                          
SecureInit read PBA: 0x404                                                                        
SecureInit read PBA: 0x804                                                                        
SecureInit read PBA: 0xc04                                                                        
SecureInit read PBA: 0x1004                                                                        
SecureInit read PBA: 0x1404                                                                        
SecureInit read PBA: 0x1804                                                                        
SecureInit read PBA: 0x1c04                                                                        
SecureInit ret = 0, SecureMode = 0                                                                
GPT 0x3190d20 signature is wrong                                                                  
LoadTrust Addr:0x4000                                                                              
No find bl30.bin                                                                                  
No find bl32.bin                                                                                  
Load uboot, ReadLba = 2000                                                                        
Load OK, addr=0x200000, size=0xf0000                                                              
RunBL31 0x10000                                                                                    
NOTICE:  BL31: v1.3(debug):51f2096                                                                
NOTICE:  BL31: Built : 16:24:31, May  6 2019                                                      
NOTICE:  BL31: Rockchip release version: v1.1                                                      
INFO:    GICv3 with legacy support detected. ARM GICV3 driver initialized in EL3                  
INFO:    Using opteed sec cpu_context!                                                            
INFO:    boot cpu mask: 0                                                                          
INFO:    plat_rockchip_pmu_init(1181): pd status 3e                                                
INFO:    BL31: Initializing runtime services                                                      
WARNING: No OPTEE provided by BL2 boot loader, Booting device without OPTEE initialization. SMC`s dK
ERROR:   Error initializing runtime service opteed_fast                                            
INFO:    BL31: Preparing for EL3 exit to normal world                                              
INFO:    Entry point address = 0x200000                                                            
INFO:    SPSR = 0x3c9                                                                              
PLL at FF750000: fbdiv=112, refdiv=2, postdiv1=2, postdiv2=1, vco=1344000 khz, output=672000 khz  
Boot PLLs:                                                                                        
APLLL = 400000000                                                                                  
APLLB = 24000000                                                                                  
CPLL = 24000000                                                                                    
DPLL = 800000000                                                                                  
GPLL = 400000000                                                                                  
NPLL = 24000000                                                                                    
VPLL = 24000000                                                                                    
PLL at FF760000: fbdiv=68, refdiv=1, postdiv1=2, postdiv2=1, vco=1632000 khz, output=816000 khz    
PLL at FF760020: fbdiv=68, refdiv=1, postdiv1=2, postdiv2=1, vco=1632000 khz, output=816000 khz    
PLL at FF760080: fbdiv=100, refdiv=1, postdiv1=3, postdiv2=1, vco=2400000 khz, output=800000 khz  
PLL at FF7600A0: fbdiv=125, refdiv=1, postdiv1=3, postdiv2=1, vco=3000000 khz, output=1000000 khz  
PLL at FF760060: fbdiv=100, refdiv=1, postdiv1=3, postdiv2=1, vco=2400000 khz, output=800000 khz  
After clock init:                                                                                  
APLLL = 816000000                                                                                  
APLLB = 816000000                                                                                  
CPLL = 800000000                                                                                  
DPLL = 800000000                                                                                  
GPLL = 800000000                                                                                  
NPLL = 1000000000                                                                                  
VPLL = 24000000                                                                                    
PLL at FF760000: fbdiv=54, refdiv=1, postdiv1=1, postdiv2=1, vco=1296000 khz, output=1296000 khz  
PLL at FF760020: fbdiv=70, refdiv=1, postdiv1=1, postdiv2=1, vco=1680000 khz, output=1680000 khz
�������� : FROZEN : No more messages.
 
covacat :
it's not clear why it hangs....

This is why :

Nor should the material about building RK3399_SDK_UEFI.img also talk about the "efi esp" content, which is a separate thing.

In :

Number Start (sector) End (sector) Size Code Name
1 64 8063 3.9 MiB FFFF loader1 <-- Rk3399Pkg/Tools/Bin/idbloader.bin
2 8064 8191 64.0 KiB FFFF reserved1
3 8192 16383 4.0 MiB FFFF reserved2
4 16384 24575 4.0 MiB FFFF loader2 <-- RK3399_SDK_UEFI.img
5 24576 32767 4.0 MiB FFFF atf <-- Rk3399Pkg/Tools/Bin/trust.img
6 32768 262143 112.0 MiB EF00 efi esp

"efi esp" is a particular type of msdosfs file system that is to contain FreeBSD's EFI Boot Loader (FreeBSD aarch64 context used below, not what you were using):

EFI/BOOT/bootaa64.efi

That file is a copy of FreeBSD's aarch64 /boot/loader.efi :

# diff /boot/loader.efi /boot/efi/EFI/BOOT/bootaa64.efi

So: no differences. In the context for the above,/boot/efi is the mount point where the file system in the "efi esp" was mounted to be visible in the FreeBSD file system.

Note: the EFI/BOOT/ capitalization convention is my personal one, not necessarily what FreeBSD normally uses.

RK3399_SDK_UEFI looks for and finds that EFI/BOOT/bootaa64.efi and then loads and uses it.
 
still it should present the edk2 interface / setup or maybe say something about files missing on the esp.
im sure the rk356x one 'worked' without one
 
Remembering that this is the disk structure that I've got after having installed UEFI on the KHADAS Edge-V (that has a RockChip RK3399) :

Code:
Disk /dev/sdi: 119.08 GiB, 127865454592 bytes, 249737216 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: 6265BE94-368D-4AF4-B4B7-A866CF8B2CD9

Dispositivo Start   Fine Settori  Size Tipo
/dev/sdi1      64   8063    8000  3.9M Linux filesystem
/dev/sdi2    8064   8191     128   64K Linux filesystem
/dev/sdi3    8192  16383    8192    4M Linux filesystem
/dev/sdi4   16384  24575    8192    4M Linux filesystem
/dev/sdi5   24576  32767    8192    4M Linux filesystem
/dev/sdi6   32768 262143  229376  112M EFI System

I want also remember how I have obtained the partitions from sdi1 to sdi6 :

Code:
dd if=idbloader.img of=/dev/sdi1
dd if=RK3399_SDK_UEFI.img of=/dev/sdi4
dd if=trust.img of=/dev/sdi5
dd if=/dev/sdk1 of=/dev/sdi6

Regarding "sdi6",assuming that I should not do :

Code:
dd if=/dev/sdk1 of=/dev/sdi6

because sdk1 contained the u-boot that has been installed when I have installed FreeBSD on the RockPro64 board,I have removed it and I've created a new partition,of the same size and type and label (efi esp / fat16) copying the files that are stored on the same kind of partition but on the sd card where I have installed FreeBSD for the RockPro64. I repeat,without using dd,but only cp -r *.

I have started the serial connection and these are the log messages that I've got :

Code:
Welcome to minicom 2.9

OPTIONS: I18n
Port /dev/ttyUSB0, 11:28:12

Press CTRL-A Z for help on special keys
                       
Boot1: 2018-08-06, version: 1.15
CPUId = 0x0
ChipType = 0x10, 219
SdmmcInit=2 0
BootCapSize=100000
UserCapSize=29820MB
FwPartOffset=2000 , 100000
mmc0:cmd5,20
SdmmcInit=0 0
BootCapSize=0
UserCapSize=121942MB
FwPartOffset=2000 , 0                        
run on sd0                        
StorageInit ok = 96638                        
SecureMode = 0                        
SecureInit read PBA: 0x4                        
SecureInit read PBA: 0x404                        
SecureInit read PBA: 0x804                        
SecureInit read PBA: 0xc04                        
SecureInit read PBA: 0x1004                        
SecureInit read PBA: 0x1404                        
SecureInit read PBA: 0x1804                        
SecureInit read PBA: 0x1c04                        
SecureInit ret = 0, SecureMode = 0                        
GPT 0x3190d20 signature is wrong                        
LoadTrust Addr:0x4000                        
No find bl30.bin                        
No find bl32.bin                        
Load uboot, ReadLba = 2000                        
Load OK, addr=0x200000, size=0xf0000                       


RunBL31 0x10000                        
NOTICE: BL31: v1.3(debug):51f2096                        
NOTICE: BL31: Built : 16:24:31, May 6 2019
NOTICE: BL31: Rockchip release version: v1.1
INFO:    GICv3 with legacy support detected. ARM GICV3 driver initialized in EL3             
INFO: Using opteed sec cpu_context!                        
INFO: boot cpu mask: 0                        
INFO: plat_rockchip_pmu_init(1181): pd status 3e                        
INFO: BL31: Initializing runtime services
WARNING: No OPTEE provided by BL2 boot loader, Booting device without OPTEE initialization. SMC`s dK
ERROR: Error initializing runtime service opteed_fast
INFO: BL31: Preparing for EL3 exit to normal world
INFO: Entry point address = 0x200000                        
INFO: SPSR = 0x3c9                        
PLL at FF750000: fbdiv=112, refdiv=2, postdiv1=2, postdiv2=1, vco=1344000 khz, output=672000 khz
Boot PLLs:                        
APLLL = 400000000                        
APLLB = 24000000                        
CPLL = 24000000                        
DPLL = 800000000                        
GPLL = 400000000                        
NPLL = 24000000                        
VPLL = 24000000                        
PLL at FF760000: fbdiv=68, refdiv=1, postdiv1=2, postdiv2=1, vco=1632000 khz, output=816000 khz
PLL at FF760020: fbdiv=68, refdiv=1, postdiv1=2, postdiv2=1, vco=1632000 khz, output=816000 khz
PLL at FF760080: fbdiv=100, refdiv=1, postdiv1=3, postdiv2=1, vco=2400000 khz, output=800000 khz
PLL at FF7600A0: fbdiv=125, refdiv=1, postdiv1=3, postdiv2=1, vco=3000000 khz, output=1000000 khz
PLL at FF760060: fbdiv=100, refdiv=1, postdiv1=3, postdiv2=1, vco=2400000 khz, output=800000 khz
After clock init:                        
APLLL = 816000000                        
APLLB = 816000000                        
CPLL = 800000000                        
DPLL = 800000000                        
GPLL = 800000000                        
NPLL = 1000000000                        
VPLL = 24000000                        
PLL at FF760000: fbdiv=54, refdiv=1, postdiv1=1, postdiv2=1, vco=1296000 khz, output=1296000 khz
PLL at FF760020: fbdiv=70, refdiv=1, postdiv1=1, postdiv2=1, vco=1680000 khz, output=1680000 khz
�������� : HANG HERE FOREVER.

I think that If I have installed UEFI,I should NOT see this :

Code:
Load uboot, ReadLba = 2000
 
This is what happens if the efi partition is present but no files are inside of it :

Code:
Welcome to minicom 2.9

OPTIONS: I18n 
Port /dev/ttyUSB0, 13:26:58

Press CTRL-A Z for help on special keys
                                                                  
DDR Version 1.15 20181010                                         
In                                                               
Channel 0: LPDDR4,50MHz                                           
CS = 0                                                           
MR0=0x18
MR4=0x1
MR5=0x1
MR8=0x10
MR12=0x4D
MR14=0x4D
MR18=0x0
MR19=0x0                                                                                           
MR24=0x8                                                                                           
MR25=0x0                                                                                           
Bus Width=32 Col=10 Bank=8 Row=16 CS=1 Die Bus-Width=16 Size=2048MB                                 
Channel 1: LPDDR4,50MHz                                                                             
CS = 0                                                                                             
MR0=0x18                                                                                           
MR4=0x1                                                                                             
MR5=0x1                                                                                             
MR8=0x10                                                                                           
MR12=0x4D                                                                                           
MR14=0x4D                                                                                           
MR18=0x0                                                                                           
MR19=0x0                                                                                           
MR24=0x8                                                                                           
MR25=0x0                                                                                           
Bus Width=32 Col=10 Bank=8 Row=16 CS=1 Die Bus-Width=16 Size=2048MB                                 
256B stride                                                                                         
channel 0                                                                                           
CS = 0                                                                                             
MR0=0x18                                                                                           
MR4=0x1                                                                                             
MR5=0x1                                                                                             
MR8=0x10                                                                                           
MR12=0x72                                                                                           
MR14=0x72                                                                                           
MR18=0x0                                                                                           
MR19=0x0                                                                                           
MR24=0x8                                                                                           
MR25=0x0                                                                                           
channel 1                                                                                           
CS = 0                                                                                             
MR0=0x18                                                                                           
MR4=0x1                                                                                             
MR5=0x1                                                                                             
MR8=0x10                                                                                           
MR12=0x72                                                                                           
MR14=0x72                                                                                           
MR18=0x0                                                                                           
MR19=0x0                                                                                           
MR24=0x8                                                                                           
MR25=0x0                                                                                           
channel 0 training pass!                                                                           
channel 1 training pass!                                                                           
change freq to 400MHz 0,1                                                                           
channel 0                                                                                           
CS = 0                                                                                             
MR0=0x18                                                                                           
MR4=0x1                                                                                             
MR5=0x1                                                                                             
MR8=0x10                                                                                           
MR12=0x72                                                                                           
MR14=0x72                                                                                           
MR18=0x0                                                                                           
MR19=0x0                                                                                           
MR24=0x8                                                                                           
MR25=0x0                                                                                           
channel 1                                                                                           
CS = 0                                                                                             
MR0=0x18                                                                                           
MR4=0x1                                                                                             
MR5=0x1                                                                                             
MR8=0x10                                                                                           
MR12=0x72                                                                                           
MR14=0x72                                                                                           
MR18=0x0                                                                                           
MR19=0x0                                                                                           
MR24=0x8                                                                                           
MR25=0x0                                                                                           
channel 0 training pass!                                                                           
channel 1 training pass!                                                                           
change freq to 800MHz 1,0                                                                           
ch 0 ddrconfig = 0x101, ddrsize = 0x40                                                             
ch 1 ddrconfig = 0x101, ddrsize = 0x40                                                             
pmugrf_os_reg[2] = 0x32C1F2C1, stride = 0xD                                                         
OUT                                                                                                 
Boot1: 2018-08-06, version: 1.15                                                                   
CPUId = 0x0                                                                                         
ChipType = 0x10, 219                                                                               
SdmmcInit=2 0                                                                                       
BootCapSize=100000                                                                                 
UserCapSize=29820MB                                                                                 
FwPartOffset=2000 , 100000                                                                         
mmc0:cmd5,20                                                                                       
SdmmcInit=0 0                                                                                       
BootCapSize=0                                                                                       
UserCapSize=121942MB                                                                               
FwPartOffset=2000 , 0                                                                               
run on sd0                                                                                         
StorageInit ok = 96572                                                                             
SecureMode = 0                                                                                     
SecureInit read PBA: 0x4                                                                           
SecureInit read PBA: 0x404                                                                         
SecureInit read PBA: 0x804                                                                         
SecureInit read PBA: 0xc04                                                                         
SecureInit read PBA: 0x1004                                                                         
SecureInit read PBA: 0x1404                                                                         
SecureInit read PBA: 0x1804                                                                         
SecureInit read PBA: 0x1c04                                                                         
SecureInit ret = 0, SecureMode = 0                                                                 
GPT 0x3190d20 signature is wrong                                                                   
LoadTrust Addr:0x4000                                                                               
No find bl30.bin                                                                                   
No find bl32.bin                                                                                   
Load uboot, ReadLba = 2000                                                                         
Load OK, addr=0x200000, size=0xf0000                                                               
RunBL31 0x10000                                                                                     
NOTICE:  BL31: v1.3(debug):51f2096                                                                 
NOTICE:  BL31: Built : 16:24:31, May  6 2019                                                       
NOTICE:  BL31: Rockchip release version: v1.1                                                       
INFO:    GICv3 with legacy support detected. ARM GICV3 driver initialized in EL3                   
INFO:    Using opteed sec cpu_context!                                                             
INFO:    boot cpu mask: 0                                                                           
INFO:    plat_rockchip_pmu_init(1181): pd status 3e                                                 
INFO:    BL31: Initializing runtime services                                                       
WARNING: No OPTEE provided by BL2 boot loader, Booting device without OPTEE initialization. SMC`s dK
ERROR:   Error initializing runtime service opteed_fast                                             
INFO:    BL31: Preparing for EL3 exit to normal world                                               
INFO:    Entry point address = 0x200000                                                             
INFO:    SPSR = 0x3c9                                                                               
PLL at FF750000: fbdiv=112, refdiv=2, postdiv1=2, postdiv2=1, vco=1344000 khz, output=672000 khz   
Boot PLLs:                                                                                         
APLLL = 400000000                                                                                   
APLLB = 24000000                                                                                   
CPLL = 24000000                                                                                     
DPLL = 800000000                                                                                   
GPLL = 400000000                                                                                   
NPLL = 24000000                                                                                     
VPLL = 24000000                                                                                     
PLL at FF760000: fbdiv=68, refdiv=1, postdiv1=2, postdiv2=1, vco=1632000 khz, output=816000 khz     
PLL at FF760020: fbdiv=68, refdiv=1, postdiv1=2, postdiv2=1, vco=1632000 khz, output=816000 khz     
PLL at FF760080: fbdiv=100, refdiv=1, postdiv1=3, postdiv2=1, vco=2400000 khz, output=800000 khz   
PLL at FF7600A0: fbdiv=125, refdiv=1, postdiv1=3, postdiv2=1, vco=3000000 khz, output=1000000 khz   
PLL at FF760060: fbdiv=100, refdiv=1, postdiv1=3, postdiv2=1, vco=2400000 khz, output=800000 khz   
After clock init:                                                                                   
APLLL = 816000000                                                                                   
APLLB = 816000000                                                                                   
CPLL = 800000000                                                                                   
DPLL = 800000000                                                                                   
GPLL = 800000000                                                                                   
NPLL = 1000000000                                                                                   
VPLL = 24000000                                                                                     
PLL at FF760000: fbdiv=54, refdiv=1, postdiv1=1, postdiv2=1, vco=1296000 khz, output=1296000 khz   
PLL at FF760020: fbdiv=70, refdiv=1, postdiv1=1, postdiv2=1, vco=1680000 khz, output=1680000 khz
��������� : STUCK here.
 
It seems to me that the efi partition should be empty.

covacat : do you think that the error "GPT 0x3190d20 signature is wrong" could be relevant ?
 
it's not. if you google search for it you will find successful boot logs with that message

This kind of lines :

Code:
PLL at FF760020: fbdiv=70, refdiv=1, postdiv1=1, postdiv2=1, vco=1680000 khz, output=1680000 khz

that stops suddenly remembers to me the error that you have talked about some days ago,related to the bug of the frequency,but is was on the Radxa board,not on the Khadas / RK3399...related the missing of the iommu...
 
well that pll bug should only matter on smalish "non standard" hdmi resolutions and you should probably get a fuxed up display not a total hang
 
What about these interesting lines ?

Code:
No find bl30.bin
No find bl32.bin

And in your opinion,it makes sense to load uboot when I've installed UEFI ?

Code:
Load uboot, ReadLba = 2000

It seems that UEFI fails because it does not find bl30.bin / bl32.bin and then u-boot is called ? But where is stored u-boot ?
 
bl3x bin is arm trusted firmware. bl31 is usually ok, boards work without bl32 (optee)
ATF exports various apis that kernel can use
the starting u-boot string may be hardwired in idbloader.bin (which probably has the same origin with u-boot)
anyway ATF seems to run ok and then spl/tpl does not seem work
spl/tpl (second/third program loader)
 
From the ML :

Per the above, your GPT is still messed up.

> LoadTrust Addr:0x4000
> No find bl30.bin
> No find bl32.bin
> Load uboot, ReadLba = 2000
> Load OK, addr=0x200000, size=0xf0000

Per the above 2 lines, you still have U-Boot
in place and it is found, loaded, and used.

you have different opinions about the messages displayed....
 
Back
Top