Closed knicklicht closed 1 year ago
Please provide a branch where this can be reproduced. Looks like the overlay is also setting too many options, e.g. CONFIG_UART_LITEUART should never be selected, only CONFIG_SERIAL=y
Please provide a branch where this can be reproduced. Looks like the overlay is also setting too many options, e.g. CONFIG_UART_LITEUART should never be selected, only CONFIG_SERIAL=y
I used the version from the getting started guide which is version 0.15.2 (release). Should I clone the main branch and rebuild Zephyr?
Please provide a branch where this can be reproduced. Looks like the overlay is also setting too many options, e.g. CONFIG_UART_LITEUART should never be selected, only CONFIG_SERIAL=y
I used the version from the getting started guide which is version 0.15.2 (release). Should I clone the main branch and rebuild Zephyr?
description mentions overlays for example. Are they upstream?
Please provide a branch where this can be reproduced. Looks like the overlay is also setting too many options, e.g. CONFIG_UART_LITEUART should never be selected, only CONFIG_SERIAL=y
I used the version from the getting started guide which is version 0.15.2 (release). Should I clone the main branch and rebuild Zephyr?
description mentions overlays for example. Are they upstream?
The overlays were generated using a tool from the Litex project (https://github.com/enjoy-digital/litex/blob/master/litex/tools/litex_json2dts_zephyr.py). It generates the overlays automatically from the generated vexriscv that was created. I am unsure if the issue is due to incorrectly generated overlays or if there is a bug in Zephyr. I also mentioned the issue in their Discord but am still waiting for a response.
I tried to build with -DCONFIG_LITEX_TIMER=n
to disable the timer. In this case I can successfully build but then I get an error during linking: undefined reference to sys_clock_cycle_get_32'
(see full message below). This is the same function that previously produced the error. Is this expected behavior because the timer is necessary?
[156/166] Linking C executable zephyr/zephyr_pre0.elf
FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map /home/user/zephyrproject/zephyr/build/zephyr/zephyr_pre0.map
: && ccache /home/user/zephyr-sdk-0.15.2/riscv64-zephyr-elf/bin/riscv64-zephyr-elf-gcc -gdwarf-4 zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj -o zephyr/zephyr_pre0.elf zephyr/CMakeFiles/offsets.dir/./arch/riscv/core/offsets/offsets.c.obj -fuse-ld=bfd -Wl,-T zephyr/linker_zephyr_pre0.cmd -Wl,-Map=/home/user/zephyrproject/zephyr/build/zephyr/zephyr_pre0.map -Wl,--whole-archive app/libapp.a zephyr/libzephyr.a zephyr/arch/common/libarch__common.a zephyr/arch/arch/riscv/core/libarch__riscv__core.a zephyr/lib/libc/minimal/liblib__libc__minimal.a zephyr/lib/posix/liblib__posix.a zephyr/subsys/timing/libsubsys__timing.a zephyr/drivers/interrupt_controller/libdrivers__interrupt_controller.a zephyr/drivers/console/libdrivers__console.a zephyr/drivers/gpio/libdrivers__gpio.a zephyr/drivers/serial/libdrivers__serial.a zephyr/drivers/timer/libdrivers__timer.a -Wl,--no-whole-archive zephyr/kernel/libkernel.a -L"/home/user/zephyr-sdk-0.15.2/riscv64-zephyr-elf/bin/../lib/gcc/riscv64-zephyr-elf/12.1.0" -L/home/user/zephyrproject/zephyr/build/zephyr -lgcc zephyr/arch/common/libisr_tables.a -no-pie -mabi=ilp32 -march=rv32ima_zicsr_zifencei -Wl,--gc-sections -Wl,--build-id=none -Wl,--sort-common=descending -Wl,--sort-section=alignment -Wl,-u,_OffsetAbsSyms -Wl,-u,_ConfigAbsSyms -nostdlib -static -Wl,-X -Wl,-N -Wl,--orphan-handling=warn && cd /home/user/zephyrproject/zephyr/build/zephyr && /usr/bin/cmake -E echo
/home/user/zephyr-sdk-0.15.2/riscv64-zephyr-elf/bin/../lib/gcc/riscv64-zephyr-elf/12.1.0/../../../../riscv64-zephyr-elf/bin/ld.bfd: zephyr/libzephyr.a(kernel_service.c.obj): in function `cmd_kernel_threads':
/home/user/zephyrproject/zephyr/subsys/shell/modules/kernel_service.c:162: undefined reference to `sys_clock_elapsed'
/home/user/zephyr-sdk-0.15.2/riscv64-zephyr-elf/bin/../lib/gcc/riscv64-zephyr-elf/12.1.0/../../../../riscv64-zephyr-elf/bin/ld.bfd: zephyr/libzephyr.a(kernel_service.c.obj): in function `arch_k_cycle_get_32':
/home/user/zephyrproject/zephyr/subsys/shell/modules/kernel_service.c:232: undefined reference to `sys_clock_cycle_get_32'
/home/user/zephyr-sdk-0.15.2/riscv64-zephyr-elf/bin/../lib/gcc/riscv64-zephyr-elf/12.1.0/../../../../riscv64-zephyr-elf/bin/ld.bfd: zephyr/arch/common/libarch__common.a(timing.c.obj): in function `arch_k_cycle_get_32':
/home/user/zephyrproject/zephyr/include/zephyr/arch/riscv/arch.h:259: undefined reference to `sys_clock_cycle_get_32'
/home/user/zephyr-sdk-0.15.2/riscv64-zephyr-elf/bin/../lib/gcc/riscv64-zephyr-elf/12.1.0/../../../../riscv64-zephyr-elf/bin/ld.bfd: zephyr/kernel/libkernel.a(sched.c.obj): in function `z_reset_time_slice':
/home/user/zephyrproject/zephyr/kernel/sched.c:435: undefined reference to `sys_clock_elapsed'
/home/user/zephyr-sdk-0.15.2/riscv64-zephyr-elf/bin/../lib/gcc/riscv64-zephyr-elf/12.1.0/../../../../riscv64-zephyr-elf/bin/ld.bfd: zephyr/kernel/libkernel.a(timeout.c.obj): in function `elapsed':
/home/user/zephyrproject/zephyr/kernel/timeout.c:64: undefined reference to `sys_clock_elapsed'
/home/user/zephyr-sdk-0.15.2/riscv64-zephyr-elf/bin/../lib/gcc/riscv64-zephyr-elf/12.1.0/../../../../riscv64-zephyr-elf/bin/ld.bfd: zephyr/kernel/libkernel.a(timeout.c.obj): in function `arch_k_cycle_get_32':
/home/user/zephyrproject/zephyr/include/zephyr/arch/riscv/arch.h:259: undefined reference to `sys_clock_cycle_get_32'
/home/user/zephyr-sdk-0.15.2/riscv64-zephyr-elf/bin/../lib/gcc/riscv64-zephyr-elf/12.1.0/../../../../riscv64-zephyr-elf/bin/ld.bfd: zephyr/kernel/libkernel.a(timeout.c.obj): in function `z_impl_k_busy_wait':
/home/user/zephyrproject/zephyr/kernel/timeout.c:333: undefined reference to `sys_clock_cycle_get_32'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /usr/bin/cmake --build /home/user/zephyrproject/zephyr/build
The issue was resolved by building the litex vexriscv soc with --timer-uptime
to enable the missing latch.
Thanks @knicklicht! I had not really had time to get to repro this yet, but I'm happy that you documented the problem and the solution 😄
Describe the bug When I try to build the example app
samples/hello_world
for thelitex_vexriscv
board in a clean zephyr project with:cat overlay.config | xargs west build -b litex_vexriscv samples/hello_world/ -- -DDTC_OVERLAY_FILE=$PWD/overlay.dts
I get the following error message:
To Reproduce
pip install --upgrade pip
andpip instll wheel
before installingwest
etc. to the venv../litex_boards/targets/linsn_rv901t.py --cpu-type vexriscv --csr-json csr.json --build --load
../litex/litex/tools/litex_json2dts_zephyr.py --dts overlay.dts --config overlay.config csr.json
overlay.dts
andoverlay.config
to~/zephyrproject/zephyr/
cat overlay.config | xargs west build -b litex_vexriscv samples/hello_world/ -- -DDTC_OVERLAY_FILE=$PWD/overlay.dts
Expected behavior A successful build of the app
Impact Showstopper: Cannot continue with build process
Logs and console output overlay.config:
-DCONFIG_UART_LITEUART=y -DCONFIG_LITEX_TIMER=y -DCONFIG_ETH_LITEETH=n -DCONFIG_SPI_LITESPI=n -DCONFIG_I2C_LITEX=n -DCONFIG_I2S_LITEX=n -DCONFIG_I2S_LITEX=n -DCONFIG_CLOCK_CONTROL_LITEX=n -DCONFIG_LITEX_CSR_DATA_WIDTH=32
overlay.dts:
Environment (please complete the following information):
Additional context None