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

43221 Commits

Author SHA1 Message Date
Marian Buschsieweke
12140ffb0e
examples,tests: Drop redundant dependency
When depending on one or more shell commands, the shell is pulled in
as dependency anyway.
2023-04-19 16:58:10 +02:00
Marian Buschsieweke
6448258aac
sys/shell: Add missing dependency
The shell_cmds module depends on the shell module. This was correctly
added to KConfig, but the Makefile dependencies missed this one. This
commit adds the missing dep.
2023-04-19 12:25:00 +02:00
Marian Buschsieweke
5e28ec5a63
tests/memarray: Drop bogus dependency
There is no need for shell commands if there is no shell.
2023-04-19 12:24:54 +02:00
bors[bot]
812c216f0c
Merge #19450 #19476
19450: cpu/esp32: fix compilation issues with GCC 12.2 r=benpicco a=gschorcht

### Contribution description

This PR provides the changes in `cpu/esp32` and `cpu/esp_common` to fix the compilation issues with GCC v12.2.  It is required as the first step in the preparation of the upgrade to ESP-IDF version 5.1.

**Please note**: Insead of fixing the ESP-IDF 4.4 code itself by a big bunch of patches to fix the compilation problems with GCC v12.2, it temporarily disables some warnings. The reason is that the ESP-IDF 5.1 requires GCC v12.2 and should be fixed for this compiler version by the vendor.

### Testing procedure

Green CI

The change were already tested with all ESP-specific modules like `esp_now`, `esp_wifi`, `esp_spi`  and `esp_ble` for all supported ESP platforms.

### Issues/PRs references

Prerequisite for https://github.com/RIOT-OS/riotdocker/pull/227
Fixes issue #19421

19476: native/syscalls: rename real_clock_gettime to clock_gettime r=benpicco a=Teufelchen1

### Contribution description

When compiling RIOT for native using a recent LLVM and enabling ASAN, one might encounter "Duplicated symbol".

This is due to a name clash with `real_clock_gettime()` in compiler-rt from [LLVM](f50246da65), I renamed RIOTs `real_clock_gettime` and just default to the posix function `clock_gettime`. The wrapper existed, most likely, for consistency only.

(The best solution would probably to convince the LLVM folks to declare their symbol as `static` and refactor a bit)

### Testing procedure

Passing CI should be enough.


Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
Co-authored-by: Teufelchen1 <bennet.blischke@haw-hamburg.de>
2023-04-17 20:18:02 +00:00
bors[bot]
2b6dc6471e
Merge #19436
19436: cpp11-compat: thread::sleep_for in microseconds r=benpicco a=kfessel

### Contribution description

after reviewing #19369  i found that there is a conversion to nanoseconds just to convert it to microseconds some instrunctions later for ztimer64_usec to handle it this removes one of the conversions (convert once direct to microseconds)

### Testing procedure

run the cpp tests

### Issues/PRs references

#19369

Co-authored-by: Karl Fessel <karl.fessel@ovgu.de>
2023-04-17 18:20:28 +00:00
bors[bot]
023cf782ba
Merge #19447
19447: boards/nucleo-f429zi: Provide 2nd timer r=benpicco a=maribu

### Contribution description

- Add a common timer config with two (instead of only one) timer using TIM2 + TIM5
    - Mostly copy-pasting the cfg_timer_tim2.h and cfg_timer_tim5.h together
- Make use of that for the `nucleo-f429zi`

### Testing procedure

E.g. `tests/periph_timer`, but also grepping for TIM2 and TIM5 in `boards/nucleo-f429zi/include/periph_conf.h` to detect any conflict e.g. between PWM and timer config.

### Issues/PRs references

None

Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
2023-04-17 16:21:27 +00:00
Teufelchen1
10cada1b8d native/syscalls: rename real_clock_gettime to clock_gettime 2023-04-17 15:21:52 +02:00
bors[bot]
a87634cf91
Merge #19475
19475: gnrc_netif/lorawan: fix setting nwkskey via NETOPT r=MrKevinWeiss a=jia200x



Co-authored-by: Jose Alamos <jose@alamos.cc>
2023-04-17 13:04:37 +00:00
Karl Fessel
90d2ae83fb cpp11-compat: thread::sleep_for in microseconds 2023-04-17 13:27:14 +02:00
Jose Alamos
3c1f5a0dbd
gnrc_netif/lorawan: fix setting nkskey via NETOPT 2023-04-17 12:40:42 +02:00
Marian Buschsieweke
d7923f4905
boards/nucleo-f429zi: Use common TIM5 + TIM2 timer conf 2023-04-17 12:24:48 +02:00
Marian Buschsieweke
190cfdb206
boards/common/stm32: Add timer conf for TIM5 + TIM2
This adds a common configuration file that provides two periph timers
using TIM5 and TIM2.
2023-04-17 12:24:48 +02:00
bors[bot]
82234b1d23
Merge #19389
19389: drivers/usbdev_synopsys_dwc2: add GD32V support r=bergzand a=gschorcht

### Contribution description

This PR provides the GD32V support in `drivers/usbdev_synopsys_dwc2`. It also includes some cleanup and bug fixes.

To support GD32V (CID 1.000) the PR includes the following changes:
- XFRC interrupts are also used in Non-DMA mode to complete a transfer
- SETUP phase done (STUP) interrupt is used in Non-DMA mode
- additional XFRC interrupts in SETUP stage are ignored
- RX FIFO handling doesn't complete a transfer anymore and is handled directly in ISR
- OTG interrupt handling added

The following fixes, improvements and cleanup has been added:
- USB OTG HS definition dependencies for platforms that don't support USB OTG HS
- thread context switch at ISR exit was added for all platforms
- units in USB FIFO size definitions are clarified
- USB EP number as defined in CMSIS is used
- FIFO allocation documentation is improved
- power modes for STM32 are fixed
- CID/HW debug info added

The PR could be split into a PRs with cleanups and improvements and a PR with GD32V support if necessary.

### Testing procedure
```
BOARD=sipeed-longan-nano make -j8 -C tests/shell
```
should work with `stdio_cdc_acm`.

`periph_usbdev` should still work for other platforms. The PR was tested with `tests/usbus_cdc_ecm` together with `stdio_cdc_acm` if possible:
```
esp32s2      FS  CID: 0000, HWREV: 4f54400a, HWCFG: 224dd930  (esp32s2-devkit)
esp32s3      FS  CID: 0000, HWREV: 4f54400a, HWCFG: 224dd930  (esp32s3-devkit)
efm32gg12    FS  CID: 0000, HWREV: 4f54330a, HWCFG: 228f5910  (sltb009a)
gd32vf103cb  FS  CID: 1000, HWREV: 00000000, HWCFG: 00000000  (sipeed-longan-nano)
stm32f407vg  FS  CID: 1200, HWREV: 4f54281a, HWCFG: 229dcd20  (stm32f4discovery) 
stm32f429zi  HS  CID: 1100, HWREV: 4f54281a, HWCFG: 229ed590  (stm32f429i-disc1)
stm32f439zi  FS  CID: 1200, HWREV: 4f54281a, HWCFG: 229dcd20  (nucleo-f439ze)
stm32f446ze  FS  CID: 2000, HWREV: 4f54320a, HWCFG: 229ed520  (nucleo-f446ze)
stm32f723ie  FS  CID: 3000, HWREV: 4f54330a, HWCFG: 229ed520  (stm32f723e-disco)
stm32f723ie  HS  CID: 3100, HWREV: 4f54330a, HWCFG: 229fe1d0  (stm32f723e-disco)
stm32f746ng  FS  CID: 2000, HWREV: 4f54320a, HWCFG: 229ed520  (stm32f746g-disco)
stm32f746ng  HS  CID: 2100, HWREV: 4f54320a, HWCFG: 229fe190  (stm32f746g-disco)
stm32f767zi  FS  CID: 2000, HWREV: 4f54320a, HWCFG: 229ed520  (nucleo-f767zi)
```
Boards with HS interfaces were tested in DMA and none-DMA mode.

### Issues/PRs references

Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-04-17 08:36:02 +00:00
Gunar Schorcht
d8d9a9bdc4 cpu/esp32: disable warnings in ESP-IDF for gcc 12.2 2023-04-17 07:32:48 +02:00
Gunar Schorcht
0de2570802 cpu/esp32: fix compilation with gcc 12.2 2023-04-17 07:32:48 +02:00
Gunar Schorcht
1e983f3833 boards/common/gd32v: enable usb_board_reset if USB CDC ACM is used 2023-04-16 23:24:23 +02:00
Gunar Schorcht
c92b981581 boards/spieed-longan-nano: use stdio_cdc_acm by default 2023-04-16 23:24:23 +02:00
Gunar Schorcht
ff6e3d4f6d boards/seeedstudio-gd32: use stdio_cdc_acm by default 2023-04-16 23:24:23 +02:00
Gunar Schorcht
6d7c6c1957 boards/seeedstudio-gd32: add periph_usbdev support 2023-04-16 23:24:23 +02:00
Gunar Schorcht
ac8f221c1f boards/sipeed-longan-nano: add periph_usbdev support 2023-04-16 23:24:23 +02:00
Gunar Schorcht
81cf8a5eec cpu/gd32v: add periph_usbdev support 2023-04-16 23:24:23 +02:00
Gunar Schorcht
26d435a101 drivers/usbdev_synopsys_dwc2: add GD32V support 2023-04-16 23:24:23 +02:00
Gunar Schorcht
ee83893496 drivers/periph_usbdev: TXFE not used any longer
After changing IN EPs also to use XFRC (Transfer Complete) interrupts in non-DMA mode, the TXFE (TX FIFO Empty) interrupt is no longer needed to signal the completion of an IN transfer.
2023-04-16 23:24:23 +02:00
Gunar Schorcht
ea776c92b6 drivers/usbdev_synopsys_dwc2: handle RXFLVL interruprs in ISR
Since RXFLVL (RX FIFO Level) interrupt doen't complete transfers anymore, they are handled now directly in the ISR.
2023-04-16 23:24:23 +02:00
Gunar Schorcht
d15f0f3a7b drivers/usbdev_synopsys_dwc2: use XFRC for OUT EPs in non-DMA mode
XFRC (Transfer Complete) interrupts are now also used for OUT EPs in non-DMA mode. RXFLVL (RX FIFO Level) interrupts are no longer used to signal completed transfers, but only to copy data from FIFO to memory and to set a flag indicating that a SETUP stage is in progress. STUP (SETUP phase done) interrupts are then used to signal a completed SETUP stage and to reset the flags that indicates the SETUP stage. The flag that indicates the SETUP stage in progress is used to ignore additional XFRC interrupts for EP0 during the SETUP stage.
2023-04-16 23:24:23 +02:00
Gunar Schorcht
1ccafe1621 drivers/usbdev_synopsys_dwc2: use XFRC for IN EPs in non-DMA mode
XFRC (Transfer Complete) interrupts are now also used for IN EPs in non-DMA mode. TXFE (TX FIFO Empty) interrupts are not necessarily needed but are still enabled.
2023-04-16 22:59:11 +02:00
Gunar Schorcht
1a37d3b9e0 drivers/usbdev_synopsys_dwc2: several cleanups 2023-04-16 22:59:11 +02:00
Gunar Schorcht
e3fb4e7cfb drivers/usbdev_synopsys_dwc2: add OTG interrupt handling 2023-04-16 22:59:11 +02:00
Gunar Schorcht
1d7224602d drivers/usbdev_synopsys_dwc2: print CID/HW debug info 2023-04-16 22:59:11 +02:00
Gunar Schorcht
ff9e9e3a7c drivers/usbdev_synopsys_dwc2: fix power modes for STM32 2023-04-16 22:59:11 +02:00
Gunar Schorcht
d35fa914c8 drivers/usbdev_synopsys_dwc2: fix a typo 2023-04-16 22:59:11 +02:00
Gunar Schorcht
98b6d75c14 drivers/usbdev_synopsys_dwc2: improve FIFO allocation doc 2023-04-16 22:59:11 +02:00
Gunar Schorcht
5b93c18414 cpu/stm32: clarify units in USB FIFO size definitions
Since the USB OTG FIFO sizes are partly defined in 32-bit words and partly in bytes, the documentation of the of the USB OTG FIFO size definitions is extended by the respective unit.
2023-04-16 22:59:11 +02:00
Gunar Schorcht
9f894bc1ac cpu/efm32: clarify units in USB FIFO size definitions
Since the USB OTG FIFO sizes are partly defined in 32-bit words and partly in bytes, the documentation of the of the USB OTG FIFO size definitions is extended by the respective unit.
2023-04-16 22:59:11 +02:00
Gunar Schorcht
0c9eb535eb cpu/esp32: clarify units in USB FIFO size definitions
Since the USB OTG FIFO sizes are partly defined in 32-bit words and partly in bytes, the documentation of the of the USB OTG FIFO size definitions is extended by the respective unit.
2023-04-16 22:59:11 +02:00
Gunar Schorcht
9e8ef51283 drivers/usbdev_synopsys_dwc2: add thread context switch at ISR exit
The USB device driver ISR sets a thread flag of the waiting USBUS thread to indicate that it has to handle a USB device driver event. However, setting a thread flag only sets `sched_context_switch_request` to indicate that a thread context switch would be required, but it is not executed. Therefore, for STM32 MCUs, `cortexm_isr_end` was called to execute the context switch. Since the driver is also used by other platforms, this call is replaced by a direct call of `thread_yield_higher` if required. NOTE: For ESP32x SoC, such a thread context switch is implicitly executed at the end of each ISR if necessary.
2023-04-16 22:59:11 +02:00
Gunar Schorcht
9528733a99 cpu/efm32: remove USB OTG HS definitions in vendor definitions
EFM32 MCUs do not support USB OTG HS mode. The according definitions are therefore removed from vendor definitions.
2023-04-16 22:59:11 +02:00
Gunar Schorcht
457c0cffc3 cpu/esp32: remove USB OTG HS definitions in vendor definitions
ESP32 MCUs do not support USB OTG HS mode. The according definitions are therefore removed from vendor definitions.
2023-04-16 22:59:11 +02:00
Gunar Schorcht
8999a5083f drivers/usbdev_synopsys_dwc2: remove USB OTG HS definition dependencies
If the MCU/board has only an USB OTG FS peripheral or only an USB OTG HS peripheral, it should only need to specify the USB OTG FS definitions such as the number of EPs or the FIFO sizes or only the USB OTG HS definitions. This commit cleans up the code so that it is translatable without the respective definitions.
2023-04-16 22:59:11 +02:00
bors[bot]
1961274705
Merge #19471
19471: drivers/periph_usbdev: fix set device address r=bergzand a=gschorcht

### Contribution description

This PR allows to define when the device address is set on receipt of a SETUP with `SET ADDRESS Request`. It fixes the problem with enumeration of the Synopsys DWC2 USB OTG Core due to the wrong time of setting the device address.

Especially, it fixes the problem that the enumeration fails completely for the `stm32f723e-disco` board with CDC ECM if CDC ACM is not used and the additional reset cycles during the enumeration for a couple of platforms such as ESP32-S2 and ESP32-S3.

**Background**

The address in the USB device can be set either directly after the SETUP stage on receipt of the `SET ADDRESS Request` or after the associated STATUS stage. When the USB device address has to be set depends on the hardware implementation.
**Solution**

To control the time of setting the device address, a new define `USBDEV_SET_ADDR_AFTER_STATUS` is introduced.
If `USBDEV_SET_ADDR_AFTER_STATUS` has the value 1 (default), the address is set in the USB device after the STATUS stage. Since this is the default, existing `periph_usbdev` drivers shouldn't be affected. Overwriting `USBDEV_SET_ADDR_AFTER_STATUS`  with 0 in `periph_cpu.h` or in driver header file let the address set directly after the SETUP stage.

### Testing procedure

Use `tests/usbus_cdc_ecm`:

For `stm32f723e-disco` the enumeration doesn't work at all without this PR and works reliable with this PR.
```
USEMODULE='periph_usbdev_hs_utmi' BOARD=stm32f723e-disco make -C tests/usbus_cdc_ecm flash
```
For any ESP32-S2 or ESP32-S3 board, the enumeration requires an addition reset cycle in every third or fourth enumeration without this PR and doesn't require any reset cycle with this PR.
```
BOARD=esp32s2-devkit make -C tests/usbus_cdc_ecm flash
```
Other platforms should still work with this PR, for example ATSAM platform:
```
BOARD=arduino-mkr1000 make -C tests/usbus_cdc_ecm flash
```

### Issues/PRs references


Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-04-16 15:33:53 +00:00
Gunar Schorcht
88cabbae64 drivers/usbdev_synopsys_dwc2: set USBDEV_SET_ADDR_AFTER_STATUS
DWC2 core requires that the device address has to be set directly after SETUP stage and not after the associated STATUS stage.
2023-04-16 17:14:08 +02:00
Gunar Schorcht
e46fa4a0b2 sys/usbus: use USBDEV_SET_ADDR_AFTER_STATUS
Use symbol `USBDEV_SET_ADDR_AFTER_STATUS` to determine whether the device address has to be set directly after SETUP stage or after the associated STATUS stage.
2023-04-16 17:14:08 +02:00
Gunar Schorcht
d675cd7290 drivers/periph_usbdev: define USBDEV_SET_ADDR_AFTER_STATUS
The address in the USB device can be set either directly after the SETUP stage on receipt of the `SET ADDRESS Request` or after the associated status stage. When the USB device address has to be set depends on the hardware. If `USBDEV_SET_ADDR_AFTER_STATUS` has the value 1 (default), the address is only set in the USB device after the status stage. Overwrite it with 0 in `periph_cpu.h` to set the address already directly after the SETUP stage.
2023-04-16 17:14:08 +02:00
bors[bot]
5a523ee894
Merge #19467
19467: drivers/at86rf2xx: fix default page being ignored r=maribu a=jia200x



Co-authored-by: Jose Alamos <jose@alamos.cc>
2023-04-13 16:26:35 +00:00
bors[bot]
acd02f1f9c
Merge #19466
19466: sys/shell: fix missing generic lora settings in ifconfig r=aabadie a=aabadie



Co-authored-by: Alexandre Abadie <alexandre.abadie@inria.fr>
2023-04-13 12:16:03 +00:00
Jose Alamos
268487097b
drivers/at86rf2xx: fix default page 2023-04-13 11:10:54 +02:00
f50be77e05
tests/Makefile.boards.netif: add lora-e5-dev 2023-04-13 10:55:24 +02:00
a5699d0d5d
tests/Makefile.boards.netif: add nucleo-wl55jc 2023-04-13 10:55:24 +02:00
d733314ebe
sys/shell: fix missing generic lora settings in ifconfig 2023-04-13 10:55:23 +02:00
4ccbe0dbac
drivers/sx126x: add missing lora module dependency 2023-04-13 10:55:23 +02:00