19550: tests/drivers/l3gxxxx: fix used sensor version for iotlab boards r=aabadie a=gschorcht
### Contribution description
This PR fixes the `l3gxxxx` driver version used in `tests/drivers/l3gxxxx` for IoT-Lab boards. It hopefully fixes the compilation of nightly.
The problem occurred with PR #19523.
### Testing procedure
```
BOARD=iotlab-a8-m3 make -j8 -C tests/drivers/l3gxxxx info-modules | grep l3g4200d_ng
```
should succeed.
### Issues/PRs references
Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
19522: tests/periph_rtt: Fix for tick conversion test r=benpicco a=chudov
### Contribution description
Type casting and `printf` formatting for the `RTT_MAX_VALUE` and `RTT_FREQUENCY` are fixed so 32-bit value is properly handled by 'avr-libc'.
The original tick conversion test assumes that `RTT_FREQUENCY` is power of 2 so forward and backward ticks to seconds conversion results in the original ticks value. To fix it the result of the forward-backward conversion is compared with `ticktest / RTT_FREQUENCY * RTT_FREQUENCY` that considers rounding errors.
Changes were tested on deRFmega256 and nrf52840dongle.
### Testing procedure
tests/periph_rtt on a board with ATmega256RFR2 shall:
* show correct RTT_MAX_VALUE
* conversion check shall report no error.
### Issues/PRs references
Fixes#15940
Co-authored-by: chudov <chudov@gmail.com>
19538: drivers/mtd_default: add external declarations for mtd* r=benpicco a=gschorcht
### Contribution description
The `mtd_default` module defines `MTD_NUMOF`, if not present, based on the `MTD_*` defines. These defines are set to the corresponding `mtd*` MTD device pointer variables in the board definitions. However, not all `mtd*` MTD device pointer variables are always made known by external variable declarations. An example are SD Card Interfaces that are defined via the `mtd_sdcard_default` module. As a result, it may be necessary for an application using `mtd_default` to declare an external MTD device pointer variable `mtd`. To be able to use SD card for testing MTD based application, `mtd_default` also declares up to six `mtd*` MTD device pointer variables.
### Testing procedure
Use any board without SD Card definition and compile `tests/pkg_litllefs`, `tests/pkg_litllefs2` or `tests/pkg_spiffs`, for example to use a temporary connected SD Card interface.
```
CFLAGS='-DMTD_0=mtd0 -DCONFIG_USE_HARDWARE_MTD' USEMODULE='sdcard_spi mtd_sdcard_default' BOARD=nucleo-f411re make -j8 -C tests/pkg_littlefs
```
Without this PR, compilation fails due to undeclared `mtd0` variable
```
tests/pkg_littlefs/bin/nucleo-f411re/riotbuild/riotbuild.h:2:15: error: 'mtd0' undeclared (first use in this function)
2 | #define MTD_0 mtd0
| ^~~~
```
Compilation works with this PR and the temporary connected SD Card interface can be used with this test applications.
### Issues/PRs references
19547: pkg/openthread: set event callback before netdev init r=benpicco a=bergzand
### Contribution description
When using openthread with the ieee802154_submac module, a hard fault is triggered otherwise because the submac's init function calls the event_handler callback.
### Testing procedure
Flash the `examples/openthread` application on the nrf52840dk board. Without this patch the board is stuck in a hard fault loop. With this patch the application starts successfully.
### Issues/PRs references
None
Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
Co-authored-by: Koen Zandberg <koen@bergzand.net>
19548: boards/telosb: minor clean ups r=maribu a=maribu
### Contribution description
This cleans up the documentation and the header files of the TelosB board. It is supposed to not changed the generated firmware (except for debug symbols).
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
When using openthread with the ieee802154_submac module, a hard fault is
triggered otherwise because the submac's init function calls the
event_handler callback.
19435: tests/drivers: move all driver tests into own folder r=aabadie a=Teufelchen1
Hi! 🦅
### Contribution description
This moves all `tests/driver_*/` to `tests/drivers/<driver name>/`.
Reason for change is purely esthetic 🐮
### Testing procedure
A passing CI should be enough - it should be (manually) checked that the new locations are still covered by it.
`./dist/tools/compile_test/compile_like_murdock.py -b native -a tests/drivers/*` can be helpful as well.
Co-authored-by: Teufelchen1 <bennet.blischke@haw-hamburg.de>
19477: sys /cpp11-compat: remove pseudo anonymous namespaces r=MrKevinWeiss a=kfessel
### Contribution description
remove pseudo anonymous namespaces in favor of defines that are used thoughout the rest of riot
### Testing procedure
cpp test do not fail
### Issues/PRs references
Co-authored-by: Karl Fessel <karl.fessel@ovgu.de>
19541: makefiles/tools/jlink.inc.mk: use ELF file for flashing r=maribu a=maribu
### Contribution description
There seems to be a consensus to go for a more ELF centric approach whenever possible. J-Link seems to work fine with ELF files, so let's avoid the extra step to create a bin file from the ELF file prior to flashing.
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
There seems to be a consensus to go for a more ELF centric approach
whenever possible. J-Link seems to work fine with ELF files, so let's
avoid the extra step to create a bin file from the ELF file prior to
flashing.
19537: boards/rpi-pico: specify needed args when using jlink flasher r=dylad a=dylad
### Contribution description
This PR adds the jlink device variable and use hexfile to flash application with a jlink probe.
### Testing procedure
Attach a `jlink` probe to SWD pins.
Try to flash any app with `jlink`
`PROGRAMMER=jlink make BOARD=rpi-pico -C examples/blinky flash`
### Issues/PRs references
None.
Co-authored-by: dylad <dylan.laduranty@mesotic.com>
The `mtd_default` module defines `MTD_NUMOF` if not existing based on the `MTD_*` defines which are usually set to the corresponding MTD device pointer variables `mtd*`. However, these MTD device pointer variables are not always made known by external variable declarations. An example are SD Card Interfaces which are defined via the `mtd_sdcard_default` module. As a consequence, an application that uses `mtd_default` has still to be modified. Therefore, `mtd_default` also declares up to 6 `mtd*` MTD device pointer variables.
19368: debug: add DEBUG_BREAKPOINT() macro, set breakpoint on failed assertion r=benpicco a=benpicco
19529: cpu/stm32/periph/dac: optimize setting DAC r=benpicco a=Enoch247
### Contribution description
The current implmentation right shifted the 16 bit value passed into `dac_set()` down to the 12 bits that the DAC is actually capable of. This patch drops the shift and instead writes the 16 bit value to the DAC's left aligned 12 bit wide data holding register.
### Testing procedure
do something like:
``` c
#include "perip/dac.h"
int main(void)
{
dac_set(DAC_LINE(0), 0xffff/2);
return 0;
}
```
- observe DAC's output is half of vref
### Issues/PRs references
- none known
19531: tests/unittests: allow passing `UNIT_TESTS` via env r=benpicco a=kaspar030
Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de>
Co-authored-by: Joshua DeWeese <jdeweese@primecontrols.com>
Co-authored-by: Kaspar Schleiser <kaspar@schleiser.de>
19523: boards/iotlab-m3: enable l3g4200d_ng r=benpicco a=benpicco
19527: drivers/sdcard_spi: small cleanup r=benpicco a=gschorcht
### Contribution description
This PR provides a small cleanup:
- the copy of `sdcard_spi_params_t` is removed (commit bfc2a51f70)
- the documentation was changed to fit the 100 characters per line. (commit 36f0162b34)
It is not necessary to hold a complete copy `sdcard_spi_params_t` in the device descriptor. Constant parameters can be used directly from ROM instead. This saves 24 bytes of RAM.
### Testing procedure
Use any board with SD Card SPI interface. The driver test should still work, for example:
```
BOARD=esp32-wrover-kit make -j8 -C tests/driver_sdcard_spi flash term
```
```
main(): This is RIOT! (Version: 2023.07-devel-176-g7213c-drivers/sdcard_spi_cleanup)
SD-card spi driver test application
insert SD-card and use 'init' command to set card to spi mode
WARNING: using 'write' or 'copy' commands WILL overwrite data on your sd-card and
almost for sure corrupt existing filesystems, partitions and contained data!
> init
Initializing SD-card at SPI_0...
[OK]
>
```
### Issues/PRs references
19530: sys/xtimer: add missing "modules.h" include to `xtimer.h` r=benpicco a=kaspar030
19532: tests/unittests: tests-core-mbox: add missing `container.h` include r=benpicco a=kaspar030
19533: core: move macros/math.h to core/lib/include/macros r=benpicco a=kaspar030
19535: nanocoap_sock: defuse nanocoap_sock_get() API footgun r=benpicco a=benpicco
Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
Co-authored-by: Kaspar Schleiser <kaspar@schleiser.de>
19526: boards/arduino-mkrwan1300: update board name to correct one r=aabadie a=FlapKap
Co-authored-by: Kasper Hjort Berthelsen <kasper.berthelsen@hotmail.com>
19525: semtech-loramac: extend list of supported radio with sx1261, sx1262 and sx1268 r=maribu a=aabadie
Co-authored-by: Alexandre Abadie <alexandre.abadie@inria.fr>
19528: treewide: fix typos and false positives found by codespell r=aabadie a=maribu
### Contribution description
This fixes some typos and adds one correctly used abbreviation to the ignore list.
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
The current implmentation right shifted the 16 bit value passed into
`dac_set()` down to the 12 bits that the DAC is actually capable of.
This patch drops the shift and instead writes the 16 bit value to the
DAC's left aligned 12 bit wide data holding register.
It is not necessary to hold a complete copy `sdcard_spi_params_t` in the device descriptor. Constant parameters can be used directly from ROM instead. This saves 24 bytes of RAM.