hello world build error

Post Reply
phil_quik
Posts: 36
Joined: Mon May 18, 2020 12:33 am

OS: ubuntu 20.04 64bit running on VMWare workstation 15 player

I followed the doc,Working.with.Zephyr.pdf, to build but failed.
Below is the error log.

phil@ubuntu:~/zephyrproject/zephyr/samples/hello_world$ west build -b quick_feather
-- west build: build configuration:
source directory: /home/phil/zephyrproject/zephyr/samples/hello_world
build directory: /home/phil/zephyrproject/zephyr/samples/hello_world/build (created)
BOARD: quick_feather (origin: command line)
-- west build: generating a build system
Zephyr version: 2.1.99
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.8.2", minimum required is "3.6")
-- Selected BOARD quick_feather
-- Found west: /home/phil/.local/bin/west (found suitable version "0.7.2", minimum required is "0.6.0")
-- Loading /home/phil/zephyrproject/zephyr/boards/arm/quick_feather/quick_feather.dts as base
quick_feather.dts.pre.tmp:65.14-73.5: Warning (simple_bus_reg): /soc/gpio: missing or empty reg/ranges property
Devicetree configuration written to /home/phil/zephyrproject/zephyr/samples/hello_world/build/zephyr/include/generated/generated_dts_board.conf
Parsing Kconfig tree in /home/phil/zephyrproject/zephyr/Kconfig
Loaded configuration '/home/phil/zephyrproject/zephyr/boards/arm/quick_feather/quick_feather_defconfig'
Merged configuration '/home/phil/zephyrproject/zephyr/samples/hello_world/prj.conf'
Configuration saved to '/home/phil/zephyrproject/zephyr/samples/hello_world/build/zephyr/.config'
-- The C compiler identification is GNU 9.2.0
-- The CXX compiler identification is GNU 9.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /home/phil/zephyr-sdk-0.11.2/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
-- Cache files will be written to: /home/phil/.cache/zephyr
-- Configuring done
-- Generating done
-- Build files have been written to: /home/phil/zephyrproject/zephyr/samples/hello_world/build
-- west build: building application
[1/112] Preparing syscall dependency handling

[2/112] Generating include/generated/driver-validation.h
FAILED: zephyr/include/generated/driver-validation.h
cd /home/phil/zephyrproject/zephyr/samples/hello_world/build/zephyr && /usr/bin/python3 /home/phil/zephyrproject/zephyr/scripts/gen_kobject_list.py --validation-output /home/phil/zephyrproject/zephyr/samples/hello_world/build/zephyr/include/generated/driver-validation.h
Traceback (most recent call last):
File "/home/phil/zephyrproject/zephyr/scripts/gen_kobject_list.py", line 59, in <module>
from elf_helper import ElfHelper, kobject_to_enum
File "/home/phil/zephyrproject/zephyr/scripts/elf_helper.py", line 14, in <module>
import elftools
ModuleNotFoundError: No module named 'elftools'
[3/112] Generating include/generated/k...um.h, include/generated/otype-to-str.h
FAILED: zephyr/include/generated/kobj-types-enum.h zephyr/include/generated/otype-to-str.h
cd /home/phil/zephyrproject/zephyr/samples/hello_world/build/zephyr && /usr/bin/python3 /home/phil/zephyrproject/zephyr/scripts/gen_kobject_list.py --kobj-types-output /home/phil/zephyrproject/zephyr/samples/hello_world/build/zephyr/include/generated/kobj-types-enum.h --kobj-otype-output /home/phil/zephyrproject/zephyr/samples/hello_world/build/zephyr/include/generated/otype-to-str.h --kobj-size-output /home/phil/zephyrproject/zephyr/samples/hello_world/build/zephyr/include/generated/otype-to-size.h
Traceback (most recent call last):
File "/home/phil/zephyrproject/zephyr/scripts/gen_kobject_list.py", line 59, in <module>
from elf_helper import ElfHelper, kobject_to_enum
File "/home/phil/zephyrproject/zephyr/scripts/elf_helper.py", line 14, in <module>
import elftools
ModuleNotFoundError: No module named 'elftools'
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /usr/bin/cmake --build /home/phil/zephyrproject/zephyr/samples/hello_world/build
phil@ubuntu:~/zephyrproject/zephyr/samples/hello_world$
spingali
Posts: 10
Joined: Fri May 15, 2020 5:58 am

Please note the OS supported is Ubuntu 18.04. Not sure if it works for Ubuntu 20.04.
Looking at your error it seems elftools module is missing on your system.
The below command which is part of the document installs this module (pyelftools).
pip3 install --user -r ~/zephyrproject/zephyr/scripts/requirements.txt
Please check if you have executed this step and it executed without errors.
You may try run it again.
After that use below command to clean the build
west build -t pristine
Then try building the app again.
phil_quik
Posts: 36
Joined: Mon May 18, 2020 12:33 am

You are right.
There is error I ignore earlier while doing
pip3 install –-user -r ~/zephyrproject/zephyr/scripts/requirements.txt
ERROR: Invalid requirement: '–-user'

Then I realized I am using "copy and paste" from the document which cause "--user" became "–-user"
Doc shall be fixed.

Now I can build hello_world and confirmed Ubuntu 20.04 also works.
Thanks.
Post Reply