1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

42778 Commits

Author SHA1 Message Date
Marian Buschsieweke
3c287c058d
sys/phydat: Fix unit confusion
Previously, `UNIT_G` was used for g-force with the correct symbol `g`,
`UNIT_GR` for gram (as in kilogram) with the incorrect symbol `G` (which
would be correct for Gauss), and `UNIT_GS` for Gauss with symbol `Gs`
(which is an uncommon but correct symbol).

To avoid confusion between G-Force, Gauss, and Gram the units have been
renamed to `UNIT_G_FORCE`, `UNIT_GRAM`, and `UNIT_GAUSS`. In addition,
gram now uses the correct symbol `g` and Gauss uses `G`.
2023-02-23 16:44:24 +01:00
bors[bot]
be29a00d74
Merge #19278 #19290
19278: gnrc_dhcpv6_client_simple_pd: select upstream based on type/index r=benpicco a=benpicco



19290: sys/crypto: make AES_KEY struct private & rename it r=benpicco a=benpicco



Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
Co-authored-by: Benjamin Valentin <benjamin.valentin@bht-berlin.de>
2023-02-20 19:09:03 +00:00
Benjamin Valentin
d6e2499ab7 tests/sys_crypto: add missing <string.h> include 2023-02-20 18:31:23 +01:00
Benjamin Valentin
2285961810 sys/crypto: make AES_KEY struct private 2023-02-20 18:22:00 +01:00
bors[bot]
523a39acd3
Merge #19288
19288: rust: Update riot-sys and riot-wrappers r=kaspar030 a=chrysn

### Contribution description

rust: Update riot-sys and riot-wrappers

* riot-wrappers:
  * Fix infinite loop when using a Mutex
  * Make ValueInThread Copy/Clone
* riot-sys:
  * Export xxx_DEV (eg. I2C_DEV) C macros as functions
  * Add auto_init_utils.h

### Testing procedure

CI checks should suffice.

### Issues/PRs references

This pulls in fixes from

* https://github.com/RIOT-OS/rust-riot-sys/pull/18
* https://github.com/RIOT-OS/rust-riot-sys/pull/17 / https://github.com/RIOT-OS/rust-riot-wrappers/issues/37
* https://github.com/RIOT-OS/rust-riot-wrappers/pull/42 / https://github.com/RIOT-OS/rust-riot-wrappers/issues/41


Co-authored-by: chrysn <chrysn@fsfe.org>
2023-02-20 08:34:11 +00:00
chrysn
bcea914338 rust: Update riot-sys and riot-wrappers
* riot-wrappers:
  * Fix infinite loop when using a Mutex
  * Make ValueInThread Copy/Clone
* riot-sys:
  * Export xxx_DEV (eg. I2C_DEV) C macros as functions
  * Add auto_init_utils.h
2023-02-20 09:06:33 +01:00
bors[bot]
96a7d0d466
Merge #19142
19142: sock_dtls: move common code into sock_dtls_establish_session() r=benpicco a=benpicco



Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de>
2023-02-19 22:11:05 +00:00
bors[bot]
810f8a83eb
Merge #19285
19285: pkg/u8g2: bump version r=gschorcht a=benpicco



Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de>
2023-02-19 16:38:49 +00:00
Benjamin Valentin
df4ef80790 sock_dodtls: make use of sock_dtls_establish_session() 2023-02-19 15:10:46 +01:00
Benjamin Valentin
d4f57e34f4 pkg/u8g2: bump version 2023-02-19 00:03:10 +01:00
Benjamin Valentin
28289a13cb gnrc_dhcpv6_client_simple_pd: check result of _find_upstream_netif() 2023-02-18 23:59:42 +01:00
bors[bot]
3917c29977
Merge #19287
19287: boards/esp32s2-lilygo-ttgo-t8: fix STDIO selection in Kconfig r=benpicco a=gschorcht

### Contribution description

This PR fixes the default STDIO selection in Kconfig in case the USB port is connected to the USB to UART bridge which is then used for STDIO (default). It solves the compilation problems in the nightly build.

The PR also includes a very small documentation fix.

### Testing procedure

Green CI.

The compilations that caused problems  in nightly build should pass:
```
python3 dist/tools/compile_test/compile_like_murdock.py -a tests/pkg_tinyusb_cdc_msc -b  esp32s2-lilygo-ttgo-t8 -j8
```
```
python3 dist/tools/compile_test/compile_like_murdock.py -a tests/sys_fido2_ctap/ -b  esp32s2-lilygo-ttgo-t8 -j8
```
```
python3 dist/tools/compile_test/compile_like_murdock.py -a tests/usbus_board_reset/ -b  esp32s2-lilygo-ttgo-t8 -j8
```

### Issues/PRs references


Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-02-18 15:55:38 +00:00
bors[bot]
9998b7ac05
Merge #19269
19269: cpu/gd32v/periph_i2c: interrupt based driver r=gschorcht a=gschorcht

### Contribution description

This PR provides an interrupt-driven version of the I2C low-level driver.

The existing I2C low-level driver for GDVF103 uses a busy-waiting approach where the status register is continuously polled while waiting for a certain status when sending or receiving. The MCU is thus occupied the whole time during a send or receive operation.

The driver provided with this PR uses an interrupt-driven approach. This is, while waiting for a certain status when sending or receiving, the calling thread is suspended and woken up by interrupts.

Since the I2C controller allows to receive up to two bytes before the application has to react, receiving a single byte, two bytes or more than two bytes needs a different handling for correct receiption. This requires a tricky implementation which distinguish a number of different case. There the driver requires 860 byte more ROM and 8 byte more RAM.

### Testing procedure

The driver should work with any I2C sensor/actuator. It was tested with
- `tests/driver_bmp180`
   <details>
  
   ```
    main(): This is RIOT! (Version: 2023.04-devel-355-g940c7-cpu/gd32v/periph_i2c_interrupt_driven)
    BMP180 test application
    
    +------------Initializing------------+
    Initialization successful
    
    +------------Calibration------------+
    AC1: 8448
    AC2: -1208
    AC3: -14907
    AC4: 33310
    AC5: 24774
    AC6: 19213
    B1: 6515
    B2: 49
    MB: -32768
    MC: -11786
    MD: 2958
    
    +--------Starting Measurements--------+
    Temperature [°C]: 22.0
    Pressure [hPa]: 1006.49
    Pressure at see level [hPa]: 1025.55
    Altitude [m]: 157
    
    +-------------------------------------+
    Temperature [°C]: 22.0
    Pressure [hPa]: 1006.56
    Pressure at see level [hPa]: 1025.58
    Altitude [m]: 157
    
    +-------------------------------------+
   ```
   
   </details>
- `tests/driver_ccs811`
   <details>
  
   ```
    main(): This is RIOT! (Version: 2023.04-devel-355-g940c7-cpu/gd32v/periph_i2c_interrupt_driven)
    CCS811 test application
    
    +------------Initializing------------+
    
    +--------Starting Measurements--------+
    TVOC [ppb]: 0
    eCO2 [ppm]: 0
    +-------------------------------------+
    TVOC [ppb]: 0
    eCO2 [ppm]: 0
    +-------------------------------------+
    TVOC [ppb]: 0
    eCO2 [ppm]: 0
    +-------------------------------------+
    TVOC [ppb]: 0
    eCO2 [ppm]: 400
    +-------------------------------------+
    TVOC [ppb]: 0
    eCO2 [ppm]: 400
    +-------------------------------------+
    TVOC [ppb]: 0
    eCO2 [ppm]: 400
    +-------------------------------------+
    TVOC [ppb]: 7
    eCO2 [ppm]: 446
    +-------------------------------------+
    TVOC [ppb]: 7
    eCO2 [ppm]: 446
    +-------------------------------------+
    TVOC [ppb]: 7
    eCO2 [ppm]: 446
    +-------------------------------------+
    TVOC [ppb]: 7
    eCO2 [ppm]: 446
    +-------------------------------------+
    ```
   
   </details>
- `tests/driver_sht3x`
   <details>
  
    ```
    main(): This is RIOT! (Version: 2023.04-devel-355-g940c7-cpu/gd32v/periph_i2c_interrupt_driven)
    SHT3X test application
    
    +------------Initializing------------+
    Initialization successful
    
    
    +--------Starting Measurements--------+
    Temperature [°C]: 21.46
    Relative Humidity [%]: 54.50
    +-------------------------------------+
    Temperature [°C]: 21.47
    Relative Humidity [%]: 54.53
    +-------------------------------------+
    Temperature [°C]: 21.46
    Relative Humidity [%]: 54.48
    +-------------------------------------+
    Temperature [°C]: 21.46
    Relative Humidity [%]: 54.47
    +-------------------------------------+
    ```
   
   </details>
- `tests/driver_l3gxxxx`
   <details>
  
    ```
    main(): This is RIOT! (Version: 2023.04-devel-375-g75547-cpu/gd32v/periph_i2c_interrupt_driven)
    L3GXXXX gyroscope driver test application
    
    Initializing L3GXXXX sensor
    [OK]
    
    gyro [dps] x:    +0, y:    -1, z:    -2
    gyro [dps] x:    +0, y:    +0, z:    +0
    gyro [dps] x:    +0, y:    +0, z:    +0
    gyro [dps] x:    +0, y:    +0, z:    +0
    gyro [dps] x:    +0, y:    +0, z:    +0
    gyro [dps] x:    +0, y:    +0, z:    +0
    gyro [dps] x:    -1, y:    +0, z:    +4
    gyro [dps] x:    +0, y:    +0, z:   -21
    gyro [dps] x:    +0, y:    +0, z:    +6
    gyro [dps] x:   -43, y:    +0, z:   -13
    gyro [dps] x:   -21, y:    -2, z:    +0
    gyro [dps] x:    +0, y:    +1, z:    +3
    gyro [dps] x:   +25, y:    +0, z:    +0
    ```
   
   </details>
- `tests/driver_hd44780` with `pcf8574a` I2C interface

### Issues/PRs references



Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-02-18 07:54:59 +00:00
Gunar Schorcht
5207c6fdf8 boards/esp32s2-lilygo-ttgo-t8: documentation fix 2023-02-18 08:29:02 +01:00
Gunar Schorcht
2fb8ef1f0b boards/esp32s2-lilygo-ttgo-t8: fix STDIO selection in Kconfig 2023-02-18 08:07:28 +01:00
bors[bot]
8c2a4b43b3
Merge #19027
19027: sys/fmt: optimize scn_u32_dec scn_u32_hex r=benpicco a=kfessel

### Contribution description

Improves the compilation result for `scn_u32_dec` `scn_u32_hex` especially on `cortex-m` reducing either stack usage and or code size.

This makes use of unsigned int overflow (slightly less better without doing that `hexn`).

See godbolt (original versions got an `o` attached, modified versions got `k`s) all functions are  marked `_S_` defined to `static`

by assigning the global at end the compiled function can be changed (`deco deck  hexo hexk hexkk hexn`)

this PR is `hexkk` and `deck` 

### Testing procedure

run unit-test/test-fmt

```
<RIOT>/tests/unittests$ make tests-fmt
<RIOT>/tests/unittests$ make term
```

### Issues/PRs references

[godbolt](https://godbolt.org/z/MzT1zh4q1)

Co-authored-by: Karl Fessel <karl.fessel@ovgu.de>
2023-02-17 20:09:53 +00:00
Gunar Schorcht
5433daca32 cpu/gd32v/periph_i2c: interrupt based driver 2023-02-17 18:52:38 +01:00
bors[bot]
b1be519107
Merge #19284 #19286
19284: boards: support for the LILYGO TTGO T8 ESP32-S2 board r=benpicco a=gschorcht

### Contribution description

This PR provides the support for the LILYGO TTGO T8 ESP32-S2 board which has a OLED display (not yet supported) and a SD-Card slot on board.

The board is equipped with a USB-C connector that connects either to a USB-to-UART bridge or to the USB-OTG/JTAG interface of the ESP32-S2 via some DIP switches.

The PR includes a very small fix of printf format string in `tests/malloc`. I can split it off.

### Testing procedure

t.b.d.

### Issues/PRs references


19286: cpu/esp_common: use generic WIFI_SSID/WIFI_PASS defines r=benpicco a=benpicco



Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de>
2023-02-17 17:00:56 +00:00
Gunar Schorcht
8e30600664 boards: add support for LILYGO TTGO T8 ESP32-S2 2023-02-17 17:40:52 +01:00
Benjamin Valentin
cebd768c08 cpu/esp_common: rename ESP_WIFI_EAP_* -> WIFI_EAP_* 2023-02-17 16:59:29 +01:00
Karl Fessel
18a783d21c sys/fmt: optimize scn_u32_dec scn_u32_hex 2023-02-17 16:20:19 +01:00
Benjamin Valentin
50802b841d cpu/esp_common: use generic WIFI_SSID/WIFI_PASS defines 2023-02-17 15:32:03 +01:00
Gunar Schorcht
2ac4189784 cpu/esp32: fix DAC documentation for ESP32-S2 2023-02-17 12:39:10 +01:00
bors[bot]
6f6727db82
Merge #19281
19281: drivers/at24cxxx: merge mtd driver with at24cxxx.c r=benpicco a=benpicco



Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2023-02-17 10:26:46 +00:00
Benjamin Valentin
7884d6e7fe drivers/at24cxxx: merge mtd driver with at24cxxx.c 2023-02-17 10:55:21 +01:00
Gunar Schorcht
99e07a6786 tests/malloc: remove 0x prefix for %p in printf 2023-02-17 07:48:08 +01:00
bors[bot]
fd47a1b7e4
Merge #19282
19282: pkg/nanors: bump version r=benpicco a=benpicco



Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de>
2023-02-16 23:40:04 +00:00
Benjamin Valentin
a9f9c34511 pkg/nanors: bump version 2023-02-16 16:06:28 +01:00
bors[bot]
2221cbfa9b
Merge #19258
19258: drivers/mtd_flashpage: implement pagewise API, don't use raw addresses r=benpicco a=benpicco



Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
Co-authored-by: Benjamin Valentin <benjamin.valentin@bht-berlin.de>
Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de>
2023-02-16 15:02:19 +00:00
Benjamin Valentin
43fffcd74f drivers/mtd: add bounds checking 2023-02-16 15:50:52 +01:00
Benjamin Valentin
8e902bdf5d tests/mtd_flashpage: test unaligned read/write 2023-02-16 15:50:52 +01:00
Benjamin Valentin
d8ab11b51f drivers/mtd_flashpage: drop legacy API 2023-02-16 15:50:52 +01:00
Benjamin Valentin
68694a0da2 tests/mtd_flashpage: adapt to mtd_flashpage API change 2023-02-16 15:50:52 +01:00
Benjamin Valentin
5d5d88b271 drivers/mtd_flashpage: implement pagewise API 2023-02-16 15:50:52 +01:00
bors[bot]
5667814d2c
Merge #19270 #19271
19270: drivers/at24cxxx: implement _mtd_at24cxxx_read_page r=benpicco a=HendrikVE

### Contribution description

The function `read_page` was missing which lead to (from a user perspective) undefined behavior on the MTD layer.

### Testing procedure

Any application using MTD in conjunction with a board with an at24cxxx.


19271: core/xfa: disable asan on llvm r=benpicco a=Teufelchen1

### Contribution description
Hi! 🦎

When using llvm and address sanitation, the XFA trip the sanitizer.
This PR attempts to fix this by adding the `no_sanitize` attribute to the XFA macros. Sadly, this attribute is not known by gnu, a guard is hence needed. I'm open for alternatives as I dislike this solution but it is the best I could come up with.

### Testing procedure

Before this patch:

Go to `examples/gnrc_minimal` and run `TOOLCHAIN=llvm make all-asan` and then `make term`.
You should see an error similar to this:
```
==3374719==ERROR: AddressSanitizer: global-buffer-overflow on address 0x080774e0 at pc 0x0804af5e bp 0x0808eb88 sp 0x0808eb78
READ of size 4 at 0x080774e0 thread T0
    #0 0x804af5d in _auto_init_module /RIOT/sys/auto_init/auto_init.c:40
    #1 0x804af5d in auto_init /RIOT/sys/auto_init/auto_init.c:339
    #2 0x804b375 in main_trampoline /RIOT/core/lib/init.c:56
    #3 0xf76bc7b8 in makecontext (/lib32/libc.so.6+0x4a7b8)
...
``` 
After applying this PR, the example can be build and run with llvm or gcc, with or without asan.



Co-authored-by: Hendrik van Essen <hendrik.vanessen@ml-pa.com>
Co-authored-by: Teufelchen1 <bennet.blischke@haw-hamburg.de>
2023-02-15 17:03:30 +00:00
Teufelchen1
a8c9af901c core/xfa: disable asan on llvm 2023-02-15 17:41:35 +01:00
bors[bot]
12910d6aef
Merge #19280
19280: sys/shell/cmds: fix typo 'shell_cmd_grnc_udp' r=maribu a=benpicco



Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de>
2023-02-15 13:40:01 +00:00
Benjamin Valentin
980b60325c sys/shell/cmds: fix typo 'shell_cmd_grnc_udp' 2023-02-15 13:35:33 +01:00
Hendrik van Essen
3837536a73 drivers/at24cxxx: implement read_page for mtd 2023-02-15 11:56:21 +01:00
Hendrik van Essen
9b0cf96ecd cpu/sam0_common: add PERIPH_I2C_MAX_BYTES_PER_FRAME due to I2C limitations 2023-02-15 11:56:21 +01:00
bors[bot]
1472a76adf
Merge #19276 #19279
19276: pkg/tinyusb: bump to 0.15 r=benpicco a=benpicco



19279: cpu/stm32/periph/i2c: export PERIPH_I2C_MAX_BYTES_PER_FRAME r=benpicco a=fabian18



Co-authored-by: Benjamin Valentin <benjamin.valentin@bht-berlin.de>
Co-authored-by: Fabian Hüßler <fabian.huessler@st.ovgu.de>
2023-02-14 17:49:06 +00:00
Benjamin Valentin
3173150ef7 gnrc_dhcpv6_client_simple_pd: select upstream based on type/index 2023-02-14 17:45:19 +01:00
Fabian Hüßler
26363e9da4 cpu/stm32/periph/i2c_1: export PERIPH_I2C_MAX_BYTES_PER_FRAME 2023-02-14 17:39:42 +01:00
Benjamin Valentin
85ce068c45 pkg/tinyusb: bump to 0.15 2023-02-14 14:30:49 +01:00
bors[bot]
a311b3f951
Merge #19274
19274: CI: .murdock: use build checkout for ccache tmp r=bergzand a=kaspar030



Co-authored-by: Kaspar Schleiser <kaspar@schleiser.de>
2023-02-14 12:10:50 +00:00
551aa2e56e CI: .murdock: use build checkout for ccache tmp 2023-02-14 10:32:13 +01:00
bors[bot]
f78c3751b9
Merge #19272
19272: gcoap: Do not send responses from multicast addresses r=benpicco a=chrysn

### Contribution description

Since https://github.com/RIOT-OS/RIOT/pull/18026, CoAP requests to multicast addresses (eg. `ff02::1`) came back from that exact address, which Linux rightfully just drops.

The fix uses the existing multicast check from https://github.com/RIOT-OS/RIOT/pull/17978 (thanks `@benpicco` for making me write this as dedicated function, I just had to generalize it removing one struct layer), and foregoes setting the source address when responding to multicasts.

### Testing procedure

* Run the gcoap example
* Send a CoAP request to a multicast address RIOT listens to, eg. `./aiocoap-client coap://'[ff02::1%tapbr0]'/.well-known/core --non`

Before, this got no response (while you see it arrive on wireshark). After, you get a correct response with two lines of note:

```
WARNING:coap:Sending request to multicast via unicast request method
Response arrived from different address; base URI is coap://[fe80::3c63:beff:fe85:ca96%tapbr0]/.well-known/core
```

(The former is aiocoap telling us that we're not using the nonexistent multicast API so it's really more of an anycast, the latter is useful factual information).

Co-authored-by: chrysn <chrysn@fsfe.org>
2023-02-14 00:28:46 +00:00
bors[bot]
1c55118bd8
Merge #18257
18257: drivers/wdt: add periph_wdt_auto_start for early watchdog r=benpicco a=benpicco



Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2023-02-13 21:09:07 +00:00
chrysn
ac3a9cdf83 gcoap: Do not send responses from multicast addresses 2023-02-13 21:46:12 +01:00
chrysn
54037f5c2d gcoap: Alter indirection level of _memo_ep_is_multicast 2023-02-13 20:32:29 +01:00