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>
19242: usbus/msc: add initial Mass Storage Class support r=benpicco a=dylad
### Contribution description
This PR adds the initial support for Mass Storage Class in USBUS. This PR relies on the RIOT MTD implementation to implement the Mass Storage Class support. With the provided test application, a MTD device will be accessible as a normal storage device on your host computer.
Read and Write operations are allowed.
Multiple LUNs are supported so several MTD devices can be exported through USB.
The MSC relies on SCSI protocol to operate.
Currently there are some limitations:
Supported host : Linux & Windows (macOS is untested)
MSC cannot be used if MTD page size > 4096
MTD device must have at least 512 bytes of memory to be exported.
Please be aware that performance are not so great.
### Testing procedure
Flash `tests/usbus_msc` application on a board with at least one MTD device.
Once the shell has started, prepare one or several MTD devices to be exported using `add_lun` command.
Once ready, start the USB connection with `usb_attach`
All MTD exported should appear as` /dev/sdX` on Linux.
### Issues/PRs references
Supersede #15941
Co-authored-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
For scripts it can be useful to output not only one, but multiple
formats (e.g. to obtain both path and serial of a TTY). The script
now support passing multiple formats.
Note that only simple formats can be combined, as the JSON and markdown
table won't mix well with any other format.
`create_makefile.sh`:
- address all shellcheck warnings
- make script POSIX shell compatible
- use nproc to set the number of parallel jobs to increase throughput
- print error messages when building fails
- run `make info-boards-supported` with `EXTERNAL_BOARD_DIRS=""` to
avoid adding out-of-tree boards to `Makefile.ci`.
- classify output as "not supported" also when used features are
blacklisted, not only when required features are missing
- classify output as "not supported' also when output contains
`not supported. Stop.`, e.g. as raised by pkg/tinyusb on unsupported
CPUs / CPU families.
`add_insufficient_memory_board.sh`:
- classify output as "not supported" also when used features are
blacklisted, not only when required features are missing
- classify output as "not supported' also when output contains
`not supported. Stop.`, e.g. as raised by pkg/tinyusb on unsupported
CPUs / CPU families.
- drop all bash specifics and use generic sh
- fix all shellcheck warnings
- use nproc instead of hard-coded `-j4`
- print output on (real) compilation error
19240: tools/doccheck: add simple exclude to doccheck r=benpicco a=kfessel
while doccheck runs for #19228 and #19220, i saw some spikes in memory consumption, turned out that was `grep -Evf dist/tools/doccheck/exclude_patterns` using about 2GB RAM. This PR changes that.
### Contribution description
add `exclude_simple` to `doccheck` drived from `exclude patterns`
`sort`ed and `uniq`ued the simple excludes
removes no longer needed patterns from `exclude patterns`
simple excludes are string rules (no patterns just strings)
how to apply these:
in this PR:
*remove the path and line number from the rule
* that made some of them doubles of each other
* sorted and uniqued them.
* this set of excludes is no longer path specific (an exception covers all paths but may of them still contain a file name)
another possible solution would be to have the excludes line number specific.
### Testing procedure
run `dist/tools/doccheck/check.sh`
compare memory consumption of
master: `grep -Evf dist/tools/doccheck/exclude_patterns`
to
this PR: `grep -Fvf dist/tools/doccheck/exclude_simple`
### Issues/PRs references
19248: cpu/gd32v: add periph_dac support r=benpicco a=gschorcht
### Contribution description
This PR provides the `periph_dac` support for GD32VF103.
### Testing procedure
`tests/periph_dac` should work on `sipeed-longan-nano` port on PA4 and PA5.
### Issues/PRs references
19255: boards/esp*: complete SD Card MTD config r=benpicco a=gschorcht
### Contribution description
This PR provides the remaining changes necessary to use the generic MTD SD Card configuration as described in PR #19216.
This includes defining the MTD offset for SD cards, since the default `MTD_0` device always uses the internal flash device, and the completion of the configuration for the ESP32 boards with a SD card interface.
### Testing procedure
`tests/vfs_default` should work now with SD Cards:
```
main(): This is RIOT! (Version: 2023.04-devel-323-gfcc07)
mount points:
/nvm0
/sd0
data dir: /sd0
> vfs df
Mountpoint Total Used Available Use%
/nvm0 3052 KiB 8 KiB 3044 KiB 0%
/sd0 7580 MiB 3632148992 B 21089792 B 99%
```
### Issues/PRs references
Co-authored-by: Karl Fessel <karl.fessel@ovgu.de>
Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
19220: dist/tools/doccheck: Fix grep warning r=benpicco a=maribu
### Contribution description
Fix `grep: warning: stray \ before -` warnings.
### Testing procedure
```
$ ./dist/tools/doccheck/check.sh
```
Should no longer print lots of the warning anymore
### Issues/PRs references
19232: build system: Fix linker feature test with newlib 4.3.0 r=benpicco a=maribu
### Contribution description
Before the build system used something like
echo "int main(){} void _exit(int n) {(void)n;while(1);}" | LC_ALL=C $(LINK) -xc - -o /dev/null -lc -Wall -Wextra -pedantic <FLAGS_TO_TEST>
to check for flags supported by the compiler (used as linker frontend). This however no longer works with newlib 4.3.0, which requires the symbols `_sbrk_r`, `_close_r`, `_lseek_r`, `_read_r`, and `_write_r` to be present. Instead, now a new file `minimal_linkable.c` was added that adds all the missing symbols and is used in the linker feature tests instead.
### Testing procedure
- No regressions on the CI
- No changes in binaries
- Building rust apps with newlib 4.3.0 should work again
### Issues/PRs references
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
Before the build system used something like
echo "int main(){} void _exit(int n) {(void)n;while(1);}" | LC_ALL=C $(LINK) -xc - -o /dev/null -lc -Wall -Wextra -pedantic <FLAGS_TO_TEST>
to check for flags supported by the compiler (used as linker frontend).
This however no longer works with newlib 4.3.0, which requires the
symbols `_sbrk_r`, `_close_r`, `_lseek_r`, `_read_r`, and `_write_r` to
be present. Instead, now a new file `minimal_linkable.c` was added that
adds all the missing symbols and is used in the linker feature tests
instead.
19228: doccheck: avoid generating dot or html r=benpicco a=kfessel
### Contribution description
doccheck without generating dot or html
this also has some new generated lines for exclude_pattern (some of them where broke so I regenerated the block)
### Testing procedure
doccheck
### Issues/PRs references
Co-authored-by: Karl Fessel <karl.fessel@ovgu.de>
16782: drivers/mfrc522: add new driver r=benpicco a=HendrikVE
### Contribution description
This PR adds support for the MFRC522. It is quite common in the Arduino world and it is quite cheap. The driver connects to the MFRC522 via SPI and is heavily based on the Arduino driver available [here](https://github.com/miguelbalboa/rfid). Basically it was ported, but with several improvements in readability and documentation.
### Testing procedure
The given (manual) test provides single commands for some driver functions.
19201: cpu/gd32v: add periph_i2c support r=benpicco a=gschorcht
### Contribution description
This PR provides the `periph_i2c` support and is one of a bunch of PRs that complete the peripheral drivers for GD32VF103.
The driver is a modified version of the driver for STM32F1 with some changes that were necessary to get it working on GD32V. As for STM32F1, the driver is using polling instead of interrupts for now. It will be implemented interrupt-driven later.
### Testing procedure
`tests/periph_i2c` as well as a test with any I2C sensor should work. The driver was tested with `tests/driver_l3gxxxx` and `tests/driver_bmp180`.
### Issues/PRs references
Co-authored-by: Hendrik van Essen <hendrik.ve@fu-berlin.de>
Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
19050: boards/common/cc26xx cc13xx: clean up and fix flash configs r=benpicco a=maribu
### Contribution description
- Add support for XDS110 debugger via `OPENOCD_DEBUG_ADAPTER=xds110`
- Clean up OpenOCD configs in `boards/common/cc26xx_cc13xx`
- No longer hardcode the debugger to xds110, but use `OPENOCD_DEBUG_ADATER ?= xds110`
- Add support for cc13x0, cc13x2, cc26x0
- `boards/cc2650*`: drop custom OpenOCD config in favor of shared one
- add variables needed to support flashing with `PROGRAMMER=jlink`
- allow specifying a custom OpenOCD command to bring the device to a halt state, as the default `reset halt` (which causes a second reset) is causing issues with the ICEPick JTAG routers in the CC26xx - CC13xx devices
- Use `halt` instead of `reset halt` for CC26xx / CC13xx boards in OpenOCD to avoid issues in flashing
### Testing procedure
```
make BOARD=cc2650-launchpad -C examples/default flash
```
Should now work. The same should still work for other cc26xx cc13xx boards.
### Issues/PRs references
Partially fixes: https://github.com/RIOT-OS/RIOT/issues/18750
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
Typically, OpenOCD is already performing a reset on connect. A
`reset halt` to bring the target to a `halt` state for flashing will
result in the device going through a second reset cycle. This can be
problematic with some device, such as the CC26xx MCUs. For these
devices, an `OPENOCD_CMD_RESET_HALT := -c 'halt'` will avoid the second
reset that is causing the issues.
19099: dist/tools/usb-serial: Clean up legacy scripts r=aabadie a=maribu
### Contribution description
Refactor the old bash scripts to use `ttys.py` instead and update the documentation.
### Testing procedure
The pi fleet should still work without modification.
### Issues/PRs references
Fixes https://github.com/RIOT-OS/RIOT/issues/15814
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
This commits add documentation to the HDC1000 params and adds generic
exclude patters to the doc check, so that when boards provide custom
HDC1000 params they do not need to document them again. The reasoning
is that the documentation in the central place is sufficient.
This commits add documentation to the FXOS8700 params and adds generic
exclude patters to the doc check, so that when boards provide custom
FXOS8700 params they do not need to document them again. The reasoning
is that the documentation in the central place is sufficient.
In addition, a generic exclude patter is added to match FXOS8700_REG_*,
as the register names are relatively self-explaining and an
implementation detail of the driver that doesn't need public
documentation.
This commits add documentation to the AT86RF2xx params and adds generic
exclude patters to the doc check, so that when boards provide custom
AT86RF2xx params they do not need to document them again. The reasoning
is that the documentation in the central place is sufficient.
Add generic patterns to allow XTIMER_DEV, XTIMER_HZ, XTIMER_WIDTH,
XTIMER_CHAN, XTIMER_BACKOFF, and XTIMER_ISR_BACKOFF to be undocumented.
The reasoning is that having them documented once is enough and warnings
for missing doc in every boards is just noise.
This commits add documentation to the TMP00X params and adds generic
exclude patters to the doc check, so that when boards provide custom
TMP00X params they do not need to document them again. The reasoning is
that the documentation in the central place is sufficient.
This commits add documentation to the pulse counter params and adds
generic exclude patters to the doc check, so that when boards provide
custom pulse counter params they do not need to document them again. The
reasoning is that the documentation in the central place is sufficient.
This commits add documentation to the PIR params and adds generic
exclude patters to the doc check, so that when boards provide custom PIR
params they do not need to document them again. The reasoning is that
the documentation in the central place is sufficient.
19039: Ensure C locale when querying the compiler for compile commands r=maribu a=janhenke
### Contribution description
This fixes generating the compile commands with localization enabled GCC and non-English shell locale. The python script uses regexes to extract the required information. These only match on the default English output. GCC supports localized output messages which break the regexes used. Instead of matching any possible localization, this fix forces the C locale for message output on the compiler invocation, thus ensuring the regexes can match.
### Testing procedure
Needed: arm-none-eabi.gcc with localization support and non-English system locale.
Invoke the compile-commands make target (`make compile-commands`).
It should generate the `compile_commands.json` file correctly.
### Issues/PRs references
None found, fix was trivial enough to fix it directly.
Co-authored-by: Jan Henke <Jan.Henke@taujhe.de>
GCC supports localized outputs, depending on the currently set locale.
This broke the compile-commands target, as the regexes only match the
English output. By invoking the compiler explicitly with the C locale,
it ensures the expected English language output.
19012: boards/arduino-mega2560: add TTY_BOARD_FILTER r=gschorcht a=maribu
### Contribution description
This allows automatically selecting TTY actually belonging to an
Arduino Mega2560 if `MOST_RECENT_PORT=1` is set.
### Testing procedure
```
make BOARD=arduino-mega2560 MOST_RECENT_PORT=1 -C examples/default flash term
```
Should automatically select the TTY of the most recently connected Arduino Mega2560, even if a board of a different type is connect more recently.
### Issues/PRs references
- [x] depends on (and includes) https://github.com/RIOT-OS/RIOT/pull/19011
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
If no TTY serial (matching the given filters, if any) was found, use
the exit code `1`. The idea is that simple shell scripts falling back
to alternative variants of a board can be used via
```.sh
ttys.py --most-recent --model Fooboard --vendor Footronic || \
ttys.py --most-recent --model Barboard --vendor Bartronic
```
Just adding a regex that would accept both vendors and models would
have different semantics: If both a Fooboard and a Barboard are
attached, it would pick the most recently connected of both. The shell
expression above would always prefer a Fooboard over a Borboard.
The use case cheap Arduino clones that replace the ATmega16U2 used
as USB UART bridge with cheap single purpose chips. The original
ATmega16U2 has the advantage that it provides identification data
unique the specific Arduino board, while the clones cannot be told
apart from standalone USB UART bridges or Arduino clones of other
models. Hence, we want to pick the genuine Arduino board if connected,
and only fall back to matching cheap USB UART bridges if no genuine
Arduino board is connected.
18803: dist/tools: Add compile_like_murdock r=benpicco a=MrKevinWeiss
### Contribution description
Helper script to pre-test murdock build conditions.
This is intended to compile like murdock giving control for only a subset of boards or applications. One can use this if only a limited change should be build tested. Defaults boards and apps are selected to be an early warning if something is wrong.
This should be used before triggering much larger murdock builds.
The following use cases are:
I made a change to something in the stm32 clocks... ./compile_like_murdock.py -c stm32
I changed a driver the DHT driver
./compile_like_murdock.py -a tests/driver_dht tests/saul
I changed a nucleo-f103rb board...
./compile_like_murdock.py -a tests/driver_dht tests/saul
### Testing procedure
View the help...
```
./dist/tools/compile_test/compile_like_murdock.py -h
```
Do a dry run of the cpu...
```
./dist/tools/compile_test/compile_like_murdock.py -c stm -d
```
Play with each of the args, try adding a module to hello-world to get a module mismatch.
### Issues/PRs references
<!--
Examples: Fixes#1234. See also #5678. Depends on PR #9876.
Please use keywords (e.g., fixes, resolve) with the links to the issues you
resolved, this way they will be automatically closed when your pull request
is merged. See https://help.github.com/articles/closing-issues-using-keywords/.
-->
Co-authored-by: MrKevinWeiss <weiss.kevin604@gmail.com>
Helper script to pre-test murdock build conditions.
This is intended to compile like murdock giving control for only a subset of
boards or applications. One can use this if only a limited change should be
build tested. Defaults boards and apps are selected to be an early warning
if something is wrong.
This should be used before triggering much larger murdock builds.
The following use cases are:
I made a change to something in the stm32 clocks...
./compile_like_murdock.py -c stm32
I changed a driver the DHT driver
./compile_like_murdock.py -a tests/driver_dht tests/saul
I changed a nucleo-f103rb board...
./compile_like_murdock.py -a tests/driver_dht tests/saul
For some TTY interfaces no DB entry exists, which is reflected by
having a `None` in `tty[key]`. Trying to match a regex against `None`
in turn resulted then in an exception.
This fixes the issue by treating a filter applied on a non-existing
entry as not matching.
It turned out that 4983f8bb60 was not
enough to allow the tool to be executed from within
`dist/tools/backport_pr`. With this, I successfully tested it :)
Add `search_parent_directories=True` to `git.Repo()` so that
`backport_pr.py` can be called anywhere within the RIOT git repo
without manually passing the repo root path via `--gitdir`.
Previously the tool had to be called from the RIOT base repo.
flatc uses `strto<foo>_l()` over `strto<foo>()` when available, so that
they behave reproducible. The musl libc has no locale support, which
has the added benefit of reproducible behavior being the default.
For some reason a `strtof_l()` compatibility wrapper was added in
musl, but the other `strto<foo>_l()` wrappers are missing. This
adds a patch to check for `strtoull_l()` instead of `strtof_l()`. This
will not make a difference on a libc that supports all of them, but
fixes compilation on musl.
The argument regif was removed from the shell command in https://github.com/RIOT-OS/RIOT/pull/18053,
so there is not much need to keep it in the ShellInteraction for that command.
- most were trivial
- missing group close or open
- extra space
- no doxygen comment
- name commad might open an implicit group
this hould also be implicit cosed but does not happen somtimes
- crazy: internal declared groups have to be closed internal
JLink presumably has information about the device's RAM available
internally. Not passing the precise symbol area (which would be
available in the ELF file) because a) that'd make the terminal break
when the flashed firmware does not equal the built one, and b) that
would introduce a dependency from `term` to the ELF file that other
terminals don't have.
detect_includes_and_version_gcc() previously only detected the includes,
but has been extended to also return the version. This is done by
returning a tuple, with the first item being the list of include paths,
and the second being the version. In the error handling the script still
returns only an empty list of includes, but not an empty version. This
fixes the issue.
This removes the existing hack, in which we wrote the configuration to
/dev/null to trigger its evaluation. Instead a function for this
specific purpose is added.
We can't use PB13/PB12 which would be the 'standard' UART pins on
the -xpro EXT connectors since only SERCOM4 can map to those - and
that's already used on EXT1.
So use the adjacent PA08/PA09 with SERCOM0.