arduino-on-zephyr
arduino-on-zephyr copied to clipboard
Build fails with many missing libraries
When I run west build -p -b arduino_zero samples/basic/blinky
I get the following output:
[31/155] Building CXX object zephyr/CMakeFiles/zephyr...ib/arduino-on-zephyr/cores/scirocco/IPAddress.cpp.obj
FAILED: zephyr/CMakeFiles/zephyr.dir/home/dhruva/zephyrproject/modules/lib/arduino-on-zephyr/cores/scirocco/IPAddress.cpp.obj
ccache /home/dhruva/zephyr-sdk-0.14.2/arm-zephyr-eabi/bin/arm-zephyr-eabi-g++ -DBUILD_VERSION=v2.7.99-2750-g7f5eb921dc8b -DKERNEL -D_FORTIFY_SOURCE=2 -D__PROGRAM_START -D__ZE
PHYR__=1 -I/home/dhruva/zephyrproject/zephyr/kernel/include -I/home/dhruva/zephyrproject/zephyr/arch/arm/include -I/home/dhruva/zephyrproject/zephyr/include -I/home/dhruva/ze
phyrproject/zephyr/build/zephyr/include/generated -I/home/dhruva/zephyrproject/zephyr/soc/arm/atmel_sam0/samd21 -I/home/dhruva/zephyrproject/zephyr/drivers -I/home/dhruva/zep
hyrproject/zephyr/soc/arm/atmel_sam0/common/. -I/home/dhruva/zephyrproject/modules/lib/arduino-on-zephyr/cores/scirocco/. -I/home/dhruva/zephyrproject/modules/lib/arduino-on-
zephyr/variants/_FALLBACK_/. -I/home/dhruva/zephyrproject/modules/hal/cmsis/CMSIS/Core/Include -I/home/dhruva/zephyrproject/modules/hal/atmel/asf/sam0/include/samd21 -isystem
/home/dhruva/zephyrproject/zephyr/lib/libc/minimal/include -isystem /home/dhruva/zephyr-sdk-0.14.2/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/include -isystem /ho
me/dhruva/zephyr-sdk-0.14.2/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/include-fixed -Os -fcheck-new -fno-exceptions -fno-rtti -imacros /home/dhruva/zephyrproject/
zephyr/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m0plus -mthumb -mabi=aapcs -mfp16-format=ieee
-imacros /home/dhruva/zephyrproject/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-unused-but-set-variable
-fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=/home/dhruva/zephyrproject/zephyr/samples/basi
c/blinky=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/dhruva/zephyrproject/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/dhruva/zephyrproject=WEST_TOPDIR -ffunction-sections -fdat
a-sections -nostdinc -nostdinc++ -MD -MT zephyr/CMakeFiles/zephyr.dir/home/dhruva/zephyrproject/modules/lib/arduino-on-zephyr/cores/scirocco/IPAddress.cpp.obj -MF zephyr/CMak
eFiles/zephyr.dir/home/dhruva/zephyrproject/modules/lib/arduino-on-zephyr/cores/scirocco/IPAddress.cpp.obj.d -o zephyr/CMakeFiles/zephyr.dir/home/dhruva/zephyrproject/modules
/lib/arduino-on-zephyr/cores/scirocco/IPAddress.cpp.obj -c /home/dhruva/zephyrproject/modules/lib/arduino-on-zephyr/cores/scirocco/IPAddress.cpp
In file included from /home/dhruva/zephyrproject/modules/lib/arduino-on-zephyr/cores/scirocco/IPAddress.cpp:20:
/home/dhruva/zephyrproject/modules/lib/arduino-on-zephyr/cores/scirocco/IPAddress.h:26:10: fatal error: misc/byteorder.h: No such file or directory
26 | #include <misc/byteorder.h>
| ^~~~~~~~~~~~~~~~~~
compilation terminated.
along with many other missing libs like gpio.h
and uart.h
I followed everything given in this repo's readme (mainly just edited the west.yml and ran west update)
Am I missing out on any step or could this be some sort of compatibility issue with thelatest zephyr repo and sdk that I have used from upstream?
After much renaming of #includes
and few other tweaks I was able to solve some of the missing library errors, but then many other one's popped up which I have mentioned here
It mostly seems like zephyr at the time of this project had different header file locations and a few functions like k_sleep
perhaps had other kind of parameters.
Hi, @DhruvaG2000
Sorry for not responding for a long time. I was busy and I was infected with COVID-19 and fell asleep (now recoverd).
I haven't maintained this library for a long time, but I updated it a bit ago. I haven't checked it completely, but I have confirmed that the two additional samples (arduino_blinky, arduino_counter) on the nrf52840dk_nrf52840 board work with the latest zephyr.
――――――
I am very pleased to find your GSOC-2022 activity and take an interest in the same issue. We look forward to making significant contributions to OSS as do in past GSOC.
https://github.com/zephyrproject-rtos/gsoc-2022-arduino-core
Now, the problem with what I made in this repository is It's already been discussed in this thread and I think not make significant change.
https://github.com/zephyrproject-rtos/zephyr/issues/22247#issuecomment-1092437306
However, zephyr is under development and has some interesting changes.
One is this patch that recently merged.
https://github.com/zephyrproject-rtos/zephyr/pull/43225#event-6979679884
I think it will probably help you to create a GPIO-API that behaves like an Arduino. (I had a hard time before...)
one more,
https://github.com/zephyrproject-rtos/zephyr/blob/main/dts/bindings/gpio/arduino-header-r3.yaml
The dts for arduino-header-r3 has been added.
This is to make the pins of the arduino connector map to each SoC's pin. And if used properly, it may solve compatible problem with many boards with arduino connectors.
(Currently, the information is discarded after dts pre-processed. It seems may be hard work because it seems that the python script needs to be changed.)
――――――
Overall, zephyr is more versatile than Arduino. so I don't think there's a big problem to create just a compatible API, (However, except for licensing issues, this will need to be reimplemented.)
Arduino is a platform that emphasizes "development experience" I think the biggest difference from Zephyr is that Arudino "uses people who can't write programs".
I think that trying to port the "development experience" as well as the difference in API will be a challenging task.
(They may not know commonly known in embedded system developping. such as PinMux, JTAG and etc. It would be very interesting if you could get a great development experience with Zephyr even in such a situation. )
@beriberikix
I am very pleased to have you revisit the previous discussion. There are many challenges that I couldn't achieve, so I think it would be great if this project could solve them.
I may not have enough time, but we will cooperate as much as possible. Please tell me if there is anything.
I look forward to the success of the project.
Hi @soburi
Great work! I have the same missing libraries error. Is there any direct way to solve it?
@oscarbaselga All achivements of this project have been merged into https://github.com/zephyrproject-rtos/gsoc-2022-arduino-core. Please use them. This project will be archived.