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

boards/seeedstudio-xiao-nrf52840: initial board support #20980

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mguetschow
Copy link
Contributor

Contribution description

Initial board support for the tiny Seed Studio XIAO nRF52840. It uses the same bootloader as the Adafruit nrf52840 Feather (Sense) boards.

Testing procedure

  • I'm still in the process of running BUILD_IN_DOCKER=1 dist/tools/compile_and_test_for_board/compile_and_test_for_board.py . seeedstudio-xiao-nrf52840 locally and will report back with the result later.

  • Look through the header and configuration files. I've mostly followed the example from feather-nrf52840-sense and nrf52840dk (for the external flash).

  • Check generated documentation for the board.

@github-actions github-actions bot added Area: doc Area: Documentation Area: boards Area: Board ports Area: Kconfig Area: Kconfig integration labels Nov 13, 2024
@mguetschow mguetschow marked this pull request as draft November 13, 2024 10:19
@mguetschow
Copy link
Contributor Author

  • I'm still in the process of running BUILD_IN_DOCKER=1 dist/tools/compile_and_test_for_board/compile_and_test_for_board.py . seeedstudio-xiao-nrf52840 locally and will report back with the result later.

Currently failing tests:

$ find results -name "*.failed"
results/seeedstudio-xiao-nrf52840/tests/sys/congure_test/test.failed
results/seeedstudio-xiao-nrf52840/tests/sys/pthread_flood/test.failed
results/seeedstudio-xiao-nrf52840/tests/sys/congure_quic/test.failed
results/seeedstudio-xiao-nrf52840/tests/sys/usbus/test.failed
results/seeedstudio-xiao-nrf52840/tests/sys/shell/test.failed
results/seeedstudio-xiao-nrf52840/tests/core/thread_msg/test.failed
results/seeedstudio-xiao-nrf52840/tests/core/msg_queue_print/test.failed
results/seeedstudio-xiao-nrf52840/tests/riotboot/test.failed
results/seeedstudio-xiao-nrf52840/tests/turo/test.failed
results/seeedstudio-xiao-nrf52840/tests/cpu/mpu_noexec_ram/test.failed
results/seeedstudio-xiao-nrf52840/tests/cpu/mpu_stack_guard/test.failed
results/seeedstudio-xiao-nrf52840/tests/riotboot_hdr/test.failed
results/seeedstudio-xiao-nrf52840/tests/pkg/libschc/test.failed

@benpicco
Copy link
Contributor

Most of those are software-only and won't depend on the board.
compile_and_test_for_board.py isn't the greatest way to test a board, there are tests/periph/spi, tests/periph/uart and tests/drivers/mtd_raw that come with a test command but that requires RX/TX / MISO/MOSI to be connected or a writable MTD device (in case the board exposes MTD). ``tests/periph/i2calso includesi2c_scan`, but that can be included everywhere with `shell_cmd_i2c_scan`.

(Thinking of it, we should probably add a general board test app that makes it easier to evaluate a newly ported board)

@mguetschow
Copy link
Contributor Author

Most of those are software-only and won't depend on the board.

True, but I've still managed to find some issues which are at least board-related :)

there are tests/periph/spi, tests/periph/uart and tests/drivers/mtd_raw

Great, I'll have a look! Do we have a list of such useful test applications for new boards somewhere? May be good to add a pointer to the documentation.

(Thinking of it, we should probably add a general board test app that makes it easier to evaluate a newly ported board)

Or even better!

@mguetschow
Copy link
Contributor Author

tests/periph/uart: ✔️ SUCCESS

with UART pins connected (TX to RX)

make -C tests/periph/uart BOARD=seeedstudio-xiao-nrf52840 flash term
make: Entering directory '/home/mikolai/TUD/Code/RIOT-build/tests/periph/uart'
Building application "tests_uart" for "seeedstudio-xiao-nrf52840" with CPU "nrf52".

"make" -C /home/mikolai/TUD/Code/RIOT-build/pkg/cmsis/ 
"make" -C /home/mikolai/TUD/Code/RIOT-build/boards/common/init
"make" -C /home/mikolai/TUD/Code/RIOT-build/boards/seeedstudio-xiao-nrf52840
"make" -C /home/mikolai/TUD/Code/RIOT-build/core
"make" -C /home/mikolai/TUD/Code/RIOT-build/core/lib
"make" -C /home/mikolai/TUD/Code/RIOT-build/cpu/nrf52
"make" -C /home/mikolai/TUD/Code/RIOT-build/cpu/cortexm_common
"make" -C /home/mikolai/TUD/Code/RIOT-build/cpu/cortexm_common/periph
"make" -C /home/mikolai/TUD/Code/RIOT-build/cpu/nrf52/periph
"make" -C /home/mikolai/TUD/Code/RIOT-build/cpu/nrf52/vectors
"make" -C /home/mikolai/TUD/Code/RIOT-build/cpu/nrf5x_common
"make" -C /home/mikolai/TUD/Code/RIOT-build/cpu/nrf5x_common/periph
"make" -C /home/mikolai/TUD/Code/RIOT-build/drivers
"make" -C /home/mikolai/TUD/Code/RIOT-build/drivers/periph_common
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/auto_init
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/auto_init/usb
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/div
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/event
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/fmt
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/frac
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/isrpipe
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/libc
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/luid
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/malloc_thread_safe
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/newlib_syscalls_default
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/preprocessor
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/shell
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/stdio
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/tsrb
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/usb/usbus
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/usb/usbus/cdc/acm
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/usb_board_reset
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/ztimer
   text    data     bss     dec     hex filename
  28324     132    6324   34780    87dc /home/mikolai/TUD/Code/RIOT-build/tests/periph/uart/bin/seeedstudio-xiao-nrf52840/tests_uart.elf
stty -F /dev/ttyACM0 raw ispeed 1200 ospeed 1200 cs8 -cstopb ignpar eol 255 eof 255
sleep 10
/home/mikolai/TUD/Code/RIOT-build/dist/tools/uf2/uf2conv.py -f 0xADA52840 /home/mikolai/TUD/Code/RIOT-build/tests/periph/uart/bin/seeedstudio-xiao-nrf52840/tests_uart.hex --base 0x1000
Converted to uf2, output size: 57344, start address: 0x1000
Flashing /media/mikolai/XIAO-SENSE (Seeed_XIAO_nRF52840_Sense)
Wrote 57344 bytes to /media/mikolai/XIAO-SENSE/NEW.UF2
sleep 2
/home/mikolai/TUD/Code/RIOT-build/dist/tools/pyterm/pyterm -p "/dev/ttyACM0" -b "115200" -ln "/tmp/pyterm-mikolai" -rn "2024-11-25_16.37.17-tests_uart-seeedstudio-xiao-nrf52840"  
Twisted not available, please install it if you want to use pyterm's JSON capabilities
2024-11-25 16:37:17,369 # Connect to serial port /dev/ttyACM0
Welcome to pyterm!
Type '/exit' to exit.
2024-11-25 16:37:18,371 #  data 
2024-11-25 16:37:18,372 # being printed to STDOUT
2024-11-25 16:37:18,372 # 
2024-11-25 16:37:18,373 # NOTE: all strings need to be '\n' terminated!
2024-11-25 16:37:18,373 # 
2024-11-25 16:37:18,373 # 
2024-11-25 16:37:18,373 # UART INFO:
2024-11-25 16:37:18,374 # Available devices:               1
> test 0
2024-11-25 16:37:20,905 # test 0
2024-11-25 16:37:20,905 # [START]
2024-11-25 16:37:20,935 # warning: unsupported baudrate 48000
2024-11-25 16:37:20,939 # warning: unsupported baudrate 67200
2024-11-25 16:37:20,942 # warning: unsupported baudrate 86400
2024-11-25 16:37:20,943 # warning: unsupported baudrate 96000
2024-11-25 16:37:20,944 # warning: unsupported baudrate 105600
2024-11-25 16:37:20,944 # [SUCCESS]
> /exit
2024-11-25 16:37:55,158 # Exiting Pyterm
make: Leaving directory '/home/mikolai/TUD/Code/RIOT-build/tests/periph/uart'

@mguetschow
Copy link
Contributor Author

tests/periph/spi: ✔️ SUCCESS

with SPI pins connected (MOSI to MISO)

make -C tests/periph/spi BOARD=seeedstudio-xiao-nrf52840 flash term
make: Entering directory '/home/mikolai/TUD/Code/RIOT-build/tests/periph/spi'
Building application "tests_spi" for "seeedstudio-xiao-nrf52840" with CPU "nrf52".

"make" -C /home/mikolai/TUD/Code/RIOT-build/pkg/cmsis/ 
"make" -C /home/mikolai/TUD/Code/RIOT-build/boards/common/init
"make" -C /home/mikolai/TUD/Code/RIOT-build/boards/seeedstudio-xiao-nrf52840
"make" -C /home/mikolai/TUD/Code/RIOT-build/core
"make" -C /home/mikolai/TUD/Code/RIOT-build/core/lib
"make" -C /home/mikolai/TUD/Code/RIOT-build/cpu/nrf52
"make" -C /home/mikolai/TUD/Code/RIOT-build/cpu/cortexm_common
"make" -C /home/mikolai/TUD/Code/RIOT-build/cpu/cortexm_common/periph
"make" -C /home/mikolai/TUD/Code/RIOT-build/cpu/nrf52/periph
"make" -C /home/mikolai/TUD/Code/RIOT-build/cpu/nrf52/vectors
"make" -C /home/mikolai/TUD/Code/RIOT-build/cpu/nrf5x_common
"make" -C /home/mikolai/TUD/Code/RIOT-build/cpu/nrf5x_common/periph
"make" -C /home/mikolai/TUD/Code/RIOT-build/drivers
"make" -C /home/mikolai/TUD/Code/RIOT-build/drivers/periph_common
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/auto_init
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/auto_init/usb
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/div
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/event
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/fmt
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/frac
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/isrpipe
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/libc
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/luid
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/malloc_thread_safe
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/newlib_syscalls_default
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/preprocessor
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/schedstatistics
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/shell
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/shell/cmds
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/stdio
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/tsrb
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/usb/usbus
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/usb/usbus/cdc/acm
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/usb_board_reset
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/ztimer
   text    data     bss     dec     hex filename
  30272     168    5704   36144    8d30 /home/mikolai/TUD/Code/RIOT-build/tests/periph/spi/bin/seeedstudio-xiao-nrf52840/tests_spi.elf
stty -F /dev/ttyACM0 raw ispeed 1200 ospeed 1200 cs8 -cstopb ignpar eol 255 eof 255
sleep 10
/home/mikolai/TUD/Code/RIOT-build/dist/tools/uf2/uf2conv.py -f 0xADA52840 /home/mikolai/TUD/Code/RIOT-build/tests/periph/spi/bin/seeedstudio-xiao-nrf52840/tests_spi.hex --base 0x1000
Converted to uf2, output size: 60928, start address: 0x1000
Flashing /media/mikolai/XIAO-SENSE (Seeed_XIAO_nRF52840_Sense)
Wrote 60928 bytes to /media/mikolai/XIAO-SENSE/NEW.UF2
sleep 2
/home/mikolai/TUD/Code/RIOT-build/dist/tools/pyterm/pyterm -p "/dev/ttyACM0" -b "115200" -ln "/tmp/pyterm-mikolai" -rn "2024-11-25_16.46.30-tests_spi-seeedstudio-xiao-nrf52840"  
Twisted not available, please install it if you want to use pyterm's JSON capabilities
2024-11-25 16:46:30,424 # Connect to serial port /dev/ttyACM0
Welcome to pyterm!
Type '/exit' to exit.
2024-11-25 16:46:31,426 # -board-xiao-nrf52840)
2024-11-25 16:46:31,427 # Manual SPI peripheral driver test (see README.md)
2024-11-25 16:46:31,428 # There are 2 SPI devices configured for your platform.
init 0 0 0
2024-11-25 16:46:38,372 # init 0 0 0
2024-11-25 16:46:38,373 # Trying to initialize SPI_DEV(0): mode: 0, clk: 0, cs_port: 0, cs_pin: 0
2024-11-25 16:46:38,383 # (if below the program crashes with a failed assertion, then it means the configuration is not supported)
2024-11-25 16:46:38,383 # Success.
> send hello
2024-11-25 16:46:43,524 # send hello
2024-11-25 16:46:43,525 # Sent bytes
2024-11-25 16:46:43,533 #    0    1    2    3    4 
2024-11-25 16:46:43,534 #   0x68 0x65 0x6c 0x6c 0x6f
2024-11-25 16:46:43,534 #     h    e    l    l    o 
2024-11-25 16:46:43,534 # 
2024-11-25 16:46:43,535 # Received bytes
2024-11-25 16:46:43,535 #    0    1    2    3    4 
2024-11-25 16:46:43,536 #   0x68 0x65 0x6c 0x6c 0x6f
2024-11-25 16:46:43,536 #     h    e    l    l    o 
2024-11-25 16:46:43,536 # 
> 

@mguetschow
Copy link
Contributor Author

tests/drivers/mtd_raw: ✔️ SUCCESS

make -C tests/drivers/mtd_raw BOARD=seeedstudio-xiao-nrf52840 flash term
make: Entering directory '/home/mikolai/TUD/Code/RIOT-build/tests/drivers/mtd_raw'
Building application "tests_mtd_raw" for "seeedstudio-xiao-nrf52840" with CPU "nrf52".

"make" -C /home/mikolai/TUD/Code/RIOT-build/pkg/cmsis/ 
"make" -C /home/mikolai/TUD/Code/RIOT-build/boards/common/init
"make" -C /home/mikolai/TUD/Code/RIOT-build/boards/seeedstudio-xiao-nrf52840
"make" -C /home/mikolai/TUD/Code/RIOT-build/core
"make" -C /home/mikolai/TUD/Code/RIOT-build/core/lib
"make" -C /home/mikolai/TUD/Code/RIOT-build/cpu/nrf52
"make" -C /home/mikolai/TUD/Code/RIOT-build/cpu/cortexm_common
"make" -C /home/mikolai/TUD/Code/RIOT-build/cpu/cortexm_common/periph
"make" -C /home/mikolai/TUD/Code/RIOT-build/cpu/nrf52/periph
"make" -C /home/mikolai/TUD/Code/RIOT-build/cpu/nrf52/vectors
"make" -C /home/mikolai/TUD/Code/RIOT-build/cpu/nrf5x_common
"make" -C /home/mikolai/TUD/Code/RIOT-build/cpu/nrf5x_common/periph
"make" -C /home/mikolai/TUD/Code/RIOT-build/drivers
"make" -C /home/mikolai/TUD/Code/RIOT-build/drivers/mtd
"make" -C /home/mikolai/TUD/Code/RIOT-build/drivers/mtd_spi_nor
"make" -C /home/mikolai/TUD/Code/RIOT-build/drivers/periph_common
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/auto_init
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/auto_init/usb
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/div
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/event
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/fmt
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/isrpipe
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/libc
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/luid
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/malloc_thread_safe
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/newlib_syscalls_default
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/od
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/preprocessor
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/shell
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/shell/cmds
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/stdio
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/test_utils/interactive_sync
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/test_utils/print_stack_usage
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/tsrb
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/usb/usbus
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/usb/usbus/cdc/acm
"make" -C /home/mikolai/TUD/Code/RIOT-build/sys/usb_board_reset
   text    data     bss     dec     hex filename
  30980     172    4664   35816    8be8 /home/mikolai/TUD/Code/RIOT-build/tests/drivers/mtd_raw/bin/seeedstudio-xiao-nrf52840/tests_mtd_raw.elf
stty -F /dev/ttyACM0 raw ispeed 1200 ospeed 1200 cs8 -cstopb ignpar eol 255 eof 255
sleep 10
/home/mikolai/TUD/Code/RIOT-build/dist/tools/uf2/uf2conv.py -f 0xADA52840 /home/mikolai/TUD/Code/RIOT-build/tests/drivers/mtd_raw/bin/seeedstudio-xiao-nrf52840/tests_mtd_raw.hex --base 0x1000
Converted to uf2, output size: 62464, start address: 0x1000
Flashing /media/mikolai/XIAO-SENSE (Seeed_XIAO_nRF52840_Sense)
Wrote 62464 bytes to /media/mikolai/XIAO-SENSE/NEW.UF2
sleep 2
/home/mikolai/TUD/Code/RIOT-build/dist/tools/pyterm/pyterm -p "/dev/ttyACM0" -b "115200" -ln "/tmp/pyterm-mikolai" -rn "2024-11-25_16.52.18-tests_mtd_raw-seeedstudio-xiao-nrf52840"  
Twisted not available, please install it if you want to use pyterm's JSON capabilities
2024-11-25 16:52:18,148 # Connect to serial port /dev/ttyACM0
Welcome to pyterm!
Type '/exit' to exit.
2024-11-25 16:52:19,150 # main(): This is RIOT! (Version: 2025.01-devel-193-g72f9f-board-xiao-nrf52840)
2024-11-25 16:52:19,151 # Manual MTD test
2024-11-25 16:52:19,151 # init MTD_0… OK (2 MiB)
info
2024-11-25 16:52:24,740 # info
2024-11-25 16:52:24,741 # mtd devices: 1
2024-11-25 16:52:24,741 #  -=[ MTD_0 ]=-
2024-11-25 16:52:24,742 # sectors: 512
2024-11-25 16:52:24,742 # pages per sector: 16
2024-11-25 16:52:24,742 # page size: 256
2024-11-25 16:52:24,743 # total: 2 MiB
> test 0
2024-11-25 16:52:27,891 # test 0
2024-11-25 16:52:27,891 # [START]
2024-11-25 16:52:28,207 # [SUCCESS]
> 

@mguetschow
Copy link
Contributor Author

mguetschow commented Nov 26, 2024

Status update on tests that have been failing previously:

Some of them fail with stdio_cdc_acm but not with stdio_uart. In some cases this is expected, in others not really.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: boards Area: Board ports Area: build system Area: Build system Area: doc Area: Documentation Area: Kconfig Area: Kconfig integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants