Skip to content

Commit 1a16a4c

Browse files
committed
boards/seeedstudio-xiao-nrf52840-sense: add initial support
1 parent 6d7bc64 commit 1a16a4c

File tree

8 files changed

+124
-0
lines changed

8 files changed

+124
-0
lines changed

boards/common/seeedstudio-xiao-nrf52840/include/board.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,18 @@ extern "C" {
7979
/** Default MTD device */
8080
#define MTD_0 mtd_dev_get(0)
8181

82+
#ifdef BOARD_SEEEDSTUDIO_XIAO_NRF52840_SENSE
83+
/**
84+
* @name LSM6DS3TR-C IMU sensor configuration
85+
* @{
86+
*/
87+
#define LSM6DSXX_PARAM_I2C I2C_DEV(1) /**< I2C device of the IMU */
88+
#define LSM6DSXX_PARAM_ADDR (0x6A) /**< I2C address of the IMU */
89+
90+
#define LSM6DS3_PWR_PIN GPIO_PIN(1, 8) /**< The IMU is directly supplied by P1.08 */
91+
/** @} */
92+
#endif
93+
8294
/**
8395
* @name ztimer configuration values
8496
* @{
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright (c) 2024 TU Dresden
2+
#
3+
# This file is subject to the terms and conditions of the GNU Lesser
4+
# General Public License v2.1. See the file LICENSE in the top level
5+
# directory for more details.
6+
7+
config BOARD
8+
default "seeedstudio-xiao-nrf52840-sense" if BOARD_XIAO_NRF52840_SENSE
9+
10+
config BOARD_XIAO_NRF52840_SENSE
11+
bool
12+
default y
13+
select BOARD_COMMON_NRF52
14+
select CPU_MODEL_NRF52840XXAA
15+
16+
source "$(RIOTBOARD)/common/nrf52/Kconfig"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
MODULE = board
2+
3+
include $(RIOTBASE)/Makefile.base
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
ifneq (,$(filter saul_default,$(USEMODULE)))
2+
USEMODULE += lsm6dsxx
3+
endif
4+
5+
# Use the NRFX package for the board initialization
6+
USEPKG += nrfx
7+
8+
USEMODULE += boards_common_seeedstudio-xiao-nrf52840
9+
10+
# include common nrf52 dependencies
11+
include $(RIOTBOARD)/common/nrf52/Makefile.dep
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CPU_MODEL = nrf52840xxaa
2+
3+
include $(RIOTBOARD)/common/nrf52/Makefile.features
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
UF2_SOFTDEV ?= SD730
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright (C) 2025 Technische Universität Hamburg
3+
*
4+
* This file is subject to the terms and conditions of the GNU Lesser
5+
* General Public License v2.1. See the file LICENSE in the top level
6+
* directory for more details.
7+
*/
8+
9+
/**
10+
* @ingroup boards_seeedstudio-xiao-nrf52840-sense
11+
* @{
12+
*
13+
* @file board.c
14+
* @brief Board specific implementations for the Seeedstudio Xiao
15+
* nRF52840 Sense board
16+
*
17+
*
18+
* @author Christopher Büchse <[email protected]>
19+
*
20+
* @}
21+
*/
22+
23+
#include <stdio.h>
24+
25+
#include "board.h"
26+
#include "periph/gpio.h"
27+
28+
#include "hal/nrf_gpio.h"
29+
30+
void board_init(void)
31+
{
32+
/* The IMU is supplied through a GPIO Pin (P1.08), so it has to be set
33+
* to high power mode. */
34+
NRF_P1->PIN_CNF[8] = ((uint32_t)NRF_GPIO_PIN_DIR_OUTPUT << GPIO_PIN_CNF_DIR_Pos)
35+
| ((uint32_t)NRF_GPIO_PIN_INPUT_DISCONNECT << GPIO_PIN_CNF_INPUT_Pos)
36+
| ((uint32_t)NRF_GPIO_PIN_NOPULL << GPIO_PIN_CNF_PULL_Pos)
37+
| ((uint32_t)NRF_GPIO_PIN_H0H1 << GPIO_PIN_CNF_DRIVE_Pos)
38+
| ((uint32_t)NRF_GPIO_PIN_NOSENSE << GPIO_PIN_CNF_SENSE_Pos);
39+
40+
gpio_set(LSM6DS3_PWR_PIN);
41+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
@defgroup boards_seeedstudio-xiao-nrf52840-sense Seeed Studio XIAO nRF52840 Sense
2+
@ingroup boards
3+
@brief Support for the Seeed Studio XIAO nRF52840 Sense
4+
5+
### General information
6+
7+
The [XIAO nRF52840 Sense][seeedstudio-xiao-nrf52840-sense]
8+
is a development board from Seeed Studio's XIAO board family.
9+
10+
It provides native USB support, Bluetooth
11+
Low Energy and IEEE 802.15.4 support via the nRF52840 MCU.
12+
Compared to the [XIAO nRF52840](@ref boards_seeedstudio-xiao-nrf52840) it
13+
features an ST LSM6DS3TR-C IMU and a PDM Microphone (not supported yet).
14+
15+
<img src="https://files.seeedstudio.com/wiki/XIAO-BLE/pinout2.png"
16+
alt="top-down view on seeedstudio-xiao-nrf52840" width="50%"/>
17+
18+
[seeedstudio-xiao-nrf52840-sense]: https://wiki.seeedstudio.com/XIAO_BLE/
19+
20+
### Using the LSM6DS3TR-C IMU
21+
22+
You can test the built-in IMU with the test provided in `tests/drivers/lsm6dsxx`:
23+
24+
```shell
25+
make BOARD=seeedstudio-xiao-nrf52840-sense -C tests/drivers/lsm6dsxx flash term
26+
```
27+
28+
### Flashing, Bootloader, and Terminal
29+
30+
Refer to the [Feather nRF52840 Express
31+
documentation](https://doc.riot-os.org/group__boards__feather-nrf52840.html) for further details.
32+
Both use the same flasher, bootloader, and terminal settings.
33+
34+
Example with `hello-world` application:
35+
```shell
36+
make BOARD=seeedstudio-xiao-nrf52840-sense -C examples/basic/hello-world flash term
37+
```

0 commit comments

Comments
 (0)