Skip to content

boards/seeedstudio-xiao-nrf52840-sense: Add Initial Support #21332

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

Merged
merged 4 commits into from
Apr 1, 2025

Conversation

crasbe
Copy link
Contributor

@crasbe crasbe commented Mar 27, 2025

Contribution description

This is basically copy&paste of #20980 by @mguetschow with support for the LSM6DS3TR-C added that is on board of the Seeedstudio Xiao nRF52840 Sense. The LSM6DS3TR-C (not to be confused with the LSM6DS3!) is register compatible with the LSM6DSL, which is supported by the drivers/lsm6dsxx library.

Testing procedure

Since this is mostly a Xiao nRF52840, you can do all the tests (except for the IMU test) with that as well (totally not looking at you @mguetschow 👀 ).

The values from the tests/drivers/lsm6dsxx test appear to be plausible:

Accelerometer x: -149 y: -1013 z: 122
Gyroscope x: -4 y: -23 z: -7
Temperature [in °C x 100]: 2577 

Accelerometer x: -149 y: -1013 z: 122
Gyroscope x: -2 y: -23 z: -3
Temperature [in °C x 100]: 2576 

Accelerometer x: -148 y: -1012 z: 122
Gyroscope x: -2 y: -23 z: -2
Temperature [in °C x 100]: 2572 

Accelerometer x: -148 y: -1012 z: 122
Gyroscope x: -2 y: -22 z: 0
Temperature [in °C x 100]: 2573 

Accelerometer x: -147 y: -1015 z: 119
Gyroscope x: -4 y: -22 z: -7
Temperature [in °C x 100]: 2580 

Accelerometer x: -150 y: -1012 z: 122
Gyroscope x: -2 y: -22 z: -2
Temperature [in °C x 100]: 2578 

Accelerometer x: -149 y: -1013 z: 122
Gyroscope x: -3 y: -22 z: -3
Temperature [in °C x 100]: 2578 

Accelerometer x: -149 y: -1011 z: 122
Gyroscope x: -2 y: -22 z: -2
Temperature [in °C x 100]: 2582 

Also you can check the generated doxygen documentation.

Issues/PRs

Depends on #21334.

@crasbe crasbe added Type: new feature The issue requests / The PR implemements a new feature for RIOT CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Mar 27, 2025
@github-actions github-actions bot added Area: doc Area: Documentation Area: boards Area: Board ports Area: Kconfig Area: Kconfig integration labels Mar 27, 2025
@crasbe crasbe force-pushed the pr/xiao-nrf52-sense branch from 8f4eded to cc89a7c Compare March 27, 2025 21:14
@riot-ci
Copy link

riot-ci commented Mar 27, 2025

Murdock results

✔️ PASSED

cee150d boards/common/seeedstudio-xiao-nrf52840: add macro docs

Success Failures Total Runtime
10286 0 10287 11m:58s

Artifacts

@crasbe crasbe force-pushed the pr/xiao-nrf52-sense branch from cc89a7c to 88e29e6 Compare March 27, 2025 21:23
@mguetschow
Copy link
Contributor

This is basically copy&paste of #20980 by @mguetschow with support for the LSM6DS3TR-C added that is on board of the Seeedstudio Xiao nRF52840 Sense.

If this is mostly a copy&paste, wouldn't it qualify for a new common board to have less code duplication? :P

@crasbe
Copy link
Contributor Author

crasbe commented Mar 28, 2025

I thought about that. The original approach had a lot of Symlinks, but that's not ideal. However the question is "how many similar/same boards justify moving code to the common folder"?

@mguetschow
Copy link
Contributor

I'd say two is already enough as it is not much overhead, especially now that #21327 is in.

@crasbe crasbe force-pushed the pr/xiao-nrf52-sense branch 2 times, most recently from 1a16a4c to 3234abd Compare March 28, 2025 11:45
@crasbe
Copy link
Contributor Author

crasbe commented Mar 28, 2025

The failing static test is expected until #21334 is merged.


This PR would be the perfect opportunity to address the undocumented #defines in the headers as well and reduce the wall of doxygen warnings a tiiiiiiiny bit (by 68 warnings):

Current list of warnings on master:
cbuec@W11nMate:~/RIOTstuff/riot-xiao-sense/RIOT$ make doc |& grep -i seeedstudio-xiao-nrf52840
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/arduino_iomap.h:37: warning: Member ARDUINO_UART_DEV (macro definition) of file arduino_iomap.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/arduino_iomap.h:44: warning: Member ARDUINO_SPI_DEV (macro definition) of file arduino_iomap.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/arduino_iomap.h:51: warning: Member ARDUINO_I2C_DEV (macro definition) of file arduino_iomap.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/arduino_iomap.h:58: warning: Member ARDUINO_LED (macro definition) of file arduino_iomap.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/arduino_iomap.h:66: warning: Member ARDUINO_PIN_0 (macro definition) of file arduino_iomap.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/arduino_iomap.h:67: warning: Member ARDUINO_PIN_1 (macro definition) of file arduino_iomap.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/arduino_iomap.h:68: warning: Member ARDUINO_PIN_2 (macro definition) of file arduino_iomap.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/arduino_iomap.h:69: warning: Member ARDUINO_PIN_3 (macro definition) of file arduino_iomap.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/arduino_iomap.h:70: warning: Member ARDUINO_PIN_4 (macro definition) of file arduino_iomap.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/arduino_iomap.h:71: warning: Member ARDUINO_PIN_5 (macro definition) of file arduino_iomap.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/arduino_iomap.h:72: warning: Member ARDUINO_PIN_6 (macro definition) of file arduino_iomap.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/arduino_iomap.h:75: warning: Member ARDUINO_PIN_7 (macro definition) of file arduino_iomap.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/arduino_iomap.h:76: warning: Member ARDUINO_PIN_8 (macro definition) of file arduino_iomap.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/arduino_iomap.h:77: warning: Member ARDUINO_PIN_9 (macro definition) of file arduino_iomap.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/arduino_iomap.h:78: warning: Member ARDUINO_PIN_10 (macro definition) of file arduino_iomap.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/arduino_iomap.h:81: warning: Member ARDUINO_PIN_11 (macro definition) of file arduino_iomap.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/arduino_iomap.h:82: warning: Member ARDUINO_PIN_12 (macro definition) of file arduino_iomap.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/arduino_iomap.h:83: warning: Member ARDUINO_PIN_13 (macro definition) of file arduino_iomap.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/arduino_iomap.h:85: warning: Member ARDUINO_PIN_LAST (macro definition) of file arduino_iomap.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/arduino_iomap.h:92: warning: Member ARDUINO_PIN_A0 (macro definition) of file arduino_iomap.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/arduino_iomap.h:93: warning: Member ARDUINO_PIN_A1 (macro definition) of file arduino_iomap.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/arduino_iomap.h:94: warning: Member ARDUINO_PIN_A2 (macro definition) of file arduino_iomap.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/arduino_iomap.h:95: warning: Member ARDUINO_PIN_A3 (macro definition) of file arduino_iomap.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/arduino_iomap.h:96: warning: Member ARDUINO_PIN_A4 (macro definition) of file arduino_iomap.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/arduino_iomap.h:97: warning: Member ARDUINO_PIN_A5 (macro definition) of file arduino_iomap.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/arduino_iomap.h:117: warning: Member ARDUINO_A0 (macro definition) of file arduino_iomap.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/arduino_iomap.h:118: warning: Member ARDUINO_A1 (macro definition) of file arduino_iomap.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/arduino_iomap.h:119: warning: Member ARDUINO_A2 (macro definition) of file arduino_iomap.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/arduino_iomap.h:120: warning: Member ARDUINO_A3 (macro definition) of file arduino_iomap.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/arduino_iomap.h:121: warning: Member ARDUINO_A4 (macro definition) of file arduino_iomap.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/arduino_iomap.h:122: warning: Member ARDUINO_A5 (macro definition) of file arduino_iomap.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/arduino_iomap.h:124: warning: Member ARDUINO_ANALOG_PIN_LAST (macro definition) of file arduino_iomap.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/board.h:34: warning: Member LED0_PIN (macro definition) of file board.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/board.h:35: warning: Member LED1_PIN (macro definition) of file board.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/board.h:36: warning: Member LED2_PIN (macro definition) of file board.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/board.h:38: warning: Member LED_PORT (macro definition) of file board.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/board.h:39: warning: Member LED0_MASK (macro definition) of file board.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/board.h:40: warning: Member LED1_MASK (macro definition) of file board.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/board.h:41: warning: Member LED2_MASK (macro definition) of file board.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/board.h:42: warning: Member LED_MASK (macro definition) of file board.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/board.h:44: warning: Member LED0_ON (macro definition) of file board.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/board.h:45: warning: Member LED0_OFF (macro definition) of file board.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/board.h:46: warning: Member LED0_TOGGLE (macro definition) of file board.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/board.h:48: warning: Member LED1_ON (macro definition) of file board.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/board.h:49: warning: Member LED1_OFF (macro definition) of file board.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/board.h:50: warning: Member LED1_TOGGLE (macro definition) of file board.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/board.h:52: warning: Member LED2_ON (macro definition) of file board.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/board.h:53: warning: Member LED2_OFF (macro definition) of file board.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/board.h:54: warning: Member LED2_TOGGLE (macro definition) of file board.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/board.h:66: warning: Member XIAO_NRF52840_NOR_PAGE_SIZE (macro definition) of file board.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/board.h:67: warning: Member XIAO_NRF52840_NOR_PAGES_PER_SECTOR (macro definition) of file board.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/board.h:68: warning: Member XIAO_NRF52840_NOR_SECTOR_COUNT (macro definition) of file board.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/board.h:69: warning: Member XIAO_NRF52840_NOR_FLAGS (macro definition) of file board.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/board.h:71: warning: Member XIAO_NRF52840_NOR_SPI_DEV (macro definition) of file board.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/board.h:72: warning: Member XIAO_NRF52840_NOR_SPI_CLK (macro definition) of file board.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/board.h:73: warning: Member XIAO_NRF52840_NOR_SPI_CS (macro definition) of file board.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/board.h:74: warning: Member XIAO_NRF52840_NOR_SPI_WP (macro definition) of file board.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/board.h:75: warning: Member XIAO_NRF52840_NOR_SPI_HOLD (macro definition) of file board.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/board.h:76: warning: Member XIAO_NRF52840_NOR_SPI_MODE (macro definition) of file board.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/board.h:86: warning: Member CONFIG_ZTIMER_USEC_ADJUST_SET (macro definition) of file board.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/board.h:87: warning: Member CONFIG_ZTIMER_USEC_ADJUST_SLEEP (macro definition) of file board.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/periph_conf.h:49: warning: Member UART_0_ISR (macro definition) of file periph_conf.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/periph_conf.h:51: warning: Member UART_NUMOF (macro definition) of file periph_conf.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/periph_conf.h:36: warning: Member uart_config[] (variable) of file periph_conf.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/periph_conf.h:73: warning: Member SPI_NUMOF (macro definition) of file periph_conf.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/periph_conf.h:58: warning: Member spi_config[] (variable) of file periph_conf.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/periph_conf.h:88: warning: Member I2C_NUMOF (macro definition) of file periph_conf.h is not documented.
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/boards/seeedstudio-xiao-nrf52840/include/periph_conf.h:80: warning: Member i2c_config[] (variable) of file periph_conf.h is not documented.

@crasbe
Copy link
Contributor Author

crasbe commented Mar 28, 2025

The documentation has been added and Doxygen does not throw any errors about the seeedstudio-xiao-nrf52840 anymore.

Furthermore I corrected the position of the Include Guards as discussed in #21325.

Copy link
Contributor

@mguetschow mguetschow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! Will try that (with a non-Sense version of the board) on Monday, but already left some comments below.

@crasbe crasbe force-pushed the pr/xiao-nrf52-sense branch 3 times, most recently from badd662 to 738aab8 Compare March 29, 2025 12:11
@crasbe crasbe added the State: waiting for other PR State: The PR requires another PR to be merged first label Mar 29, 2025
@mguetschow
Copy link
Contributor

Unfortunately there seems to be a regression with default module selection.

Current master (and with #21334) gives

$ make -C examples/basic/default BOARD=seeedstudio-xiao-nrf52840 info-modules
auto_init
auto_init_gnrc_netif
auto_init_gnrc_pktbuf
auto_init_gnrc_pktdump
auto_init_random
auto_init_saul
auto_init_usbus
auto_init_ztimer
board
board_common_init
boards_common_adafruit-nrf52-bootloader
core
core_init
core_lib
core_msg
core_panic
core_thread
core_thread_flags
cortexm_common
cortexm_common_periph
cortexm_fpu
cpu
cpu_common
div
eui_provider
event
fmt
frac
gnrc
gnrc_netapi
gnrc_netif
gnrc_netif_hdr
gnrc_netif_ieee802154
gnrc_netif_init_devs
gnrc_netif_pktq
gnrc_netreg
gnrc_pkt
gnrc_pktbuf
gnrc_pktbuf_static
gnrc_pktdump
gnrc_txtsnd
ieee802154
ieee802154_submac
isrpipe
l2util
libc
luid
malloc_thread_safe
mpu_stack_guard
netdev
netdev_default
netdev_ieee802154
netdev_ieee802154_submac
netdev_legacy_api
netdev_register
netif
newlib
newlib_nano
newlib_syscalls_default
nrf52_vectors
nrf5x_common_periph
nrf802154
od
periph
periph_common
periph_cpuid
periph_gpio
periph_gpio_ll_disconnect
periph_gpio_ll_input_pull_down
periph_gpio_ll_input_pull_up
periph_gpio_ll_irq_edge_triggered_both
periph_gpio_ll_irq_unmask
periph_gpio_ll_open_drain
periph_gpio_ll_open_drain_pull_up
periph_gpio_ll_open_source
periph_gpio_ll_open_source_pull_down
periph_hwrng
periph_init
periph_init_cpuid
periph_init_gpio
periph_init_hwrng
periph_init_led0
periph_init_led1
periph_init_led2
periph_init_led3
periph_init_led4
periph_init_led5
periph_init_led6
periph_init_led7
periph_init_leds
periph_init_pm
periph_init_rtt
periph_init_temperature
periph_init_timer
periph_init_uart
periph_init_usbdev
periph_init_usbdev_clk
periph_pm
periph_rtt
periph_temperature
periph_timer
periph_uart
periph_usbdev
periph_usbdev_clk
phydat
preprocessor
preprocessor_successor
prng
prng_musl_lcg
ps
random
saul
saul_default
saul_gpio
saul_init_devs
saul_nrf_temperature
saul_reg
shell
shell_cmd_gnrc_netif
shell_cmd_gnrc_txtsnd
shell_cmd_pm
shell_cmd_ps
shell_cmd_saul_reg
shell_cmd_sys
shell_cmds
shell_cmds_default
stdin
stdio
stdio_available
stdio_cdc_acm
stdio_default
stdio_dispatch
stdio_uart
stdio_uart_rx
sys
tsrb
usb_board_reset
usbus
usbus_cdc_acm
xtimer
ztimer
ztimer_convert
ztimer_convert_frac
ztimer_convert_shift
ztimer_core
ztimer_extend
ztimer_init
ztimer_msec
ztimer_periph_rtt
ztimer_periph_timer
ztimer_usec
ztimer_xtimer_compat

while this PR (among others) automatically selects BLE instead of 802.15.4:

$ make -C examples/basic/default BOARD=seeedstudio-xiao-nrf52840 info-modules
auto_init
auto_init_gnrc_netif
auto_init_gnrc_pktbuf
auto_init_gnrc_pktdump
auto_init_random
auto_init_saul
auto_init_usbus
auto_init_ztimer
bluetil_ad
bluetil_addr
board
board_common_init
boards_common_adafruit-nrf52-bootloader
boards_common_seeedstudio-xiao-nrf52840
core
core_init
core_lib
core_msg
core_panic
core_thread
core_thread_flags
cortexm_common
cortexm_common_periph
cpu
cpu_common
div
eui_provider
event
event_callback
fmt
frac
gnrc
gnrc_netapi
gnrc_netif
gnrc_netif_hdr
gnrc_netif_init_devs
gnrc_netreg
gnrc_pkt
gnrc_pktbuf
gnrc_pktbuf_static
gnrc_pktdump
gnrc_txtsnd
isrpipe
l2util
libc
luid
malloc_thread_safe
mpu_stack_guard
netdev
netdev_default
netif
newlib
newlib_nano
newlib_syscalls_default
nimble_addr
nimble_controller
nimble_drivers_nrf5x
nimble_host
nimble_host_store_ram
nimble_host_util
nimble_netif
nimble_npl_riot
nimble_porting_nimble
nimble_riot_contrib
nimble_scanlist
nimble_scanner
nimble_transport
nrf52_vectors
nrf5x_common_periph
od
periph
periph_common
periph_cpuid
periph_gpio
periph_gpio_ll_disconnect
periph_gpio_ll_input_pull_down
periph_gpio_ll_input_pull_up
periph_gpio_ll_irq_edge_triggered_both
periph_gpio_ll_irq_unmask
periph_gpio_ll_open_drain
periph_gpio_ll_open_drain_pull_up
periph_gpio_ll_open_source
periph_gpio_ll_open_source_pull_down
periph_hwrng
periph_init
periph_init_cpuid
periph_init_gpio
periph_init_hwrng
periph_init_led0
periph_init_led1
periph_init_led2
periph_init_led3
periph_init_led4
periph_init_led5
periph_init_led6
periph_init_led7
periph_init_leds
periph_init_pm
periph_init_rtt
periph_init_temperature
periph_init_timer
periph_init_uart
periph_init_usbdev
periph_init_usbdev_clk
periph_pm
periph_rtt
periph_temperature
periph_timer
periph_uart
periph_usbdev
periph_usbdev_clk
phydat
preprocessor
preprocessor_successor
prng
prng_musl_lcg
ps
random
saul
saul_default
saul_gpio
saul_init_devs
saul_nrf_temperature
saul_reg
sema
shell
shell_cmd_gnrc_netif
shell_cmd_gnrc_txtsnd
shell_cmd_nimble_netif
shell_cmd_pm
shell_cmd_ps
shell_cmd_saul_reg
shell_cmd_sys
shell_cmds
shell_cmds_default
stdin
stdio
stdio_available
stdio_cdc_acm
stdio_default
stdio_dispatch
stdio_uart
stdio_uart_rx
sys
tsrb
usb_board_reset
usbus
usbus_cdc_acm
ztimer
ztimer_convert
ztimer_convert_frac
ztimer_convert_shift
ztimer_core
ztimer_extend
ztimer_init
ztimer_msec
ztimer_periph_rtt
ztimer_periph_timer
ztimer_usec

@crasbe
Copy link
Contributor Author

crasbe commented Mar 31, 2025

That behavior is caused by moving the CPU_MODEL to the common file.

Adding $(warning $(CPU_MODEL)) to the cpu/nrf52/Makefile.dep shows the following:

cbuec@W11nMate:~/RIOTstuff/riot-xiao-sense/RIOT$ BOARD=seeedstudio-xiao-nrf52840 make -C examples/basic/default -j12
make: Entering directory '/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/examples/basic/default'
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/cpu/nrf52/Makefile.dep:3:
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/cpu/nrf52/Makefile.dep:3: nrf52840xxaa
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/cpu/nrf52/Makefile.dep:3: nrf52840xxaa
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/cpu/nrf52/Makefile.dep:3: nrf52840xxaa
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/cpu/nrf52/Makefile.dep:3: nrf52840xxaa
Building application "default" for "seeedstudio-xiao-nrf52840" with CPU "nrf52".

"make" -C /home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/pkg/cmsis/
...

This is the code that causes the behavior:

ifneq (,$(filter nrf52811xxaa nrf52820xxaa nrf52833xxaa nrf52840xxaa,$(CPU_MODEL)))
# include dependencies for 802.15.4 radio
include $(RIOTCPU)/nrf52/Makefile.nrf802154.dep
else
# include dependencies for BLE
include $(RIOTCPU)/nrf52/Makefile.nimble.dep
endif

To be honest I don't understand why there is such a semi-specific distinction (as in: which are the other nRF52 CPUs?) 🤔
But other Makefiles might have undefined behavior as well if the CPU_MODEL is undefined.

@mguetschow
Copy link
Contributor

That behavior is caused by moving the CPU_MODEL to the common file.

Hum, so we can't move this then, I guess :/

To be honest I don't understand why there is such a semi-specific distinction (as in: which are the other nRF52 CPUs?) 🤔

There actually is the nRF52832 MCU with no 802.15.4 support (e.g., used by the PineTime).

@crasbe
Copy link
Contributor Author

crasbe commented Mar 31, 2025

That behavior is caused by moving the CPU_MODEL to the common file.

Hum, so we can't move this then, I guess :/

Not without additional changes, no. And I'm not sure if would be possible at all without the risk of breaking something else due to the hen-and-egg problem.

When changing the cpu/nrf52/Makefile.dep to only include the BLE stuff when the $(CPU_MODEL) == nrf52832xxaa, the build will still fail because the cpu/nrf52/Makefile.features is only called once and very early on:

include $(RIOTCPU)/$(CPU)/Makefile.features

This is close to the check that got moved away by #21334, so the $(CPU_MODEL) is still unknown at this point, leading to missing FEATURES_PROVIDED:

# The 802.15.4 radio is not available on all SoCs
ifneq (,$(filter nrf52811xxaa nrf52820xxaa nrf52833xxaa nrf52840xxaa,$(CPU_MODEL)))
FEATURES_PROVIDED += radio_nrf802154
# the nrf802154 driver is supported by OpenWSN
FEATURES_PROVIDED += netif_openwsn
endif

I added a $(warning $(CPU_MODEL)) to the cpu/nrf52/Makefile.features and this is the result:

cbuec@W11nMate:~/RIOTstuff/riot-xiao-sense/RIOT$ BOARD=seeedstudio-xiao-nrf52840 make -C examples/basic/default info-modules
make: Entering directory '/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/examples/basic/default'
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/cpu/nrf52/Makefile.features:8:
There are unsatisfied feature requirements: radio_nrf802154
/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/examples/basic/default/../../../Makefile.include:1007: *** You can let the build continue on expected errors by setting CONTINUE_ON_EXPECTED_ERRORS=1 to the command line.  Stop.
make: Leaving directory '/home/cbuec/RIOTstuff/riot-xiao-sense/RIOT/examples/basic/default'

@crasbe crasbe force-pushed the pr/xiao-nrf52-sense branch from 88971a3 to 886e8c6 Compare March 31, 2025 13:07
@crasbe crasbe removed the State: waiting for other PR State: The PR requires another PR to be merged first label Mar 31, 2025
@crasbe
Copy link
Contributor Author

crasbe commented Mar 31, 2025

I rebased this to include #21334 and reverted the move of CPU_MODEL. Let me know when I can squash the fixups.

@mguetschow
Copy link
Contributor

Let me know when I can squash the fixups.

Please squash already, I'll have another look at the final changes (and test it again) tomorrow.

@crasbe crasbe force-pushed the pr/xiao-nrf52-sense branch from 886e8c6 to cee150d Compare March 31, 2025 13:36
Copy link
Contributor

@mguetschow mguetschow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I doubt anyone else from RIOT maintainers has a XIAO nrf52840 Sense available to test the IMU integration, so trusting your test here. Other than that, I've tested some applications with a XIAO nrf52840 and all seems fine.

Thanks!

@mguetschow mguetschow enabled auto-merge April 1, 2025 11:33
@mguetschow mguetschow added this pull request to the merge queue Apr 1, 2025
Merged via the queue into RIOT-OS:master with commit 0afe99c Apr 1, 2025
26 checks passed
@crasbe
Copy link
Contributor Author

crasbe commented Apr 1, 2025

@mguetschow Thank you for your patience, again :)

@crasbe crasbe deleted the pr/xiao-nrf52-sense branch April 1, 2025 14:38
@mguetschow mguetschow added this to the Release 2025.04 milestone Apr 8, 2025
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: doc Area: Documentation Area: Kconfig Area: Kconfig integration CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants