nuttx icon indicating copy to clipboard operation
nuttx copied to clipboard

risc-v/qemu-rv: Add Build Config for leds64_zig

Open kassane opened this issue 1 year ago • 2 comments

Summary

This PR adds a new Build Config rv-virt:leds64_zig that builds the Zig App leds_zig for QEMU RISC-V 64-bit.

based on: https://github.com/apache/nuttx/pull/12862

Impact

N/A

Testing

# $PWD == nuttx_path
$ ./tools/configure.sh rv-virt:leds64_zig
$ qemu-system-riscv64 \
    -semihosting \
    -M virt,aclint=on \
    -cpu rv64 -smp 8 \
    -bios none \
    -kernel nuttx -nographic
ABCboard_userled: LED 1 set to 0
board_userled: LED 2 set to 0
board_userled: LED 3 set to 0

NuttShell (NSH) NuttX-12.6.0-RC1
nsh> leds_zig
leds_main: Starting the led_daemon
leds_main: led_daemon started

led_daemon (pid# 4): Running
led_daemon: Opening /dev/userleds
led_daemon: Supported LEDs 7
led_daemon: LED set 1
board_userled: LED 1 set to 1
board_userled: LED 2 set to 0
board_userled: LED 3 set to 0
nsh> led_daemon: LED set 0
board_userled: LED 1 set to 0
board_userled: LED 2 set to 0
board_userled: LED 3 set to 0
led_daemon: LED set 1
board_userled: LED 1 set to 1
board_userled: LED 2 set to 0
board_userled: LED 3 set to 0
# [...] SKIP

Reference

  • https://github.com/apache/nuttx-apps/pull/2534

cc: @xiaoxiang781216

kassane avatar Aug 26 '24 13:08 kassane

@kassane we need fix https://github.com/apache/nuttx/pull/13139#issuecomment-2310525010 to pass ci.

xiaoxiang781216 avatar Aug 26 '24 16:08 xiaoxiang781216

we need fix https://github.com/apache/nuttx/pull/13139#issuecomment-2310525010 to pass ci.

Would it help to remove some dependency? An example is swift6 which weighs +800MB (the largest among toolchains)

kassane avatar Aug 26 '24 16:08 kassane

Need fix: https://github.com/apache/nuttx/actions/runs/10645159870/job/29510697388?pr=13186#step:7:457

/usr/bin/bash: line 1: zig: command not found
make[2]: *** [/github/workspace/sources/apps/Application.mk:316: leds_zig.zig.github.workspace.sources.apps.examples.leds_zig.o] Error 127
make[2]: Target 'all' not remade because of errors.
make[1]: *** [Makefile:51: /github/workspace/sources/apps/examples/leds_zig_all] Error 2
make[1]: Target 'all' not remade because of errors.
make: *** [tools/LibTargets.mk:232: /github/workspace/sources/apps/libapps.a] Error 2
make: Target 'all' not remade because of errors.
/github/workspace/sources/nuttx/tools/testbuild.sh: line 378: /github/workspace/sources/nuttx/../nuttx/nuttx.manifest: No such file or directory
  Normalize rv-virt/leds64_zig
On branch master
Your branch is up to date with 'origin/master'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	examples/leds_zig/leds_zig_tmp.zig

nothing added to commit but untracked files present (use "git add" to track)

kassane avatar Aug 31 '24 14:08 kassane

@kassane please rebase now NuttX Docker Image has Zig.

simbit18 avatar Sep 03 '24 07:09 simbit18

Finally :zap:

CI: https://github.com/apache/nuttx/actions/runs/10682497286/job/29608588514?pr=13186#step:7:451

====================================================================================
Configuration/Tool: rv-virt/leds64_zig
2024-09-03 12:41:50
------------------------------------------------------------------------------------
  Cleaning...
  Configuring...
  Building NuttX...
riscv-none-elf-ld: warning: /github/workspace/sources/nuttx/nuttx has a LOAD segment with RWX permissions
  Normalize rv-virt/leds64_zig

kassane avatar Sep 03 '24 12:09 kassane

@xiaoxiang781216 now zig is in NuttX image and PR is ok.

simbit18 avatar Sep 04 '24 12:09 simbit18

@xiaoxiang781216 now zig is in NuttX image and PR is ok.

Thanks.

xiaoxiang781216 avatar Sep 05 '24 03:09 xiaoxiang781216