Hello!
So i made a card with orange pi one balenaOS image, but it doesnt have support for i2c, and spi at the moment, and there is no mechanism in balenaOS to change dtoverlay in runtime
So my plan is to build custom orange-pi-one balenaOS image with some additional features like:
i2c support, spi support
Is there any guide regarding this?
I assume that i have to clone this:
git@github.com:balena-os/balena-allwinner.git
Then
git submodule update --init --recursive
Then add layers/meta-balena-allwinner/orange-pi-one.conf similiar to orange-pi-lite.conf
@TYPE: Machine
#@NAME: orange-pi-one
#@DESCRIPTION: Machine configuration for the orange-pi-one, base on allwinner H3 CPU
require conf/machine/include/sun8i.inc
KERNEL_DEVICETREE = "sun8i-h3-orangepi-one.dtb \
overlay/sun8i-h3-analog-codec.dtbo \
overlay/sun8i-h3-cir.dtbo \
overlay/sun8i-h3-fixup.scr \
overlay/sun8i-h3-i2c0.dtbo \
overlay/sun8i-h3-i2c1.dtbo \
overlay/sun8i-h3-i2c2.dtbo \
overlay/sun8i-h3-pps-gpio.dtbo \
overlay/sun8i-h3-pwm.dtbo \
overlay/sun8i-h3-spdif-out.dtbo \
overlay/sun8i-h3-spi-add-cs1.dtbo \
overlay/sun8i-h3-spi-jedec-nor.dtbo \
overlay/sun8i-h3-spi-spidev.dtbo \
overlay/sun8i-h3-uart1.dtbo \
overlay/sun8i-h3-uart2.dtbo \
overlay/sun8i-h3-uart3.dtbo \
overlay/sun8i-h3-usbhost0.dtbo \
overlay/sun8i-h3-usbhost2.dtbo \
overlay/sun8i-h3-usbhost3.dtbo \
overlay/sun8i-h3-w1-gpio.dtbo \
"
UBOOT_MACHINE = “orangepi_one_defconfig”
DEFAULTTUNE = “cortexa7hf-neon-vfpv4”
Then i have to make
./balena-yocto-scripts/build/barys -m orange-pi-one
Unfortunately i got error
NOTE: Running task 1251 of 3762 (/home/adam/balena-allwinner/build/…/layers/meta-rust/recipes-devtools/rust/rust-cross_1.33.0.bb:do_rust_gen_targets)
NOTE: recipe rust-cross-arm-1.33.0-r0: task do_rust_create_wrappers: Succeeded
NOTE: Running task 1252 of 3762 (virtual:native:/home/adam/balena-allwinner/build/…/layers/poky/meta/recipes-support/libxslt/libxslt_1.1.33.bb:do_fetch)
ERROR: qemu-native-3.1.0-r0 do_compile: oe_runmake failed
ERROR: qemu-native-3.1.0-r0 do_compile: Function failed: do_compile (log file is located at /home/adam/balena-allwinner/build/tmp/work/x86_64-linux/qemu-native/3.1.0-r0/temp/log.do_compile.1197)
ERROR: Logfile of failure stored in: /home/adam/balena-allwinner/build/tmp/work/x86_64-linux/qemu-native/3.1.0-r0/temp/log.do_compile.1197
NOTE: recipe qemu-native-3.1.0-r0: task do_compile: Failed
ERROR: Task (/home/adam/balena-allwinner/build/…/layers/poky/meta/recipes-devtools/qemu/qemu-native_3.1.0.bb:do_compile) failed with exit code ‘1’
NOTE: Running task 1253 of 3762 (/home/adam/balena-allwinner/build/…/layers/poky/meta/recipes-support/libgpg-error/libgpg-error_1.35.bb:do_unpack)
NOTE: recipe rust-cross-arm-1.33.0-r0: task do_rust_gen_targets: Started
NOTE: recipe rust-cross-arm-1.33.0-r0: task do_rust_gen_targets: Succeeded
NOTE: recipe libgpg-error-1.35-r0: task do_unpack: Started
NOTE: recipe libxslt-native-1.1.33-r0: task do_fetch: Started
NOTE: recipe libgpg-error-1.35-r0: task do_unpack: Succeeded
NOTE: recipe libxslt-native-1.1.33-r0: task do_fetch: Succeeded
NOTE: recipe linux-mainline-4.19.76+gitAUTOINC+555161ee1b-r0: task do_configure: Succeeded
NOTE: recipe vala-native-0.42.5-r0: task do_compile: Succeeded
NOTE: recipe libgpg-error-native-1.35-r0: task do_configure: Succeeded
NOTE: recipe glibc-2.29-r0: task do_install: Succeeded
NOTE: recipe rust-llvm-native-1.33.0-r0: task do_compile: Succeeded
NOTE: Tasks Summary: Attempted 1253 tasks of which 0 didn’t need to be rerun and 1 failed.
Log “/home/adam/balena-allwinner/build/tmp/work/x86_64-linux/qemu-native/3.1.0-r0/temp/log.do_compile.1197” (100 last lines):
make[1]: *** [/home/adam/balena-allwinner/build/tmp/work/x86_64-linux/qemu-native/3.1.0-r0/qemu-3.1.0/rules.mak:69: linux-user/syscall.o] Error 1
make[1]: *** Waiting for unfinished jobs…
CC arm-linux-user/linux-user/mmap.o
/home/adam/balena-allwinner/build/tmp/work/x86_64-linux/qemu-native/3.1.0-r0/qemu-3.1.0/linux-user/ioctls.h:222:9: error: ‘SIOCGSTAMP’ undeclared here (not in a function); did you mean ‘SIOCSRARP’?
222 | IOCTL(SIOCGSTAMP, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timeval)))
| ^~~~~~~~~~
/home/adam/balena-allwinner/build/tmp/work/x86_64-linux/qemu-native/3.1.0-r0/qemu-3.1.0/linux-user/syscall.c:4750:23: note: in definition of macro ‘IOCTL’
4750 | { TARGET_ ## cmd, cmd, #cmd, access, 0, { VA_ARGS } },
| ^~~
CC mipsel-linux-user/accel/tcg/user-exec-stub.o
/home/adam/balena-allwinner/build/tmp/work/x86_64-linux/qemu-native/3.1.0-r0/qemu-3.1.0/linux-user/ioctls.h:223:9: error: ‘SIOCGSTAMPNS’ undeclared here (not in a function); did you mean ‘SIOCGSTAMP_OLD’?
223 | IOCTL(SIOCGSTAMPNS, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timespec)))
| ^~~~~~~~~~~~
/home/adam/balena-allwinner/build/tmp/work/x86_64-linux/qemu-native/3.1.0-r0/qemu-3.1.0/linux-user/syscall.c:4750:23: note: in definition of macro ‘IOCTL’
4750 | { TARGET_ ## cmd, cmd, #cmd, access, 0, { VA_ARGS } },
| ^~~
CC mipsel-linux-user/linux-user/main.o
CC mipsel-linux-user/linux-user/syscall.o
make[1]: *** [/home/adam/balena-allwinner/build/tmp/work/x86_64-linux/qemu-native/3.1.0-r0/qemu-3.1.0/rules.mak:69: linux-user/syscall.o] Error 1
make[1]: *** Waiting for unfinished jobs…
CC mipsel-linux-user/linux-user/strace.o
CC aarch64-linux-user/linux-user/syscall.o
/home/adam/balena-allwinner/build/tmp/work/x86_64-linux/qemu-native/3.1.0-r0/qemu-3.1.0/linux-user/syscall.c:253:16: error: static declaration of ‘gettid’ follows non-static declaration
253 | _syscall0(int, gettid)
| ^~~~~~
/home/adam/balena-allwinner/build/tmp/work/x86_64-linux/qemu-native/3.1.0-r0/qemu-3.1.0/linux-user/syscall.c:184:13: note: in definition of macro ‘_syscall0’
184 | static type name (void)
| ^~~~
In file included from /usr/include/unistd.h:1170,
from /home/adam/balena-allwinner/build/tmp/work/x86_64-linux/qemu-native/3.1.0-r0/qemu-3.1.0/include/qemu/osdep.h:90,
from /home/adam/balena-allwinner/build/tmp/work/x86_64-linux/qemu-native/3.1.0-r0/qemu-3.1.0/linux-user/syscall.c:20:
/usr/include/x86_64-linux-gnu/bits/unistd_ext.h:34:16: note: previous declaration of ‘gettid’ was here
34 | extern __pid_t gettid (void) THROW;
| ^~~~~~
/home/adam/balena-allwinner/build/tmp/work/x86_64-linux/qemu-native/3.1.0-r0/qemu-3.1.0/linux-user/ioctls.h:222:9: error: ‘SIOCGSTAMP’ undeclared here (not in a function); did you mean ‘SIOCSRARP’?
222 | IOCTL(SIOCGSTAMP, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timeval)))
| ^~~~~~~~~~
/home/adam/balena-allwinner/build/tmp/work/x86_64-linux/qemu-native/3.1.0-r0/qemu-3.1.0/linux-user/syscall.c:4750:23: note: in definition of macro ‘IOCTL’
4750 | { TARGET ## cmd, cmd, #cmd, access, 0, { VA_ARGS } },
| ^~~
/home/adam/balena-allwinner/build/tmp/work/x86_64-linux/qemu-native/3.1.0-r0/qemu-3.1.0/linux-user/ioctls.h:223:9: error: ‘SIOCGSTAMPNS’ undeclared here (not in a function); did you mean ‘SIOCGSTAMP_OLD’?
223 | IOCTL(SIOCGSTAMPNS, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timespec)))
| ^~~~~~~~~~~~
/home/adam/balena-allwinner/build/tmp/work/x86_64-linux/qemu-native/3.1.0-r0/qemu-3.1.0/linux-user/syscall.c:4750:23: note: in definition of macro ‘IOCTL’
4750 | { TARGET ## cmd, cmd, #cmd, access, 0, { VA_ARGS } },
| ^~~
make: *** [Makefile:483: subdir-mips64-linux-user] Error 2
CC mipsel-linux-user/linux-user/mmap.o
CC mipsel-linux-user/linux-user/signal.o
CC mipsel-linux-user/linux-user/elfload.o
make[1]: *** [/home/adam/balena-allwinner/build/tmp/work/x86_64-linux/qemu-native/3.1.0-r0/qemu-3.1.0/rules.mak:69: linux-user/syscall.o] Error 1
make[1]: *** Waiting for unfinished jobs…
/home/adam/balena-allwinner/build/tmp/work/x86_64-linux/qemu-native/3.1.0-r0/qemu-3.1.0/linux-user/syscall.c:253:16: error: static declaration of ‘gettid’ follows non-static declaration
253 | _syscall0(int, gettid)
| ^~~~~~
/home/adam/balena-allwinner/build/tmp/work/x86_64-linux/qemu-native/3.1.0-r0/qemu-3.1.0/linux-user/syscall.c:184:13: note: in definition of macro ‘_syscall0’
184 | static type name (void)
| ^~~~
CC aarch64-linux-user/linux-user/strace.o
In file included from /usr/include/unistd.h:1170,
from /home/adam/balena-allwinner/build/tmp/work/x86_64-linux/qemu-native/3.1.0-r0/qemu-3.1.0/include/qemu/osdep.h:90,
from /home/adam/balena-allwinner/build/tmp/work/x86_64-linux/qemu-native/3.1.0-r0/qemu-3.1.0/linux-user/syscall.c:20:
/usr/include/x86_64-linux-gnu/bits/unistd_ext.h:34:16: note: previous declaration of ‘gettid’ was here
34 | extern __pid_t gettid (void) THROW;
| ^~~~~~
/home/adam/balena-allwinner/build/tmp/work/x86_64-linux/qemu-native/3.1.0-r0/qemu-3.1.0/linux-user/ioctls.h:222:9: error: ‘SIOCGSTAMP’ undeclared here (not in a function); did you mean ‘SIOCSRARP’?
222 | IOCTL(SIOCGSTAMP, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timeval)))
| ^~~~~~~~~~
/home/adam/balena-allwinner/build/tmp/work/x86_64-linux/qemu-native/3.1.0-r0/qemu-3.1.0/linux-user/syscall.c:4750:23: note: in definition of macro ‘IOCTL’
4750 | { TARGET ## cmd, cmd, #cmd, access, 0, { VA_ARGS } },
| ^~~
/home/adam/balena-allwinner/build/tmp/work/x86_64-linux/qemu-native/3.1.0-r0/qemu-3.1.0/linux-user/ioctls.h:223:9: error: ‘SIOCGSTAMPNS’ undeclared here (not in a function); did you mean ‘SIOCGSTAMP_OLD’?
223 | IOCTL(SIOCGSTAMPNS, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timespec)))
| ^~~~~~~~~~~~
/home/adam/balena-allwinner/build/tmp/work/x86_64-linux/qemu-native/3.1.0-r0/qemu-3.1.0/linux-user/syscall.c:4750:23: note: in definition of macro ‘IOCTL’
4750 | { TARGET ## cmd, cmd, #cmd, access, 0, { VA_ARGS } },
| ^~~
make[1]: *** [/home/adam/balena-allwinner/build/tmp/work/x86_64-linux/qemu-native/3.1.0-r0/qemu-3.1.0/rules.mak:69: linux-user/syscall.o] Error 1
make[1]: *** Waiting for unfinished jobs…
make: *** [Makefile:483: subdir-arm-linux-user] Error 2
In file included from /usr/include/string.h:494,
from /home/adam/balena-allwinner/build/tmp/work/x86_64-linux/qemu-native/3.1.0-r0/qemu-3.1.0/include/qemu/osdep.h:84,
from /home/adam/balena-allwinner/build/tmp/work/x86_64-linux/qemu-native/3.1.0-r0/qemu-3.1.0/linux-user/elfload.c:2:
In function ‘strncpy’,
inlined from ‘fill_psinfo’ at /home/adam/balena-allwinner/build/tmp/work/x86_64-linux/qemu-native/3.1.0-r0/qemu-3.1.0/linux-user/elfload.c:3158:12,
inlined from ‘fill_note_info’ at /home/adam/balena-allwinner/build/tmp/work/x86_64-linux/qemu-native/3.1.0-r0/qemu-3.1.0/linux-user/elfload.c:3340:5,
inlined from ‘elf_core_dump’ at /home/adam/balena-allwinner/build/tmp/work/x86_64-linux/qemu-native/3.1.0-r0/qemu-3.1.0/linux-user/elfload.c:3489:9:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’ specified bound 16 equals destination size [-Wstringop-truncation]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [Makefile:483: subdir-aarch64-linux-user] Error 2
ERROR: oe_runmake failed
make: *** [Makefile:483: subdir-mipsel-linux-user] Error 2
WARNING: exit code 1 from a shell command.
ERROR: Function failed: do_compile (log file is located at /home/adam/balena-allwinner/build/tmp/work/x86_64-linux/qemu-native/3.1.0-r0/temp/log.do_compile.1197)
My system:
Ubuntu 19.10
I’m not sure if i’m doing everything ok, so that’s why im not putting issue yet