Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported board in build Zephyr applications #21

Open
cst-kirank opened this issue Sep 14, 2020 · 6 comments
Open

Unsupported board in build Zephyr applications #21

cst-kirank opened this issue Sep 14, 2020 · 6 comments

Comments

@cst-kirank
Copy link

I am getting an error while building Zephyr application.
The error states that "Unsupported board: led0 devicetree alias not defined".

According to this error, the swervolf_nexys board is not supported by Zephyr application but in the command line, we are giving the same board.

Any feedback will be really appreciated.

Thanks,
Kiran Khunte

@cst-kirank cst-kirank changed the title Unsuitable board in build Zephyr applications Unsupported board in build Zephyr applications Sep 14, 2020
@cst-kirank
Copy link
Author

I am getting an error while building Zephyr application.
The error states that "Unsupported board: led0 devicetree alias not defined".

According to this error, the swervolf_nexys board is not supported by Zephyr application but in the command line, we are giving the same board.

Any feedback will be really appreciated.

Thanks,
Kiran Khunte

I have been trying to debug this issue but haven't got any success. I am attaching a few more details about the problem to have a clearer understanding of the scenario.

  • I am using Linux Ubuntu distribution version 16.04.
  • I have installed zephyr-sdk 0.11.3 application in $HOME/zephyr-sdk-0.11.3/ directory with zephyrproject in $HOME/zephyrproject/ directory.
  • I have been able to run the pre-compiled zephyr application successfully as it was instructed in README file of SweRVolf.

Following is the command prompt output for the reference,

kirank@CSTLinux1:~/zephyrproject/zephyr/samples/basic/blinky$ west build -b swervolf_nexys -- -DBOARD_ROOT=$SWERVOLF_ROOT/zephyr -DSOC_ROOT=$SWERVOLF_ROOT/zephyr -DDTS_ROOT=$SWERVOLF_ROOT/zephyr
-- west build: generating a build system
Including boilerplate (Zephyr base (cached)): /home/kirank/zephyrproject/zephyr/cmake/app/boilerplate.cmake
-- Application: /home/kirank/zephyrproject/zephyr/samples/basic/blinky
-- Zephyr version: 2.4.0-rc1 (/home/kirank/zephyrproject/zephyr)
-- Found west (found suitable version "0.7.3", minimum required is "0.7.1")
-- Board: swervolf_nexys
-- Cache files will be written to: /home/kirank/.cache/zephyr
-- Found toolchain: zephyr (/home/kirank/zephyr-sdk-0.11.3)
-- Found dtc: /home/kirank/zephyr-sdk-0.11.3/sysroots/x86_64-pokysdk-linux/usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
-- Found BOARD.dts: /home/kirank/swervolf/fusesoc_libraries/swervolf/zephyr/boards/riscv/swervolf_nexys/swervolf_nexys.dts
-- Generated zephyr.dts: /home/kirank/zephyrproject/zephyr/samples/basic/blinky/build/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: /home/kirank/zephyrproject/zephyr/samples/basic/blinky/build/zephyr/include/generated/devicetree_unfixed.h
Parsing /home/kirank/zephyrproject/zephyr/Kconfig
Loaded configuration '/home/kirank/zephyrproject/zephyr/samples/basic/blinky/build/zephyr/.config'
No change to configuration in '/home/kirank/zephyrproject/zephyr/samples/basic/blinky/build/zephyr/.config'
No change to Kconfig header in '/home/kirank/zephyrproject/zephyr/samples/basic/blinky/build/zephyr/include/generated/autoconf.h'
CMake Warning at ../../../CMakeLists.txt:408 (message):
One or more dts_fixup.h files detected:

/home/kirank/swervolf/fusesoc_libraries/swervolf//zephyr/soc/riscv/swervolf/dts_fixup.h

Use of these files is deprecated; use the devicetree.h API instead.

-- Configuring done
-- Generating done
-- Build files have been written to: /home/kirank/zephyrproject/zephyr/samples/basic/blinky/build
-- west build: building application
[10/92] Building C object CMakeFiles/app.dir/src/main.c.obj
FAILED: ccache /home/kirank/zephyr-sdk-0.11.3/riscv64-zephyr-elf/bin/riscv64-zephyr-elf-gcc -DBUILD_VERSION=v2.4.0-rc1-197-g2164a7d0dc51 -DKERNEL -D_FORTIFY_SOURCE=2 -D__ZEPHYR__=1 -I/home/kirank/zephyrproject/zephyr/include -Izephyr/include/generated -I/home/kirank/swervolf/fusesoc_libraries/swervolf/zephyr/soc/riscv/swervolf -isystem /home/kirank/zephyrproject/zephyr/lib/libc/minimal/include -isystem /home/kirank/zephyr-sdk-0.11.3/riscv64-zephyr-elf/bin/../lib/gcc/riscv64-zephyr-elf/9.2.0/include -isystem /home/kirank/zephyr-sdk-0.11.3/riscv64-zephyr-elf/bin/../lib/gcc/riscv64-zephyr-elf/9.2.0/include-fixed -Os -imacros /home/kirank/zephyrproject/zephyr/samples/basic/blinky/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -mabi=ilp32 -march=rv32ima -imacros /home/kirank/zephyrproject/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wno-address-of-packed-member -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=/home/kirank/zephyrproject/zephyr/samples/basic/blinky=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/kirank/zephyrproject/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/kirank/zephyrproject=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MT CMakeFiles/app.dir/src/main.c.obj -MF CMakeFiles/app.dir/src/main.c.obj.d -o CMakeFiles/app.dir/src/main.c.obj -c ../src/main.c
../src/main.c:24:2: error: #error "Unsupported board: led0 devicetree alias is not defined"
24 | #error "Unsupported board: led0 devicetree alias is not defined"
| ^~~~~
[10/92] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/onoff.c.obj
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /usr/local/bin/cmake --build

I do not understand the cause of the above error and it will be great to hear from you.

Thanks,
Kiran Khunte

@olofk
Copy link
Collaborator

olofk commented Sep 18, 2020

Thanks for the detailed debugging. I'm not sure exactly why you get this error, but I think it could be because your Zephyr version is too new. A while ago I updated the SwerVolf BSP to work with Zephyr 2.2, but I haven't tried newer versions. Could you try to see if Zephyr 2.2 works for you? If that works, I can look into supporting newer Zephyr versions when I can find the time.

@cst-kirank
Copy link
Author

Thanks for the detailed debugging. I'm not sure exactly why you get this error, but I think it could be because your Zephyr version is too new. A while ago I updated the SwerVolf BSP to work with Zephyr 2.2, but I haven't tried newer versions. Could you try to see if Zephyr 2.2 works for you? If that works, I can look into supporting newer Zephyr versions when I can find the time.

Hi olofk,

Thanks for your feedback.

As you suggested I tried Zephyr 2.2 with SweRVolf but unfortunately that too isn't working for me. I am getting the exact output as I was getting before except the only difference now that Zephyr-sdk version is 0.11.2 instead of 0.11.3. Is there can be any problem with the Linux environment setting or libraries installed to work with Zephyr application?

@cst-kirank
Copy link
Author

cst-kirank commented Sep 25, 2020

Thanks for the detailed debugging. I'm not sure exactly why you get this error, but I think it could be because your Zephyr version is too new. A while ago I updated the SwerVolf BSP to work with Zephyr 2.2, but I haven't tried newer versions. Could you try to see if Zephyr 2.2 works for you? If that works, I can look into supporting newer Zephyr versions when I can find the time.

Hi olofk,

Thanks for your feedback.

As you suggested I tried Zephyr 2.2 with SweRVolf but unfortunately that too isn't working for me. I am getting the exact output as I was getting before except the only difference now that Zephyr-sdk version is 0.11.2 instead of 0.11.3. Is there can be any problem with the Linux environment setting or libraries installed to work with Zephyr application?

Hi olofk,

I tried going around and building different examples for swervolf_nexys board. I was able to build different examples such as hello_world, minimal etc. using Zephyr application which gurranted Zephyr application is working properly.

For 'blinky' example, instead of swervolf_nexys board we tried building it with arm's reel_board and it got build successfully. After the inspection of configuration files related to both swervolf_nexys and reel_board we found some differences in their devicetree files. For reel_board we found there was configuration done for 'led0' in its devicetree files but it was missing from devicetree files of swervolf_board. I think the error I posted here also points to the same thing i.e. missing board configuration of 'led0' for swervolf_nexys board.

It would be great to hear your thoughts on this and how should I configure the swervolf_nexys board for 'led0' if it missing.

Thanks,
Kiran Khunte

@olofk
Copy link
Collaborator

olofk commented Oct 27, 2020

I finally got around to take a look at this and it turned out to be far more complicated than I had expected. Zephyr has basically deprecated the generic GPIO driver that I was using, so it looks like the only way now is to create a dedicated GPIO driver for SweRVolf, but then it must also be accepted into the Zephyr code base before we can use it. We could of course create a fork of Zephyr as well, but that will increase maintenance a lot.

So for now we will have to live without the LED infrastructure or stay on Zephyr 2.1 which I believe still works

@olofk
Copy link
Collaborator

olofk commented Sep 13, 2021

Zephyr support was updated to 2.4 earlier this year. Could you please let me know if this issue remains

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants