Buildroot for ODROID-C1+/C0

Post Reply
User avatar
Brian.K
Posts: 246
Joined: Tue Sep 15, 2015 7:30 pm
languages_spoken: English, Korean
ODROIDs: XU4, C1+, C2
Location: South Korea
Has thanked: 0
Been thanked: 0
Contact:

Buildroot for ODROID-C1+/C0

Unread post by Brian.K » Wed Dec 21, 2016 5:33 pm

Buildroot for ODROID-C1+/C0
To be able to use ODROID-C1+/C0 board with the images generated by Buildroot, you have to prepare the SDCard or eMMC.

Getting the buildroot for ODROID-C1+/C0

Code: Select all

$ git clone --depth 1 https://github.com/hardkernel/buildroot.git
Note: additional cross-compiler is needed for u-boot compile

Code: Select all

$ wget http://releases.linaro.org/archive/14.09/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.9-2014.09_linux.tar.xz
$ sudo tar Jxvf gcc-linaro-arm-none-eabi-4.9-2014.09_linux.tar.xz -C /opt/toolchains/
$ export ARCH=arm
$ export CROSS_COMPILE=arm-none-eabi-
$ export PATH=/opt/toolchains/gcc-linaro-arm-none-eabi-4.9-2014.09_linux/bin/:$PATH
How to build it

Code: Select all

$ cd buildroot
$ make odroidc1_defconfig
Then you can edit the build options using

Code: Select all

$ make menuconfig
Compile all and build rootfs image:

Code: Select all

$ make
Note: you will need to have access to the network, since Buildroot will download the packages' sources.

Result of the build
After building, you should obtain this tree:

output/images/
+-- Image
+-- boot.ini [1]
+-- boot.vfat
+-- meson8b_odroidc.dtb
+-- rootfs.ext2
+-- rootfs.ext4
+-- rootfs.tar
+-- sdcard.img
+-- bl1.bin.hardkernel
+-- sd_fusing.sh
`-- u-boot.bin

[1] This is the ODROID-C1+/C0 configuration file used in u-boot.

How to write the SD card or eMMC
Once the build process is finished you will have an image called "sdcard.img" in the output/images/ directory.

Copy the bootable "sdcard.img" onto an SD card or eMMC with "dd":

Code: Select all

$ sudo dd if=output/images/sdcard.img of=/dev/sdX conv=fsync
Insert the SDcard or eMMC into your ODROID-C2, and power it up. Your new system should come up now.

2016.12 Release
Changes since 2016.11
* ODROID-C1+/C0 support
* Some changes for c2play package

Appendix A: c2play command line video player
This appendix demonstrates how to use c2play. ( For non-X platforms only )

Code: Select all

Usage: c2play <media file>
* c2play forum thread: http://forum.odroid.com/viewtopic.php?f=136&t=23143
* Youtube demo: https://youtu.be/rocCTcPPBO0

Appendix B: Appendix B: Mali and QT5 Test Procedures
* Mali examples: ( For non-X platforms only )
There are a couple Mali execution examples under /usr/share/arm/OpenGL-ES-2.0

Code: Select all

# cd /usr/share/arm/opengles_20/cube
# ./cube
* QT5 examples:
QT5 demos are located under /usr/lib/qt/examples

Code: Select all

# cd /usr/lib/qt/examples/widgets/animation/animatedtiles
# ./animatedtiles
# cd /usr/lib/qt/examples/gui/openglwindow
# ./openglwindow
Reference
Buildroot for ODROID-C2

User avatar
Brian.K
Posts: 246
Joined: Tue Sep 15, 2015 7:30 pm
languages_spoken: English, Korean
ODROIDs: XU4, C1+, C2
Location: South Korea
Has thanked: 0
Been thanked: 0
Contact:

Re: Buildroot for ODROID-C1+/C0

Unread post by Brian.K » Thu Dec 22, 2016 10:33 am

Pre-built image download link
md5sum: 7787b2755eea597c91829e0d51920ad6 sdcard.img

linuxest
Posts: 43
Joined: Tue Nov 08, 2016 6:35 pm
languages_spoken: english
ODROIDs: 1 x HC1 and 2 x C2s with HiFi-Shield 2
And some RPi3 boards
Has thanked: 0
Been thanked: 0
Contact:

Re: Buildroot for ODROID-C1+/C0

Unread post by linuxest » Thu Dec 22, 2016 10:58 am

Great item for my Christmas holidays :ugeek:

One question.
How long time do you need to start an h264/mpeg4 video playback with c2player from power-on trigger?

One more question. Should I follow your instructions on my C1+? or x86 linux PC?

User avatar
Brian.K
Posts: 246
Joined: Tue Sep 15, 2015 7:30 pm
languages_spoken: English, Korean
ODROIDs: XU4, C1+, C2
Location: South Korea
Has thanked: 0
Been thanked: 0
Contact:

Re: Buildroot for ODROID-C1+/C0

Unread post by Brian.K » Thu Dec 22, 2016 1:45 pm

linuxest wrote:Great item for my Christmas holidays :ugeek:

One question.
How long time do you need to start an h264/mpeg4 video playback with c2player from power-on trigger?
17~20 seconds on default configuration.
About 15 seconds with 'bootdelay 0' and 'quite' boot parameter. (ref> Basic improving boot time guide)
linuxest wrote: One more question. Should I follow your instructions on my C1+? or x86 linux PC?
You should follow the instructions on x86_64 PC(a.k.a> cross-compiling).
Buildroot cannot support native compile. Although it is possible to compile on C1+, the build time is a terribly long.

emu_can
Posts: 24
Joined: Tue Sep 06, 2016 2:06 pm
languages_spoken: english
ODROIDs: Several C2 boards.
2 x C0, 2 x XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: Buildroot for ODROID-C1+/C0

Unread post by emu_can » Thu Dec 22, 2016 6:26 pm

Thank you for making this great thing!

But I couldn't compile the u-boot.

Code: Select all

Try 'dirname --help' for more information.
Generating /home/j/buildroot/output/build/uboot-odroidc-v2011.03/build/include/autoconf.mk.dep
/bin/bash: line 3: arm-none-eabi-gcc: command not found
/bin/bash: arm-none-eabi-gcc: command not found
/bin/bash: arm-none-eabi-gcc: command not found
dirname: missing operand
please let me know what I missed.
I could build other stuff with arm-linux-gnueabihf-gcc.
But I have no arm-none-eabi-gcc. :(

linuxest
Posts: 43
Joined: Tue Nov 08, 2016 6:35 pm
languages_spoken: english
ODROIDs: 1 x HC1 and 2 x C2s with HiFi-Shield 2
And some RPi3 boards
Has thanked: 0
Been thanked: 0
Contact:

Re: Buildroot for ODROID-C1+/C0

Unread post by linuxest » Thu Dec 22, 2016 7:05 pm

@Brian.K
Thank you for the information.
I could build it on my laptop.

@emu_can
Carefully check the path of the cross-compiler. Look at the opening post again.

cooler_ranch
Posts: 3
Joined: Thu Jul 20, 2017 2:34 am
languages_spoken: english
ODROIDs: C1+
Has thanked: 0
Been thanked: 0
Contact:

Re: Buildroot for ODROID-C1+/C0

Unread post by cooler_ranch » Thu Jul 20, 2017 3:18 am

Is this guide still current? I have been having difficulties running this within the buildroot-provided vagrant file. I am typically getting issues with make being unable to execute the cross-compiler (despite following the directions posted before).

Thanks in advance for the sanity-check.

User avatar
odroid
Site Admin
Posts: 30672
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 13 times
Been thanked: 98 times
Contact:

Re: Buildroot for ODROID-C1+/C0

Unread post by odroid » Thu Jul 20, 2017 10:00 am

@cooler_ranch,
Show us the error message while you tried the buildroot.

cooler_ranch
Posts: 3
Joined: Thu Jul 20, 2017 2:34 am
languages_spoken: english
ODROIDs: C1+
Has thanked: 0
Been thanked: 0
Contact:

Re: Buildroot for ODROID-C1+/C0

Unread post by cooler_ranch » Fri Jul 21, 2017 12:22 am

odroid wrote:@cooler_ranch,
Show us the error message while you tried the buildroot.
Sure thing. For context, here is what I have changed in menuconfig:
- add target packages
- shell and utilities -> add zsh
- text editors and viewers -> add emacs

- toolchain
-toolchain type -> external toolchain
- toolchain -> custom toolchain
- toolchain origin -> pre-installed toolchain
- toolchain path -> /opt/toolchains/gcc-linaro-arm-none-eabi-4.9-2014.09_linux
- toolchain prefix -> arm-none-eabi
- external toolchain gcc version -> 4.9.x
- external toolchain kernel headers series -> 3.10.x
- toolchain has WCHAR support? -> selected
- legacy config options
- remove qt5quick1 package (it warns that I will get errors with legacy packages that have been removed)

Otherwise, everything else is the same as the instructions. When I run with just these configurations set (everything else set automatically), I get this error:
(note: I renamed the git repo from buildroot to buildroot_odroid since I am doing something else on this vm with another version of buildroot)

Code: Select all

 vagrant@vagrant:~/buildroot_odroid$ make
/usr/bin/make -j1  HOSTCC="/usr/bin/gcc" HOSTCXX="/usr/bin/g++" silentoldconfig
BR2_DEFCONFIG='' KCONFIG_AUTOCONFIG=/home/vagrant/buildroot_odroid/output/build/buildroot-config/auto.conf KCONFIG_AUTOHEADER=/home/vagrant/buildroot_odroid/output/build/buildroot-config/autoconf.h KCONFIG_TRISTATE=/home/vagrant/buildroot_odroid/output/build/buildroot-config/tristate.config BR2_CONFIG=/home/vagrant/buildroot_odroid/.config BR2_EXTERNAL=support/dummy-external HOST_GCC_VERSION="5" SKIP_LEGACY= /home/vagrant/buildroot_odroid/output/build/buildroot-config/conf --silentoldconfig Config.in
#
# configuration written to /home/vagrant/buildroot_odroid/.config
#
>>> toolchain-external undefined Configuring
Cannot execute cross-compiler '/opt/toolchains/gcc-linaro-arm-none-eabi-4.9-2014.09_linux/bin/arm-none-eabi-gcc'
package/pkg-generic.mk:185: recipe for target '/home/vagrant/buildroot_odroid/output/build/toolchain-external-undefined/.stamp_configured' failed
make[1]: *** [/home/vagrant/buildroot_odroid/output/build/toolchain-external-undefined/.stamp_configured] Error 1
Makefile:36: recipe for target '_all' failed
make: *** [_all] Error 2 
And checking to see if arm-none-eabi-gcc exists shows it exists where make was looking:

Code: Select all

 vagrant@vagrant:~/buildroot_odroid$ ls /opt/toolchains/gcc-linaro-arm-none-eabi-4.9-2014.09_linux/bin/
arm-none-eabi-addr2line  arm-none-eabi-ct-ng.config  arm-none-eabi-gcc-ar      arm-none-eabi-gprof    arm-none-eabi-objdump          arm-none-eabi-strings
arm-none-eabi-ar         arm-none-eabi-dwp           arm-none-eabi-gcc-nm      arm-none-eabi-ld       arm-none-eabi-pkg-config       arm-none-eabi-strip
arm-none-eabi-as         arm-none-eabi-elfedit       arm-none-eabi-gcc-ranlib  arm-none-eabi-ld.bfd   arm-none-eabi-pkg-config-real
arm-none-eabi-c++        arm-none-eabi-g++           arm-none-eabi-gcov        arm-none-eabi-ld.gold  arm-none-eabi-ranlib
arm-none-eabi-c++filt    arm-none-eabi-gcc           arm-none-eabi-gdb         arm-none-eabi-nm       arm-none-eabi-readelf
arm-none-eabi-cpp        arm-none-eabi-gcc-4.9.2     arm-none-eabi-gfortran    arm-none-eabi-objcopy  arm-none-eabi-size
vagrant@vagrant:~/buildroot_odroid$ echo $PATH
/opt/toolchains/gcc-linaro-arm-none-eabi-4.9-2014.09_linux/bin/:/home/vagrant/bin:/home/vagrant/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games 
I have tried some other toolchains with different results, but I figured this is the best starting point since it's the path where directions are followed best :). If you have any advice or can spot any of my (likely many) rookie mistakes, I would love to hear it. Thanks again for taking a look.

User avatar
Brian.K
Posts: 246
Joined: Tue Sep 15, 2015 7:30 pm
languages_spoken: English, Korean
ODROIDs: XU4, C1+, C2
Location: South Korea
Has thanked: 0
Been thanked: 0
Contact:

Re: Buildroot for ODROID-C1+/C0

Unread post by Brian.K » Fri Jul 21, 2017 3:09 pm

Could you use default toolchain configuration? (a.k.a> BR2_TOOLCHAIN_EXTERNAL_LINARO_ARM_201405)
Because if toolchain is changed then there are many toolchain related problem for packages in buildroot. Some package cannot be compiled using arm-none-eabi-gcc.

cooler_ranch
Posts: 3
Joined: Thu Jul 20, 2017 2:34 am
languages_spoken: english
ODROIDs: C1+
Has thanked: 0
Been thanked: 0
Contact:

Re: Buildroot for ODROID-C1+/C0

Unread post by cooler_ranch » Fri Jul 21, 2017 3:55 pm

Brian.K wrote:Could you use default toolchain configuration? (a.k.a> BR2_TOOLCHAIN_EXTERNAL_LINARO_ARM_201405)
Because if toolchain is changed then there are many toolchain related problem for packages in buildroot. Some package cannot be compiled using arm-none-eabi-gcc.
Ah that makes sense.

I noticed something else, since I think the problem is with what this VM has with some dependencies for the arm-none-eabi-gcc cross-compiler:
vagrant@vagrant:~$ arm-none-eabi-gcc -v
arm-none-eabi-gcc: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
I get a few errors if I try to go ahead and download libstdc++ from apt-get. I'll keep trying at it.

extphy
Posts: 77
Joined: Mon Aug 17, 2015 4:20 pm
languages_spoken: english, russian
ODROIDs: Cx, XU4, U3
Has thanked: 0
Been thanked: 0
Contact:

Re: Buildroot for ODROID-C1+/C0

Unread post by extphy » Sat Jan 12, 2019 5:57 pm

Wondering is it ok to do make -jX for buildroot to run multi-job build ? Is it known as a safe operation?

UPD: buildroot docs provide define for multijob build, tried as: BR2_JLEVEL=4 make, works fine.

Post Reply

Return to “Other OS”

Who is online

Users browsing this forum: No registered users and 0 guests