Skip to content

Commit 6b4f04f

Browse files
bors[bot]Fabian Hüßlerfabian18JKRhbEnoch247
authored
19387: drivers/atwinc15x0: support dynamic scanning and connection to AP r=benpicco a=fabian18 19874: coap: add missing option numbers r=benpicco a=JKRhb 19875: coap: add missing Content-Format definitions r=benpicco a=JKRhb 19876: sys/net/ipv4/addr: fix typos r=benpicco a=Enoch247 ### Contribution description This patch fixes some typos in the doxygen doc. ### Testing procedure Nothing to test. No change to code. ### Issues/PRs references - None known 19878: makefiles/usb_board_reset.mk: declare term-delay target with test target r=benpicco a=aabadie 19886: cpu/efm32: fix DAC configuration r=benpicco a=gschorcht ### Contribution description The EFM32 MCU allows the reference voltage to be configured per DAC device, not per DAC channel. Also, the DAC reference voltage was defined in the configuration but not used anywhere. At the moment we have only defined one board (`stwstk6220a`) that uses the DAC, so changing the configuration interface shouldn't be critical. ### Testing procedure `tests/periph/dac` should still work for the `stwstk6220a` ``` BOARD=slwstk6220a make -j8 -C tests/periph/dac flash ``` I don't have a `stwstk6220a` board (EFM32 Series 0) so that I can't test it. I could only test it for the `sltb009a` board (EFM32 Series 1) with the change for VDAC in PR #19887. ### Issues/PRs references 19888: boards/sltb009a: complete and fix documentation r=benpicco a=gschorcht ### Contribution description This PR completes and fixes the documentation which was still in the state as generated automatically by `efm2riot`. The PR also includes a fix of the configuration of the second UART device that was find out while completing the documentation. ### Testing procedure Green CI ### Issues/PRs references Co-authored-by: Fabian Hüßler <[email protected]@MLPA-NB119.(none)> Co-authored-by: Fabian Hüßler <[email protected]> Co-authored-by: Jan Romann <[email protected]> Co-authored-by: Joshua DeWeese <[email protected]> Co-authored-by: Alexandre Abadie <[email protected]> Co-authored-by: Gunar Schorcht <[email protected]>
8 parents 4b1b0a9 + 8e122e9 + cebb374 + b7184da + c67fbd6 + d296bab + a590ac8 + bb216c0 commit 6b4f04f

File tree

31 files changed

+2777
-226
lines changed

31 files changed

+2777
-226
lines changed

boards/sltb009a/doc.txt

Lines changed: 95 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @brief Support for Silicon Labs SLTB009A starter kit
55

66
## Overview
7+
78
Silicon Labs Thunderboard GG12 is equipped with the EFM32 microcontroller.
89
It is specifically designed for low-power applications, having energy-saving
910
peripherals, different energy modes and short wake-up times.
@@ -14,6 +15,7 @@ actively measure the power consumption of your hardware and code, in real-time.
1415
## Hardware
1516

1617
### MCU
18+
1719
| MCU | EFM32GG12B810F1024GM64 |
1820
|-----------------|------------------------------------------------------|
1921
| Family | ARM Cortex-M4F |
@@ -26,80 +28,98 @@ actively measure the power consumption of your hardware and code, in real-time.
2628
| FPU | yes |
2729
| MPU | yes |
2830
| DMA | 12 channels |
29-
| Timers | 4x 32-bit, 7x 16-bit + 1x 16-bit (low power) |
31+
| Timers | 4 x 32-bit, 7 x 16-bit + 1 x 16-bit (low power) |
3032
| ADCs | 12-bit ADC |
31-
| UARTs | 2x UART, 5x USART, 1x LEUART |
32-
| SPIs | 5x USART |
33-
| I2Cs | 2x |
33+
| DACs | 2 x 12-bit VDAC (500 ksamples/s), 1 x IDAC |
34+
| I2Cs | 2 x |
35+
| SPIs | 5 x USART |
36+
| UARTs | 2 x UART, 5 x USART, 1 x LEUART |
37+
| USB | 1 x Low Energy Full-Speed USB 2.0 |
3438
| Vcc | 1.8 V - 3.8 V |
35-
| Datasheet | [Datasheet](https://www.silabs.com/documents/public/data-sheets/efm32gg12-datasheet.pdf) |
36-
| Manual | [Manual](https://www.silabs.com/documents/public/reference-manuals/efm32gg12-rm.pdf) |
37-
| Board Manual | [Board Manual](https://www.silabs.com/documents/public/user-guides/ug371-sltb009a-user-guide.pdf) |
38-
| Board Schematic | Can be downloaded using Silicon Labs' Simplicity Studio |
39+
| Datasheet | [Datasheet](https://www.silabs.com/documents/public/data-sheets/efm32gg12-datasheet.pdf) |
40+
| Manual | [Manual](https://www.silabs.com/documents/public/reference-manuals/efm32gg12-rm.pdf) |
41+
| Board Manual | [Board Manual](https://www.silabs.com/documents/public/user-guides/ug371-sltb009a-user-guide.pdf) |
42+
| Board Schematic | Can be downloaded using Silicon Labs' Simplicity Studio |
3943

4044
### Pinout
41-
This is the pinout of the expansion header on the right side of the board.
42-
PIN 1 is the bottom-left contact when the header faces you horizontally.
43-
44-
| | PIN | PIN | |
45-
|------|-----|-----|------|
46-
| GND | 1 | 2 | VMCU |
47-
| PD0 | 3 | 4 | PA0 |
48-
| PD1 | 5 | 6 | PA1 |
49-
| PA4 | 7 | 8 | PA2 |
50-
| PA5 | 9 | 10 | PA3 |
51-
| PA6 | 11 | 12 | PC4 |
52-
| PE15 | 13 | 14 | PC5 |
53-
| PE5 | 15 | 16 | PE4 |
54-
| | 17 | 18 | 5V |
55-
| | 19 | 20 | 3V3 |
56-
| PB12 | 21 | 22 | PE8 |
57-
| PB11 | 23 | 24 | PE9 |
58-
| PB3 | 25 | 26 | PE10 |
59-
| PB4 | 27 | 28 | PE11 |
60-
| PD2 | 29 | 30 | PE13 |
61-
| PD3 | 31 | 32 | PE14 |
62-
| PD4 | 33 | 34 | PF5 |
63-
64-
**Note**: not all starter kits by Silicon Labs share the same pinout!
45+
46+
This is the pinout of the expansion header of the board.
47+
PIN 1 is the top-left contact.
48+
49+
| RIOT Peripheral | Name | PIN | PIN | Name | RIOT Peripheral |
50+
|-----------------|------|-----|-----|------|-----------------|
51+
| | GND | 1 | 2 | VMCU | |
52+
| | PD0 | 3 | 4 | PA0 | SPI_DEV(0):MOSI |
53+
| | PD1 | 5 | 6 | PA1 | SPI_DEV(0):MISO |
54+
| | PA4 | 7 | 8 | PA2 | SPI_DEV(0):CLK |
55+
| | PA5 | 9 | 10 | PA3 | |
56+
| | PA6 | 11 | 12 | PC4 | UART_DEV(1):TX |
57+
| | PE15 | 13 | 14 | PC5 | UART_DEV(1):RX |
58+
| I2C_DEV(0):SCL | PE5 | 15 | 16 | PE4 | I2C_DEV(0):SCL |
59+
| | | 17 | 18 | 5V | |
60+
| | | 19 | 20 | 3V3 | |
61+
| | PB12 | 21 | 22 | PE8 | |
62+
| DAC_LINE(0) | PB11 | 23 | 24 | PE9 | |
63+
| | PB3 | 25 | 26 | PE10 | |
64+
| | PB4 | 27 | 28 | PE11 | |
65+
| | PD2 | 29 | 30 | PE13 | |
66+
| | PD3 | 31 | 32 | PE14 | |
67+
| | PD4 | 33 | 34 | PF5 | |
6568

6669
### Peripheral mapping
67-
| Peripheral | Number | Hardware | Pins | Comments |
68-
|------------|---------|-------------------|-----------------------------------|-----------------------------------------------------------|
70+
71+
| Peripheral | Number | Hardware | Pins | Comments |
72+
|-------------|---------|------------|------------------|-------------------------------------|
73+
| ADC | 0 | ADC0:CH0 | | Internal temperature |
74+
| ADC | 1 | ADC0:CH1 | | AVDD |
75+
| I2C | 0 | I2C0 | SDA:PE4, SCL:PE5 | Normal speed |
76+
| HWCRYPTO | - | - | | AES128/AES256, SHA1, SHA224/SHA256 |
77+
| HWRNG | - | TNRG0 | | True Random Number Generator (TRNG) |
78+
| RTT | - | RTCC | | 1 Hz interval, either RTT or RTC |
79+
| RTC | - | RTCC | | 1 Hz interval, either RTT or RTC |
80+
| SPI | 0 | USART3 | MOSI:PA0, MISO:PA1, CLK:PA2 | |
81+
| Timer | 0 | TIMER0 + TIMER1 | | TIMER0 is used as prescaler |
82+
| Timer | 1 | LETIMER0 | | |
83+
| UART | 0 | USART0 | RX:PE6, TX:PE7 | Default STDIO |
84+
| UART | 1 | UART0 | RX:PC5, TX:PC4 | |
6985

7086
### User interface
71-
| Peripheral | Mapped to | Pin | Comments |
72-
|------------|-----------|------|------------|
73-
| Button | PB0_PIN | PD5 | |
74-
| | PB1_PIN | PD8 | |
75-
| LED | LED0R_PIN | PA12 | |
76-
| | LED0G_PIN | PA13 | |
77-
| | LED0B_PIN | PA14 | |
78-
| | LED1R_PIN | PD6 | |
79-
| | LED1G_PIN | PF12 | |
80-
| | LED1B_PIN | PE12 | |
87+
88+
| Peripheral | Mapped to | Pin | Comments |
89+
|------------|-----------|-----------|------------|
90+
| Button | PB0_PIN | PD5 | |
91+
| | PB1_PIN | PD8 | |
92+
| LED | LED0R_PIN | PA12 | |
93+
| | LED0G_PIN | PA13 | |
94+
| | LED0B_PIN | PA14 | |
95+
| | LED1R_PIN | PD6 | |
96+
| | LED1G_PIN | PF12 | |
97+
| | LED1B_PIN | PE12 | |
8198
| | LED0_PIN | LED0R_PIN | |
8299
| | LED1_PIN | LED1R_PIN | |
83100

84101
## Implementation Status
85-
| Device | ID | Supported | Comments |
86-
|-------------------------------|-------------------------------------|-----------|----------------------------------------------------------------|
87-
| MCU | EFM32GG12B | yes | Power modes supported |
88-
| Low-level driver | ADC | yes | |
89-
| | Flash | yes | |
90-
| | GPIO | yes | Interrupts are shared across pins (see reference manual) |
91-
| | HW Crypto | yes | |
92-
| | I2C | yes | |
93-
| | PWM | yes | |
94-
| | RTCC | yes | As RTT or RTC |
95-
| | SPI | partially | Only master mode |
96-
| | Timer | yes | |
97-
| | UART | yes | USART is shared with SPI. LEUART baud rate limited (see below) |
98-
| | USB | no | |
102+
103+
| Device | ID | Supported | Comments |
104+
|------------------|------------|-----------|----------------------------------------------------|
105+
| MCU | EFM32GG12B | yes | Power modes supported |
106+
| Low-level driver | ADC | yes | |
107+
| | DAC | yes | VDAC, IDAC is not supported |
108+
| | Flash | yes | |
109+
| | GPIO | yes | Interrupts are shared across pins (see ref manual) |
110+
| | HW Crypto | yes | |
111+
| | I2C | yes | |
112+
| | PWM | yes | |
113+
| | RTCC | yes | As RTT or RTC |
114+
| | SPI | yes | Only master mode |
115+
| | Timer | yes | |
116+
| | UART | yes | USART is shared with SPI. LEUART baud rate limited |
117+
| | USB | yes | Device mode |
99118

100119
## Board configuration
101120

102121
### Board controller
122+
103123
The starter kit is equipped with a Board Controller. This controller provides
104124
a virtual serial port.
105125

@@ -108,8 +128,10 @@ a virtual serial port.
108128
expects data from the MCU with the same settings.
109129

110130
### Clock selection
131+
111132
There are several clock sources that are available for the different
112-
peripherals. You are advised to read [AN0004.0](https://www.silabs.com/documents/public/application-notes/an0004.0-efm32-cmu.pdf)
133+
peripherals. You are advised to read [AN0004.0]
134+
(https://www.silabs.com/documents/public/application-notes/an0004.0-efm32-cmu.pdf)
113135
to get familiar with the different clocks.
114136

115137
| Source | Internal | Speed | Comments |
@@ -145,6 +167,7 @@ You can override the branch's clock source by adding `CLOCK_LFA=source` to your
145167
compiler defines, e.g. `CLOCK_LFA=cmuSelect_LFRCO`.
146168

147169
### Low-power peripherals
170+
148171
The low-power UART is capable of providing an UART peripheral using a low-speed
149172
clock. When the LFB clock source is the LFRCO or LFXO, it can still be used in
150173
EM2. However, this limits the baud rate to 9600 baud. If a higher baud rate is
@@ -154,6 +177,7 @@ desired, set the clock source to CORELEDIV2.
154177
this setting. Ensure you do not refer to any low-power peripherals.
155178

156179
### RTC or RTT
180+
157181
RIOT-OS has support for *Real-Time Tickers* and *Real-Time Clocks*.
158182

159183
However, this board MCU family has support for a 32-bit *Real-Time Clock and
@@ -163,13 +187,15 @@ Therefore, only one of both peripherals can be enabled at the same time.
163187
Configured at 1 Hz interval, the RTCC will overflow each 136 years.
164188

165189
### Hardware crypto
190+
166191
This MCU is equipped with a hardware-accelerated crypto peripheral that can
167192
speed up AES128, AES256, SHA1, SHA256 and several other cryptographic
168193
computations.
169194

170195
A peripheral driver interface is proposed, but not yet implemented.
171196

172197
### Usage of EMLIB
198+
173199
This port makes uses of EMLIB by Silicon Labs to abstract peripheral registers.
174200
While some overhead is to be expected, it ensures proper setup of devices,
175201
provides chip errata and simplifies development. The exact overhead depends on
@@ -182,6 +208,7 @@ that peripherals are used properly. To enable this, pass `DEBUG_EFM` to your
182208
compiler.
183209

184210
### Pin locations
211+
185212
The EFM32 platform supports peripherals to be mapped to different pins
186213
(predefined locations). The definitions in `periph_conf.h` mostly consist of a
187214
location number and the actual pins. The actual pins are required to configure
@@ -195,38 +222,39 @@ This MCU has extended pin mapping support. Each pin of a peripheral can be
195222
connected separately to one of the predefined pins for that peripheral.
196223

197224
## Flashing the device
198-
To flash, [SEGGER JLink](https://www.segger.com/jlink-software.html) is
199-
required.
200225

201-
Flashing is supported by RIOT-OS using the command below:
226+
The board provides a on-board J-Link debugger through the micro USB board so
227+
that flashing and debugging is very easy.
202228

229+
Flashing is supported by RIOT-OS using the command below:
203230
```
204231
make flash
205232
```
206233

207234
To run the GDB debugger, use the command:
208-
209235
```
210236
make debug
211237
```
212238

213239
Or, to connect with your own debugger:
214-
215240
```
216241
make debug-server
217242
```
218243

219244
Some boards have (limited) support for emulation, which can be started with:
220-
221245
```
222246
make emulate
223247
```
224248

225249
## Supported Toolchains
250+
226251
For using the Silicon Labs SLTB009A starter kit we strongly recommend
227-
the usage of the [GNU Tools for ARM Embedded Processors](https://developer.arm.com/open-source/gnu-toolchain/gnu-rm)
252+
the usage of the [GNU Tools for ARM Embedded Processors]
253+
(https://developer.arm.com/open-source/gnu-toolchain/gnu-rm)
228254
toolchain.
229255

230256
## License information
231-
* Silicon Labs' EMLIB: zlib-style license (permits distribution of source).
257+
258+
Silicon Labs' EMLIB: zlib-style license (permits distribution of source).
259+
232260
*/

boards/sltb009a/include/periph_conf.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -184,19 +184,19 @@ static const uart_conf_t uart_config[] = {
184184
.irq = USART0_RX_IRQn
185185
},
186186
{
187-
.dev = LEUART0,
188-
.rx_pin = GPIO_PIN(PD, 11),
189-
.tx_pin = GPIO_PIN(PD, 10),
190-
.loc = LEUART_ROUTELOC0_RXLOC_LOC0 |
191-
LEUART_ROUTELOC0_TXLOC_LOC0,
192-
.cmu = cmuClock_LEUART0,
193-
.irq = LEUART0_IRQn
187+
.dev = UART0,
188+
.rx_pin = GPIO_PIN(PC, 5),
189+
.tx_pin = GPIO_PIN(PC, 4),
190+
.loc = UART_ROUTELOC0_RXLOC_LOC4 |
191+
UART_ROUTELOC0_TXLOC_LOC4,
192+
.cmu = cmuClock_UART0,
193+
.irq = UART0_RX_IRQn
194194
}
195195
};
196196

197197
#define UART_NUMOF ARRAY_SIZE(uart_config)
198198
#define UART_0_ISR_RX isr_usart0_rx
199-
#define UART_1_ISR_RX isr_leuart0
199+
#define UART_1_ISR_RX isr_uart0_rx
200200
/** @} */
201201

202202
#ifdef __cplusplus

boards/slwstk6220a/include/periph_conf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@ static const dac_conf_t dac_config[] = {
8484
{
8585
.dev = DAC0,
8686
.cmu = cmuClock_DAC0,
87+
.ref = dacRefVDD,
8788
}
8889
};
8990

9091
static const dac_chan_conf_t dac_channel_config[] = {
9192
{
9293
.dev = 0,
9394
.index = 1,
94-
.ref = dacRefVDD,
9595
}
9696
};
9797

cpu/efm32/include/periph_cpu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ typedef struct {
7979
*/
8080
typedef struct {
8181
DAC_TypeDef *dev; /**< DAC device used */
82+
DAC_Ref_TypeDef ref; /**< DAC voltage reference */
8283
CMU_Clock_TypeDef cmu; /**< the device CMU channel */
8384
} dac_conf_t;
8485

@@ -88,7 +89,6 @@ typedef struct {
8889
typedef struct {
8990
uint8_t dev; /**< device index */
9091
uint8_t index; /**< channel index */
91-
DAC_Ref_TypeDef ref; /**< channel voltage reference */
9292
} dac_chan_conf_t;
9393
#endif
9494

cpu/efm32/periph/dac.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ int8_t dac_init(dac_t line)
4545
/* reset and initialize peripheral */
4646
DAC_Init_TypeDef init = DAC_INIT_DEFAULT;
4747

48+
init.reference = dac_config[dev].ref;
4849
DAC_Reset(dac_config[dev].dev);
4950
DAC_Init(dac_config[dev].dev, &init);
5051

drivers/atwinc15x0/Makefile.dep

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
USEMODULE += netdev_eth
22
USEMODULE += ztimer_msec
33
USEMODULE += netdev_legacy_api
4+
5+
ifeq (,$(filter atwinc15x0_dynamic_%,$(USEMODULE)))
6+
# use static connect by default when no dynamic module is loaded
7+
USEMODULE += atwinc15x0_static_connect
8+
endif
9+
ifneq (,$(filter atwinc15x0_dynamic_scan,$(USEMODULE)))
10+
USEMODULE += wifi_scan_list
11+
endif
12+
ifneq (,$(filter atwinc15x0_static_connect,$(USEMODULE)))
13+
USEMODULE += ztimer
14+
endif
15+
416
USEPKG += driver_atwinc15x0
517
FEATURES_REQUIRED += periph_gpio
618
FEATURES_REQUIRED += periph_gpio_irq
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
11
USEMODULE_INCLUDES_atwinc15x0 := $(LAST_MAKEFILEDIR)/include
22
USEMODULE_INCLUDES += $(USEMODULE_INCLUDES_atwinc15x0)
3+
4+
# Try to connect to a preknown AP (WIFI_SSID, WIFI_PASS)
5+
PSEUDOMODULES += atwinc15x0_static_connect
6+
# Accept connection requests (NETOPT_CONNECT)
7+
PSEUDOMODULES += atwinc15x0_dynamic_connect
8+
# Accept scan requests (NETOPT_SCAN)
9+
PSEUDOMODULES += atwinc15x0_dynamic_scan

0 commit comments

Comments
 (0)