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

42857 Commits

Author SHA1 Message Date
Marian Buschsieweke
7e58bea1bd
examples,tests: Update Makefile.cis 2023-02-27 12:31:04 +01:00
Marian Buschsieweke
cdcec5b3f9
drivers/saul: use flash_utils 2023-02-27 12:31:04 +01:00
Marian Buschsieweke
29cfeb752e
sys/phydat: use flash_utils 2023-02-27 12:31:03 +01:00
Marian Buschsieweke
2825f5f2ae
sys/shell: use flash_utils 2023-02-27 12:31:03 +01:00
Marian Buschsieweke
c406f7ef42
cpu/avr8_common: Wrap stdio.h
This allows automatically moving format strings to flash, provided that
code previously compiled fine with `-Wformat-nonliteral` (which in RIOT
is the case due to `-Wformat=2`).
2023-02-27 12:31:03 +01:00
Marian Buschsieweke
75f17b4930
pkg/cryptoauthlib: Fix compilation with -Wformat-nonliteral 2023-02-27 12:31:03 +01:00
Marian Buschsieweke
4e3c0777fc
sys/flash_utils: add helpers for placing variables in flash
This adds a layer of convenience abstraction over classical Harvard
architectures (like most AVRs) that do not map the flash memory into
the data address space and modern Harvard architectures or von-Neumann
architectures that do so. The motivation is to safe a lot of RAM for
AVR by storing constant strings into flash.
2023-02-27 12:31:03 +01:00
Marian Buschsieweke
e5d0f83696
cpu/atmega_common: store periph_timer prescalers in flash 2023-02-27 12:06:30 +01:00
Marian Buschsieweke
7e8a0ae2d4
build system: use -std=gnu11 for avr8
This allows using the __flash qualifier to store data into flash.
2023-02-27 12:06:29 +01:00
bors[bot]
e9333feac2
Merge #19322
19322: subsystems: Assign chrysn to Rust r=bergzand a=chrysn

This sets me as the (so far, sole) subsystem assignee for Rust.

Co-authored-by: chrysn <chrysn@fsfe.org>
2023-02-27 10:02:17 +00:00
chrysn
04320bcbf5 subsystems: Assign chrysn to Rust 2023-02-27 09:56:00 +01:00
bors[bot]
d4422a074a
Merge #18682
18682: pkg/lwext4: add lightweight implementation of the ext2/3/4 filesystem r=benpicco a=benpicco



Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2023-02-25 18:59:07 +00:00
bors[bot]
ae32ce7fda
Merge #19318
19318: efm32/dac: Shift instead of masking r=chrysn a=chrysn

The documented behavior is:

> The value is always given as 16-bit value and is internally scaled to the actual resolution that the DAC unit provides (e.g. 12-bit). So to get the maximum output voltage, this function has to be called with value set to 65535 (UINT16_MAX).

The previous behavior was masking, now it's shifting.

### Testing procedure

* Run tests/periph_dac interactively and look at the voltage with an oscilloscope.

  Before, the period was 100ms/16, now it's 100ms as advertised.

*Note: I couldn't do that yet, the above is just what I expect.*

### Issues/PRs references

Closes: https://github.com/RIOT-OS/RIOT/issues/19317

Co-authored-by: chrysn <chrysn@fsfe.org>
2023-02-25 13:08:32 +00:00
Benjamin Valentin
020aac6c4c boards/same54-xpro: add support for lwEXT4 2023-02-25 14:01:20 +01:00
Benjamin Valentin
c1a8a5cc9e boards/native: add support for lwEXT4 2023-02-25 14:01:20 +01:00
Benjamin Valentin
e798d21b3b pkg/lwext4: add lwEXT4 2023-02-25 14:01:20 +01:00
chrysn
b04af7920c efm32/dac: Shift instead of masking
Closes: https://github.com/RIOT-OS/RIOT/issues/19317
2023-02-25 13:38:56 +01:00
bors[bot]
9d1d4bb1b2
Merge #19119 #19313
19119: makefiles/tools/serial.inc.mk: Allow detection of debug adapter r=benpicco a=maribu

### Contribution description

This PR adds the ability to automatically detect the debug adapter for boards with an integrated programmer/debugger, if that debugger also provides the TTY.

This extends the TTY detection that can be enabled with `MOST_RECENT_PORT=1` to set `DEBUG_ADAPTER_ID` to the TTY's serial, but only if `DEBUG_ADAPTER_ID_IS_TTY_SERIAL` is set to `1` by the board (as not all boards have an integrated programmer/debugger).

### Testing procedure

Connect a HiFive-1B and a nRF52840DK at the same time and try `make BOARD=<nrf52840dk|hifive1b> MOST_RECENT_PORT=1 -C examples/default flash term` for both. The programmer will not reliably select the correct programmer in `master`. With this PR, it will.

### Issues/PRs references

None

19313: gnrc_static: don't parse address as prefix r=benpicco a=benpicco



Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de>
2023-02-24 17:46:10 +00:00
Marian Buschsieweke
64d4aec812
boards: Provide debug adapter ID from serial where possible
Set `DEBUG_ADAPTER_ID_IS_TTY_SERIAL` to `1` for those boards to allow
automatic detection of the debug adapter with `MOST_RECENT_PORT=1`.
2023-02-24 16:50:59 +01:00
Marian Buschsieweke
015ee050f2
makefiles/tools/serial.inc.mk: Allow detection of debug adapter
Boards with an integrated debugger/programmer that also provides the
serial as UART <--> USB adapter, the TTY serial matches the serial of
the programmer.

This adapts the `serial.inc.mk` to set the `DEBUG_ADAPTER_ID` to the
TTY serial if (and only if) `MOST_RECENT_PORT` *and*
`DEBUG_ADAPTER_ID_IS_TTY_SERIAL` both have a value of `1`. Boards with
an integrated programmer are expected to set
`DEBUG_ADAPTER_ID_IS_TTY_SERIAL` to `1` in their `Makefile.include`.
2023-02-24 16:50:56 +01:00
Marian Buschsieweke
48a02d60e2
dist/tools/usb-serial/ttys.py: Allow combining simple formats
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.
2023-02-24 16:49:44 +01:00
Benjamin Valentin
4e642451c8 gnrc_static: don't parse address as prefix 2023-02-24 16:03:16 +01:00
bors[bot]
1de75a6cbb
Merge #19309
19309: ci/print_versions: print all ESP32 toolchains r=maribu a=benpicco



Co-authored-by: Benjamin Valentin <benjamin.valentin@bht-berlin.de>
2023-02-24 13:12:07 +00:00
bors[bot]
e70f257b81
Merge #19311
19311: boards/microbit-v2: Recognize with MOST_RECENT_PORT r=maribu a=chrysn

### Contribution description

Since the introduction MOST_RECENT_PORT support, we've been gathering identifying criteria for particular boards to make it useful.

This adds such criteria to the microbit-v2. (They might also apply to the classical microbit board, but I have none to test; if it does, they're indistinguishable and that's something that can happen.)

### Testing procedure

* Connect something that has a USB UART, and then a microbit-v2, and then something yet different. (There might be simpler test setups).
* Run `make BOARD=microbit-v2 all term MOST_RECENT_PORT=1`
* Observe that /dev/ttyACM1 is selected.

Co-authored-by: chrysn <chrysn@fsfe.org>
2023-02-24 12:41:31 +00:00
bors[bot]
e4453d9cd2
Merge #19312
19312: SUBSYSTEMS.md: add myself to the list r=maribu a=benpicco



Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de>
2023-02-24 12:24:18 +00:00
chrysn
8dff7cc347 boards/microbit-v2: Recognize with MOST_RECENT_PORT 2023-02-24 12:44:45 +01:00
Benjamin Valentin
e5a6fa1342 SUBSYSTEMS.md: add myself to the list 2023-02-24 12:17:54 +01:00
bors[bot]
0dfc05c77c
Merge #19165 #19303
19165: cpu/sam0_common: adc: implement 16 bit mode by oversampling r=dylad a=benpicco



19303: dist/tools/insufficient_memory: Minor improvements r=benpicco a=maribu

### Contribution description

`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

`add_insufficient_memory_board.sh`:
- classify output as "not supported" also when used features are blacklisted, not only when required features are missing

### Testing procedure

Run the script; it should still work.

### Issues/PRs references

None

Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
2023-02-23 23:58:02 +00:00
Benjamin Valentin
0ecba666b9 ci/print_versions: don't print compiler error 2023-02-23 23:51:25 +01:00
Benjamin Valentin
c89eccd219 ci/print_versions: print all ESP32 toolchains 2023-02-23 23:49:14 +01:00
bors[bot]
4809b687b6
Merge #19292 #19307
19292: sys/phydat: Fix unit confusion r=miri64 a=maribu

### Contribution description

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 alternative 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`; which sadly is the same as for g-force. But usually there is enough context to tell them apart.

### Testing procedure

Green CI

### Issues/PRs references

None

19307: nanocoap_link_format: fix off-by-one error r=miri64 a=benpicco



Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de>
2023-02-23 21:25:12 +00:00
Benjamin Valentin
470bee59a7 cpu/sam0_common: implement 16 bit mode by oversampling 2023-02-23 22:17:48 +01:00
bors[bot]
72a0f1972d
Merge #18746 #19161
18746: sys/clif: Fixing out of bounds read under certain conditions r=maribu a=Teufelchen1

Hi 😈

This fixes a potential out of bounds read in clif_encode_link. There is no code in RIOT that can be exploited.
The fix does not break the current API but alters the behaviour slightly. Before the change, the length attributes of `clif_attr_t` where optional. If missing, the length was deduced using `strlen()`. This fix makes those parameters required and if they are `0` it operates as if the length really is `0`. This might not be ideal but it is the only non api breaking fix I could think off. 
```c
typedef struct {
    char *value;                  
    unsigned value_len;    NO LONGER OPTIONAL
    const char *key;               
    unsigned key_len;       NO LONGER OPTIONAL
} clif_attr_t;
```
Depends on #18744

cc `@leandrolanzieri` 

19161: bors.yaml: re-activate labels check + add block_labels r=miri64 a=miri64



Co-authored-by: Teufelchen1 <bennet.blischke@haw-hamburg.de>
Co-authored-by: Martine Lenders <m.lenders@fu-berlin.de>
2023-02-23 16:39:44 +00:00
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
Benjamin Valentin
7468c6272b nanocoap_link_format: fix off-by-one error 2023-02-23 16:34:56 +01:00
Martine Lenders
a7c450311b
bors.yaml: re-activate labels check + add block_labels 2023-02-23 15:49:46 +01:00
Teufelchen1
8c295ab7cf sys/clif: Fixing out of bounds read under certain conditions 2023-02-23 15:45:03 +01:00
Marian Buschsieweke
fe176f5b1f
dist/tools/insufficient_memory: Minor improvements
`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.
2023-02-23 13:47:00 +01:00
bors[bot]
bcd550bc68
Merge #19304
19304: matrix_keypad: Move documentation to doxygen group r=benpicco a=bergzand

### Contribution description

This moves the documentation for the matrix keypad module from the header file to the doxygen group. With this a reader doesn't have to click to the header file definitions from the doxygen group to read the documentation.

### Testing procedure

Take a brief look at the generated doxygen.


### Issues/PRs references

None


Co-authored-by: Koen Zandberg <koen@bergzand.net>
2023-02-23 12:23:50 +00:00
f4d4784034
matrix_keypad: Move documentation to doxygen group 2023-02-23 11:39:11 +01:00
bors[bot]
0cce1bc067
Merge #19299 #19301
19299: Add missing newline to output of telnet example r=benpicco a=Enoch247

### Contribution description

From the commit msg:

> The telnet example prints a line to the console, but it is not ended with a newline. When using pyterm, the last line is then never shown as it reads the console line by line and is waiting for the end of the line.
> 
> This patch swaps use of `printf` for `puts` for the last line printed. This means the missing newline character gets added. This is also done to be consistent with the rest of the file, where puts is used whenever possible instead of printf.


### Testing procedure

1. `cd examples/telnet`
2. `make all flash term`
3. observe the final line "Local shell disabled" is printed, but would not have without this patch


### Issues/PRs references

- none known


19301: fib: document unused state r=benpicco a=benpicco



Co-authored-by: Joshua DeWeese <jdeweese@primecontrols.com>
Co-authored-by: Benjamin Valentin <benjamin.valentin@bht-berlin.de>
2023-02-22 15:50:59 +00:00
Benjamin Valentin
378e5e2382 fib: document unused state 2023-02-22 16:47:14 +01:00
Joshua DeWeese
cdf26c9cd0 examples/telnet_server: add missing newline
The telnet example prints a line to the console, but it is not ended
with a newline. When using pyterm, the last line is then never shown as
it reads the console line by line and is waiting for the end of the
line.

This patch swaps use of `printf` for `puts` for the last line printed.
This means the missing newline character gets added. This is also done
to be consistent with the rest of the file, where puts is used whenever
possible instead of printf.
2023-02-22 09:49:10 -05:00
bors[bot]
e738fdd44c
Merge #13943
13943: RDM: The 802.15.4 Radio HAL r=miri64 a=jia200x



Co-authored-by: Jose Alamos <jose@alamos.cc>
2023-02-22 12:37:05 +00:00
bors[bot]
7d882cf736
Merge #19297
19297: tests/rmutex: clean up test and reduce stack size r=maribu a=maribu

### Contribution description

As the title says. This results in a few more boards being able to run the test.

Also, the wording in the README.md is improved to not be interpreted as generally threads with lower thread ID being preferred over threads with higher when locking a mutex.

### Testing procedure

```
make -C tests/rmutex BOARD=foo flash test
```

### Issues/PRs references

Fixes https://github.com/RIOT-OS/RIOT/issues/19140

Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
2023-02-22 12:19:34 +00:00
bors[bot]
ed32ca3cd8
Merge #19293
19293: boards/seeedstudio-gd32: add mtd_sdcard_default r=benpicco a=gschorcht

### Contribution description

This PR adds the default configuration for `mtd_sdcard` module.

### Testing procedure

Green CI

### Issues/PRs references


Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-02-22 12:02:01 +00:00
Jose Alamos
7ac3052388
rdm/radio_hal: add radio HAL design document 2023-02-22 11:15:49 +01:00
bors[bot]
41b54d8594
Merge #18392
18392: drivers/servo: reimplement with high level interface r=benpicco a=maribu

### Contribution description

The previous servo driver didn't provide any benefit over using PWM directly, as users controlled the servo in terms of PWM duty cycles. This changes the interface to provide a high level interface that abstracts the gory PWM details.

In addition, a SAUL layer and auto-initialization is provided.

### Testing procedure

The test application provides access to the servo driver via the `saul` shell command.

```
> saul
2022-08-02 22:12:31,826 # saul
2022-08-02 22:12:31,827 # ID	Class		Name
2022-08-02 22:12:31,830 # #0	ACT_SWITCH	LD1(green)
2022-08-02 22:12:31,832 # #1	ACT_SWITCH	LD2(blue)
2022-08-02 22:12:31,834 # #2	ACT_SWITCH	LD3(red)
2022-08-02 22:12:31,837 # #3	SENSE_BTN	B1(User button)
2022-08-02 22:12:31,838 # #4	ACT_SERVO	servo
> saul write 4 0
2022-08-02 22:12:41,443 # saul write 4 0
2022-08-02 22:12:41,445 # Writing to device #4 - servo
2022-08-02 22:12:41,447 # Data:	             0 
2022-08-02 22:12:41,450 # [servo] setting 0 to 2949 (0 / 255)
2022-08-02 22:12:41,453 # data successfully written to device #4
> saul write 4 256
2022-08-02 22:12:45,343 # saul write 4 256
2022-08-02 22:12:45,346 # Writing to device #4 - servo
2022-08-02 22:12:45,347 # Data:	           256 
2022-08-02 22:12:45,351 # [servo] setting 0 to 6865 (255 / 255)
2022-08-02 22:12:45,354 # data successfully written to device #4
```

Each write resulted in the MG90S servo that I connected to move to the corresponding position.

### Issues/PRs references

Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
2023-02-22 09:15:59 +00:00
Marian Buschsieweke
6dc2a60597
drivers/servo: reimplement with high level interface
The previous servo driver didn't provide any benefit over using PWM
directly, as users controlled the servo in terms of PWM duty cycles.
This changes the interface to provide a high level interface that
abstracts the gory PWM details.

In addition, a SAUL layer and auto-initialization is provided.

Co-authored-by: benpicco <benpicco@googlemail.com>
2023-02-22 10:00:04 +01:00
Marian Buschsieweke
0620ac68ff
tests/rmutex: clean up test and reduce stack size
This results in a few more boards being able to run the test.
Also, the wording in the README.md is improved.
2023-02-22 09:39:01 +01:00