Pre-built U-boot for Odroid C4

Post Reply
jgmdev
Posts: 368
Joined: Tue Jan 28, 2020 2:28 pm
languages_spoken: english, spanish
ODROIDs: U2, N2, N2+, C4, HC4
Has thanked: 151 times
Been thanked: 262 times
Contact:

Pre-built U-boot for Odroid C4

Post by jgmdev »

Just in case some one doesn't wants to go into the process of setting up the environment to build the u-boot binary, which requires x86 and old toolchain. I uploaded it to my github repository:

https://github.com/jgmdev/archlinux-odr ... -odroid-c4
These users thanked the author jgmdev for the post:
Mullcom (Thu May 21, 2020 6:54 am)

User avatar
tobetter
Posts: 8845
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 516 times
Been thanked: 1410 times
Contact:

Re: Pre-built U-boot for Odroid C4

Post by tobetter »

Just in case anyone wants to get the latest U-boot whenever HK changes the U-boot for ODROID-C4, you can download it from the release page. :D
https://github.com/hardkernel/u-boot/releases
These users thanked the author tobetter for the post (total 2):
jgmdev (Sat May 30, 2020 2:27 am) • meveric (Fri Jun 05, 2020 12:51 am)

jgmdev
Posts: 368
Joined: Tue Jan 28, 2020 2:28 pm
languages_spoken: english, spanish
ODROIDs: U2, N2, N2+, C4, HC4
Has thanked: 151 times
Been thanked: 262 times
Contact:

Re: Pre-built U-boot for Odroid C4

Post by jgmdev »

tobetter wrote:
Thu May 21, 2020 7:08 am
Just in case anyone wants to get the latest U-boot whenever HK changes the U-boot for ODROID-C4, you can download it from the release page. :D
https://github.com/hardkernel/u-boot/releases
Just now I noticed those aren't only source releases but binary builds! Thanks a lot! I should now update my package to point to them :)

fvolk
Posts: 651
Joined: Sun Jun 05, 2016 11:04 pm
languages_spoken: english
ODROIDs: C2, C4, H2
Has thanked: 0
Been thanked: 79 times
Contact:

Re: Pre-built U-boot for Odroid C4

Post by fvolk »

uuhh... at https://github.com/hardkernel/u-boot/releases
where is the binary for C4 - I think I only see sources? Am I overlooking something?
And what's the correct dd command to write this image then to microsd?

User avatar
tobetter
Posts: 8845
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 516 times
Been thanked: 1410 times
Contact:

Re: Pre-built U-boot for Odroid C4

Post by tobetter »

Please use this command in order to download the prebuilt U-boot for ODROID-C4, this will download the latest prebuilt tarball.

Code: Select all

wget `curl -sL https://api.github.com/repos/hardkernel/u-boot/releases | grep download_url | awk -F'"' '{print $4}' | grep travis\/odroidc4 | grep u-boot-odroidc4`
Your memory card can be flashed with the script 'sd_fusing.sh' after extracting the tarball.

fvolk
Posts: 651
Joined: Sun Jun 05, 2016 11:04 pm
languages_spoken: english
ODROIDs: C2, C4, H2
Has thanked: 0
Been thanked: 79 times
Contact:

Re: Pre-built U-boot for Odroid C4

Post by fvolk »

Thank you!

But looking again now, I looked at travis/odroidc4-118 as this appears to be the latest version, but this is only sources,
whereas travis/odroidc4-112 contains sources AND the uboot binary.
That's why I couldn't find it... oops

User avatar
tobetter
Posts: 8845
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 516 times
Been thanked: 1410 times
Contact:

Re: Pre-built U-boot for Odroid C4

Post by tobetter »

fvolk wrote:
Mon Jun 08, 2020 4:28 pm
Thank you!

But looking again now, I looked at travis/odroidc4-118 as this appears to be the latest version, but this is only sources,
whereas travis/odroidc4-112 contains sources AND the uboot binary.
That's why I couldn't find it... oops
I've retriggered the build and ODROID-N2/C4 have a new tag *-127.
Screenshot from 2020-06-08 17-13-15.png
Screenshot from 2020-06-08 17-13-15.png (124.44 KiB) Viewed 1741 times

Sebas_Ledesma
Posts: 227
Joined: Thu Jun 08, 2017 2:49 am
languages_spoken: english
ODROIDs: C4, C2, C1+
Has thanked: 45 times
Been thanked: 19 times
Contact:

Re: Pre-built U-boot for Odroid C4

Post by Sebas_Ledesma »

Anyone have instructions on how to compile U-boot using the C4 toolchain ?

User avatar
tobetter
Posts: 8845
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 516 times
Been thanked: 1410 times
Contact:

Re: Pre-built U-boot for Odroid C4

Post by tobetter »

Sebas_Ledesma wrote:
Tue Nov 30, 2021 4:29 am
Anyone have instructions on how to compile U-boot using the C4 toolchain ?
Did you refer to this link?
https://wiki.odroid.com/odroid-c4/softw ... ing_u-boot
These users thanked the author tobetter for the post:
Sebas_Ledesma (Tue Nov 30, 2021 4:38 am)

Sebas_Ledesma
Posts: 227
Joined: Thu Jun 08, 2017 2:49 am
languages_spoken: english
ODROIDs: C4, C2, C1+
Has thanked: 45 times
Been thanked: 19 times
Contact:

Re: Pre-built U-boot for Odroid C4

Post by Sebas_Ledesma »

The wiki indicates: "U-boot must be cross-compiled on an x86 Linux PC."
I dont have a x86 Linux machine (sorry for that), so I wanted to use the same Odroid-C4 to build UBoot.

User avatar
mad_ady
Posts: 10149
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 632 times
Been thanked: 815 times
Contact:

Re: Pre-built U-boot for Odroid C4

Post by mad_ady »

You can use qemu with binfmt to run the x86_64 binary needed to build (or sign?) uboot directly on arm64.
These users thanked the author mad_ady for the post:
Sebas_Ledesma (Tue Nov 30, 2021 4:58 am)

User avatar
tobetter
Posts: 8845
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 516 times
Been thanked: 1410 times
Contact:

Re: Pre-built U-boot for Odroid C4

Post by tobetter »

Sebas_Ledesma wrote:
Tue Nov 30, 2021 4:41 am
The wiki indicates: "U-boot must be cross-compiled on an x86 Linux PC."
I dont have a x86 Linux machine (sorry for that), so I wanted to use the same Odroid-C4 to build UBoot.
The reason to use cross-compiled is not about U-Boot actually, there is a tool from Amlogic fip/fip_create which is x86 executable, no ARM64 version. I guess there is open source tool for mainline U-Boot, but never used it.

If you do not have x86 machine, alternative option is to use Travis or other CI service which build a code in given Github. The Pre-built U-Boot uploaded to Hardkernel's U-Boot release in Github is also built with Travis, you will need to know how to set up / wire between Github and Travis. This is the Travis recipe for U-Boot.
https://github.com/hardkernel/u-boot/bl ... travis.yml

Sebas_Ledesma
Posts: 227
Joined: Thu Jun 08, 2017 2:49 am
languages_spoken: english
ODROIDs: C4, C2, C1+
Has thanked: 45 times
Been thanked: 19 times
Contact:

Re: Pre-built U-boot for Odroid C4

Post by Sebas_Ledesma »

Thanks, perhaps mkimage (https://linux.die.net/man/1/mkimage) can be used instead of fip_create .
As alternative I'm also considering a virtual machine (I'm using an i7 so performance degratation can be acceptable).

User avatar
tobetter
Posts: 8845
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 516 times
Been thanked: 1410 times
Contact:

Re: Pre-built U-boot for Odroid C4

Post by tobetter »

Sebas_Ledesma wrote:
Tue Nov 30, 2021 5:01 am
Thanks, perhaps mkimage (https://linux.die.net/man/1/mkimage) can be used instead of fip_create .
As alternative I'm also considering a virtual machine (I'm using an i7 so performance degratation can be acceptable).
Nope, fip_create is a tool to grab scattered boot blobs and put them into single binary with their hash values. mkimage is a tool to convert a binary to U-Boot format. They are different tools.
These users thanked the author tobetter for the post (total 2):
Sebas_Ledesma (Tue Nov 30, 2021 8:44 am) • odroid (Tue Nov 30, 2021 9:37 am)

Sebas_Ledesma
Posts: 227
Joined: Thu Jun 08, 2017 2:49 am
languages_spoken: english
ODROIDs: C4, C2, C1+
Has thanked: 45 times
Been thanked: 19 times
Contact:

Re: Pre-built U-boot for Odroid C4

Post by Sebas_Ledesma »

I've managed to use one local file server wichs run Ubuntu (Linux server2 5.4.0-91-generic #102-Ubuntu SMP Fri Nov 5 16:31:28 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux) and followed the instructions in the wiki https://wiki.odroid.com/odroid-c4/softw ... ing_u-boot
I've opted to download Linaro GCC aarch64-none-elf 4.8 2013.11 (as the wiki says picks one) and after following the instructions I've ended with a 'u-boot.ini' in the ~/u-boot/build directory.
Thanks to all, i will create another post relating my experiences with custom u-boot.

chewitt
Posts: 155
Joined: Mon Aug 12, 2019 12:27 pm
languages_spoken: english
Has thanked: 1 time
Been thanked: 121 times
Contact:

Re: Pre-built U-boot for Odroid C4

Post by chewitt »

There are two options for signing without Amlogic's x86_64 binaries:

https://github.com/angerman/meson64-tools <= written for G12B, but should work with SM1 as well (since they are essentially the same)
https://github.com/repk/gxlimg/pull/16 <= which is active WIP but will also work.

Enjoy :)
These users thanked the author chewitt for the post:
Sebas_Ledesma (Wed Dec 01, 2021 4:11 am)

User avatar
rooted
Posts: 8985
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 744 times
Been thanked: 421 times
Contact:

Re: Pre-built U-boot for Odroid C4

Post by rooted »

Thanks for the links.

fvolk
Posts: 651
Joined: Sun Jun 05, 2016 11:04 pm
languages_spoken: english
ODROIDs: C2, C4, H2
Has thanked: 0
Been thanked: 79 times
Contact:

Re: Pre-built U-boot for Odroid C4

Post by fvolk »

I'm feeling adventurous to try an upstream u-boot build again to check whether netboot (viewtopic.php?f=207&t=39322) has magically fixed/stabilized itself meanwhile.
I see the tools above, but am not versed in u-boot terminology.

Is there a complete step-by-step guide to build&flash a u-boot binary for C4 from upstream sources?

chewitt
Posts: 155
Joined: Mon Aug 12, 2019 12:27 pm
languages_spoken: english
Has thanked: 1 time
Been thanked: 121 times
Contact:

Re: Pre-built U-boot for Odroid C4

Post by chewitt »

fvolk wrote:
Thu Dec 23, 2021 7:46 pm
Is there a complete step-by-step guide to build&flash a u-boot binary for C4 from upstream sources?
Yes, in u-boot public documentation: https://u-boot.readthedocs.io/en/latest ... id-c4.html

LE has the FIP sources for signing pre-extracted here: https://github.com/LibreELEC/amlogic-boot-fip

If you just want to test, here's a pre-built 2021.10 binary: https://chewitt.libreelec.tv/testing/u- ... -odroid-c4

Sources for the binary are 2021.10 + backports and a couple of WIP things that don't touch C4: https://github.com/chewitt/u-boot/commi ... ic-2021.10
These users thanked the author chewitt for the post:
odroid (Fri Dec 31, 2021 10:06 am)

fvolk
Posts: 651
Joined: Sun Jun 05, 2016 11:04 pm
languages_spoken: english
ODROIDs: C2, C4, H2
Has thanked: 0
Been thanked: 79 times
Contact:

Re: Pre-built U-boot for Odroid C4

Post by fvolk »

Thank you for the prebuilt!

Code: Select all

U-Boot 2021.10 (Dec 15 2021 - 03:23:38 +0000) odroid-c4/hc4                                                                                                                                                            
                                                                                                                                                                                                                       
Model: Hardkernel ODROID-C4                                                                                                                                                                                            
SoC:   Amlogic Meson SM1 (S905X3) Revision 2b:c (10:2)                                                                                                                                                                 
DRAM:  3.8 GiB                                                                                                                                                                                                         
....
I can report netboot works now with 100% of my C4 so far - not the 50%/50% chance that it works like with Hardkernel's original uboot (viewtopic.php?f=207&t=39322)

However there is one annoying problem:
green.jpg
green.jpg (99.24 KiB) Viewed 203 times
Screen has green background and text is also quite colorful.
This does not happen with Hardkernel's uboot, tested with 5.15 kernel and 5.10 kernel.

Also, 5.15 had some .config changes with framebuffer (devices) and I feel video comes up late in boot process - what are the kernel config options for 5.15 to init video earliest in boot process to see boot messages?

User avatar
rooted
Posts: 8985
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 744 times
Been thanked: 421 times
Contact:

Re: Pre-built U-boot for Odroid C4

Post by rooted »

Seems like I just saw someone mention a similar thing and it was because the framebuffer module wasn't included in initrd

fvolk
Posts: 651
Joined: Sun Jun 05, 2016 11:04 pm
languages_spoken: english
ODROIDs: C2, C4, H2
Has thanked: 0
Been thanked: 79 times
Contact:

Re: Pre-built U-boot for Odroid C4

Post by fvolk »

rooted wrote:
Mon Jan 03, 2022 6:18 am
Seems like I just saw someone mention a similar thing and it was because the framebuffer module wasn't included in initrd
That comes back to the changes with framebuffer/video in 5.15.
Let's forget about 5.10, what modules in 5.15 I have to compile-in for video and that should be it?

fvolk
Posts: 651
Joined: Sun Jun 05, 2016 11:04 pm
languages_spoken: english
ODROIDs: C2, C4, H2
Has thanked: 0
Been thanked: 79 times
Contact:

Re: Pre-built U-boot for Odroid C4

Post by fvolk »

Flashed @chewitt's Jan 10 build of u-boot - no change - but this build still originates from 2021.10, a new u-boot will be out soon?
Tried also tobetter's 5.16 tree from Jan 11 instead of 5.15 - no change.
Tried to compile-in video modules - no change - admittedly I'm not sure what makes sense.

Summary: With newest u-boot netboot works now on ALL C4 I have tested so far :-),
but text console screen is green :-( independent of kernel version.
Havn't tried X.

If I'm missing a magic config option for u-boot or kernel, please share.. :-)

chewitt
Posts: 155
Joined: Mon Aug 12, 2019 12:27 pm
languages_spoken: english
Has thanked: 1 time
Been thanked: 121 times
Contact:

Re: Pre-built U-boot for Odroid C4

Post by chewitt »

@fvolk see if this LE image exhibits the same problem https://chewitt.libreelec.tv/testing/Li ... -c4.img.gz .. If yes, it's probably something in kernel DRM bits at fault (but no idea what). If no, it's something in your kernel sources or defconfig.

NB: I bumped u-boot to 2022.01 so pre-builts in https://chewitt.libreelec.tv/testing/u-boot are also updated, but I don't think that's the issue here.

fvolk
Posts: 651
Joined: Sun Jun 05, 2016 11:04 pm
languages_spoken: english
ODROIDs: C2, C4, H2
Has thanked: 0
Been thanked: 79 times
Contact:

Re: Pre-built U-boot for Odroid C4

Post by fvolk »

chewitt wrote:
Sun Jan 16, 2022 6:54 pm
if this LE image exhibits the same problem https://chewitt.libreelec.tv/testing/Li ... -c4.img.gz
bumped u-boot to 2022.01
Thank you for the images for testing!

Updated u-boot - still green screen.
Tried LE image - no green screen. But I know now what LE/Kodi is :-)

Since I get a green screen only with new u-boot and kernel 5.10, 5.15, 5.16,
but normal black screen with Hardkernel uboot and kernel 5.10, 5.15, 5.16,
I still consider new u-boot does something with video init different?
Or new uboot does something less and my system startup process is missing something for robust video init?
Hmm.... And how was your Sunday? ;-)

chewitt
Posts: 155
Joined: Mon Aug 12, 2019 12:27 pm
languages_spoken: english
Has thanked: 1 time
Been thanked: 121 times
Contact:

Re: Pre-built U-boot for Odroid C4

Post by chewitt »

@fvolk what kernel sources are you using? .. what happens if you use a kernel built from my sources? https://github.com/chewitt/linux/commits/amlogic-5.16.y

Post Reply

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 1 guest