chipsalliance / VeeRwolf

FuseSoC-based SoC for VeeR EH1 and EL2
269 stars 61 forks source link

Unsupported board in build Zephyr applications #21

Open cst-kirank opened 3 years ago

cst-kirank commented 3 years ago

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 commented 3 years ago

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.

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 -DZEPHYR=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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 2 years ago

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