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

8285 Commits

Author SHA1 Message Date
Benjamin Valentin
7607b9c0f5 cpu/esp32: add esp-bootloader-reset 2023-02-02 10:56:40 +01:00
Gunar Schorcht
f7949e42fd cpu/gd32v: add periph_adc support 2023-02-01 23:11:07 +01:00
Gunar Schorcht
42b683a89e cpu/gdv32: add SPI support 2023-02-01 02:37:54 +01:00
bors[bot]
718e4a8340
Merge #16782 #19201
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>
2023-01-31 23:15:41 +00:00
Gunar Schorcht
5355a2435c cpu/dg32v: add periph_i2c support 2023-01-31 20:12:04 +01:00
Gunar Schorcht
e387019076 cpu/gd32v: move board dependent RTT configs to board config 2023-01-29 18:51:59 +01:00
Gunar Schorcht
e9be9b4e75 cpu/gd32v: add periph_pwm support 2023-01-28 18:16:17 +01:00
Gunar Schorcht
0dfbdebaf7 cpu/gd32v: allow using TIMER0 as timer device 2023-01-28 17:46:45 +01:00
Gunar Schorcht
596d762806 cpu/gd32v: move TIMER_CHANNEL macros to header file 2023-01-28 17:39:06 +01:00
Gunar Schorcht
2c6e527339 cpu/gd32v: fix interrupt handling in periph_timer
When a timer is set, any pending interrupts must be cleared before the interrupt is enabled for the channel. Otherwise the interrupt would be triggered immediately when the timer is set.
2023-01-28 17:37:15 +01:00
Gunar Schorcht
4383e0ac6f cpu/gd32v: fix periph_flashpage doc group 2023-01-27 06:46:51 +01:00
Gunar Schorcht
0b6fc8833b cpu/gd32v: add periph_rtt support 2023-01-27 06:46:51 +01:00
bors[bot]
719787bd7f
Merge #19192
19192: cpu/esp32: fixes for boot issues and crashes on ESP32 r=kaspar030 a=Flole998

### Contribution description

In syscalls_init() there is a call to malloc(), which will return NULL if the heap is not initialized before, causing the entire board to fail booting if MODULE_ESP_IDF_HEAP is used.

API of [vTaskDelete()](https://www.freertos.org/a00126.html) says, that if NULL is passed to vTaskDelete the calling task should be deleted.

This PR needs a backport to 2023.01.

### Testing procedure

Just compiling on the ESP32S2 and running it with WiFi caused it to not start anymore, no output, nothing. When Null is written to that null-pointer it hangs.

The second commit fixed an issue/assertion fail that happens when the WiFi connection drops/disconnects.

### Issues/PRs references

Issue was introduced with PR #19146 

Co-authored-by: Flole998 <Flole998@users.noreply.github.com>
2023-01-24 20:36:34 +00:00
Flole998
56d2997d95 cpu/esp_common/freertos: Handle NULL being passed to vTaskDelete 2023-01-24 17:48:13 +00:00
Flole998
1a4af03a94 cpu/esp32: Make sure heap is initialized early enough
In syscalls_init() there is a call to malloc(), which will return NULL if the heap is not initialized before, causing the entire board to fail booting if MODULE_ESP_IDF_HEAP is used.
2023-01-24 16:46:22 +00:00
bors[bot]
f85366ae60
Merge #19185 #19187
19185: cpu/gd32v: add periph_gpio_irq support r=gschorcht a=gschorcht

### Contribution description

This PR provides the `periph_gpio_irq` support and is one of a bunch of follow up PRs that complete the peripheral drivers for GD32VF103.

### Testing procedure

Use a GD32VF103 board and flash `tests/periph_gpio`. Note: The Sipeed Longan Nano works also with `seeedstudio-gd32` board defintion and could be used for testing.
```
BOARD=seeedstudio-gd32 make -C tests/periph_gpio flash  (until PR #19170 is merged only `seeedstudio
```
With the GPIO PB8 and PB9 connected, the following test sequence should work:
```
> init_out 1 8
> init_int 1 9 2 0
GPIO_PIN(1, 9) successfully initialized as ext int
> set 1 8
INT: external interrupt from pin 9
> clear 1 8
INT: external interrupt from pin 9
```


### Issues/PRs references


19187: cpu/gd32v: add pm_layered support in periph_pm r=gschorcht a=gschorcht

### Contribution description

This PR provides the `pm_layered` support and is one of a bunch of follow up PRs that complete the peripheral drivers for GD32VF103.

Since the configuration of the deep sleep and the standby mode require the access CSR (control and status registers) of the MCU, the Nuclei-SDK NMSIS is added as package which provides a low-level interface for Nuclei-based RISC-V MCUs.

### Testing procedure

The best way to test it is to rebase this PR onto PR #19186 and to flash `tests/periph_pm` to any GD32VF103 board. Note: The Sipeed Longan Nano works also with `seeedstudio-gd32` board definition and could be used for testing.
```
BOARD=seeedstudio-gd32 make -C tests/periph_pm flash
```
The test output should be:
```
main(): This is RIOT! (Version: 2023.04-devel-174-g7dc91-cpu/gd32v/periph_pm_test)
...
mode 0 blockers: 1 
mode 1 blockers: 2 
mode 2 blockers: 0 
Lowest allowed mode: 2
```
Using command the `set_rtc 1 5` command should let the MCU deep sleep for 5 seconds
```
> set_rtc 1 5
Setting power mode 1 for 5 seconds.
␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀> 
```
while command `set_rtc 1 5` should set the MCU into the standby mode which is left with restart.
```
> set_rtc 0 5
Setting power mode 0 for 5 seconds.
main(): This is RIOT! (Version: 2023.04-devel-174-g7dc91-cpu/gd32v/periph_pm_test)
...
mode 0 blockers: 1 
mode 1 blockers: 2 
mode 2 blockers: 0 
Lowest allowed mode: 2
> 
```
The garbage on UART interface after deep sleep is caused by the clock synchronisation that becomes necessary after deep sleep and is the same as for other boards.

### Issues/PRs references

Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-01-24 14:38:28 +00:00
Gunar Schorcht
cfbda4022a cpu/gdv32: add pm_layered support 2023-01-24 00:52:02 +01:00
Gunar Schorcht
b02ffb21b8 cpu/gd32v: use NMSIS SDK package 2023-01-24 00:52:02 +01:00
Gunar Schorcht
ced6344651 cpu/gd32v: add periph_gpio_irq support 2023-01-23 22:51:35 +01:00
Gunar Schorcht
13e4ea4be1 boards/sipeed-longan-nano: initial support 2023-01-23 18:59:32 +01:00
Gunar Schorcht
31604da8fe boards/common: add common definitions for GD32VF103 boards 2023-01-23 18:59:32 +01:00
Gunar Schorcht
19420d6595 cpu/gd32v: add periph_rtc support 2023-01-22 17:53:44 +01:00
bors[bot]
d11a358b1d
Merge #18472 #19175
18472: drivers/mrf24j40: add support for IEEE 802.15.4 Radio HAL r=benpicco a=jia200x



19175: drivers/periph_common/flashpage: fix silent error r=benpicco a=Enoch247

### Contribution description

This patch removes a test that silently hides failed writes to NULL. Instead, assert is used to ensure that the address is not NULL.


### Testing procedure

I am not certain how to update the tests to catch asserts. If this is possible, I will add a test, if someone will point me to a good example to learn from.


### Issues/PRs references

- none


Co-authored-by: Jose Alamos <jose@alamos.cc>
Co-authored-by: Joshua DeWeese <jdeweese@primecontrols.com>
2023-01-19 18:17:13 +00:00
Jose Alamos
92f3a170af
cpu/atmega128rfa1/Kconfig: select default transceiver 2023-01-19 15:34:19 +01:00
Jose Alamos
48e8953beb
cpu/atmega256rfr2/Kconfig: select default transceiver 2023-01-19 15:34:19 +01:00
bors[bot]
d4d91492cd
Merge #18100 #19121 #19164 #19169
18100: core/assert: print backtrace on failed assertion r=kaspar030 a=benpicco



19121: socket_zep: only report size of single datagram r=kaspar030 a=benpicco



19164: cpu/sam0_common: move adc_res_t to common code r=dylad a=benpicco



19169: tests/driver_ws281x: don't overwrite board definition 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-01-18 23:59:58 +00:00
bors[bot]
7855aad7e4
Merge #19079
19079: cpu/esp32: add periph_flashpage support r=kaspar030 a=gschorcht

### Contribution description

This PR provides the `periph_flashpage` support for ESP32x SoCs.

For byte-aligned read access to constant data in the flash, the MMU of all ESP32x SoCs allows to map a certain number of 64 kByte pages of the flash into the data address space of the CPU. This address space is called DROM. Normally the whole DROM address space is assigned to the section `.rodata`. The default flash layout used by all ESP32x SoCs is:
| Address in Flash | Content |
|:-----------------------|:-----------|
| `0x0000` or `0x1000` | bootloader |
| `0x8000` | parition table |
| `0x9000` | `nvs` parition with WiFi data |
| `0xf000`  | `phy_init` partition with RF data |
| `0x10000` | `factory` partition with the app image |

The factory partition consists of a number of 64 kByte pages for the sections `.text`, `.rodata`, `.bss` and others. The `.text` and `rodata` sections are page-aligned and are simply mapped into the instruction address space (IROM) and the data address space (DROM), respectively. All other sections are loaded into RAM.

If the `periph_flashpage` module is used, the `periph_flashpage` driver
- decreases the size of the `.rodata` section in DROM address space by `CONFIG_ESP_FLASHPAGE_CAPACITY`,
- adds a section `.flashpage.writable` of size `CONFIG_ESP_FLASHPAGE_CAPACITY` at the end of DROM address space that is mapped into data address space of the CPU,
- reserves a region of size `CONFIG_ESP_FLASHPAGE_CAPACITY` starting from `0x10000` in front of the image partition `factory` and
- moves the image partition `factory` by  `CONFIG_ESP_FLASHPAGE_CAPACITY` to address `0x10000 + CONFIG_ESP_FLASHPAGE_CAPACITY`. 

The new flash layout is then:
| Address in Flash | Content |
|:-----------------------|:-----------|
| `0x0000` or `0x1000` | bootloader |
| `0x8000` | parition table |
| `0x9000` | `nvs` parition with WiFi data |
| `0xf000`  | `phy_init` partition with RF data |
| `0x10000` | flashpage region |
| `0x10000 + CONFIG_ESP_FLASHPAGE_CAPACITY` | `factory` partition with the app image |

This guarantees that the flash pages are not overwritten if a new app image with changed size is flashed. `CONFIG_ESP_FLASHPAGE_CAPACITY` has to be a multiple of 64 kBytes.

~The PR includes PR #19077 and PR #19078 for the moment to be compilable.~

### Testing procedure

The following tests should pass.
```
USEMODULE='esp_log_startup ps shell_cmds_default' BOARD=esp32-wroom-32 make -j8 -C tests/periph_flashpage flash term
```
```
USEMODULE='esp_log_startup ps shell_cmds_default' BOARD=esp32-wroom-32 make -j8 -C tests/mtd_flashpage flash term
```

### Issues/PRs references

Depends on PR #19077
Depends on PR #19078 


Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-01-18 17:48:29 +00:00
Benjamin Valentin
bfe2391148 cpu/sam0_common: fix static checks in periph_cpu_common.h 2023-01-18 01:54:34 +01:00
Benjamin Valentin
9dcb3991d2 cpu/sam0_common: move adc_res_t to common code 2023-01-17 17:18:07 +01:00
bors[bot]
9ff9704fe5
Merge #19010 #19149
19010: bootloaders/riotboot: add tinyUSB DFU support r=benpicco a=gschorcht

### Contribution description

This PR provides
- the tinyUSB DFU and DFU Runtime support and
- the `riotboot_tinyusb_dfu` bootloader that uses the tinyUSB DFU mode to flash new application images.

~This PR includes PR #18983 for now to be compilable.~

### Testing procedure

1. Use any board that supports the `riotboot´ and `tinyusb_device` features and flash the bootloader first, for example
   ```
   BOARD=nucleo-f767zi make -C bootloaders/riotboot_tinyusb_dfu flash
   ```
   and check that the `riotboot_tinyusb_dfu` bootloader is in DFU mode:
   ```
   dfu-util --list
   ```
3. Flash a first application using the following command:
    ```
   FEATURES_REQUIRED=riotboot USEMODULE=tinyusb_dfu BOARD=nucleo-f767zi \
   make -C tests/saul PROGRAMMER=dfu-util riotboot/flash-slot0
   ```
   and check that the application starts and is seen as upgradable:
   ```
   dfu-util --list
   ```
4. Restart the node in bootloader DFU mode by:
   ```
   dfu-util -e
   ```
   Flash a second application, for example
   ```
   FEATURES_REQUIRED=riotboot USEMODULE=tinyusb_dfu BOARD=nucleo-f767zi \
   make -C tests/shell PROGRAMMER=dfu-util riotboot/flash-slot1
   ```
   and check that the second application starts and is seen as upgradable:
   ```
   dfu-util --list
   ```
   
### Issues/PRs references

~Depends on PR #18983~

19149: SECURITY: Describe that declassification is an option r=benpicco a=chrysn

### Contribution description

Our security policy does not contain provisions for the case when what is reported is not what we consider an actual security issue. As it is described now, everything reported through security@ would go through the full treatment, including a point release.

I'm not sure it belongs into the text itself (as it's more about how security reporters interact with the project than internals), but declassification should IMO be backed at least by 3 maintainers, and no strong NACK.

### Issues/PRs references

#19141 followed that procedure after some chat on it on the maintainers channel. (In the discussion, I proposed declassification, with 2.5 people supporting it and one "I was about to, but can we be sure nobody is using it?" voice).

Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
Co-authored-by: chrysn <chrysn@fsfe.org>
2023-01-15 23:31:00 +00:00
Gunar Schorcht
5b543692cd cpu/nrf52: handling RIOTBOOT_LEN for tinyusb_dfu 2023-01-15 18:09:55 +01:00
Gunar Schorcht
c46545d5a7 cpu/common_cortex: handling RIOTBOOT_LEN for tinyusb_dfu 2023-01-15 18:09:55 +01:00
bors[bot]
c8d60a2d31
Merge #18763
18763: sys/tiny_strerror: add missing error codes r=benpicco a=maribu

### Contribution description

When double-checking the error codes provided by newlib by default (without magic defines, such as `__LINUX_ERRNO_EXTENSIONS__` or `__CYGWIN__`), some where still missing in `tiny_strerror()`. This adds the missing ones.

This in turn showed that three errno codes were missing in the avr-libc compat `errno.h`, which are added as well.

### Testing procedure

Murdock should double check that the added errno codes indeed are defined by default.

### Issues/PRs references

None

Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
2023-01-14 22:41:37 +00:00
Gunar Schorcht
f933fde60c cpu/esp32: don't initialize the UART pins if already initialized
To avoid garbage on reconfiguring the UART console pins, e.g. in initialization of the `arduino` module, pins that are already configured as UART pins must not be initialized.
2023-01-14 14:38:18 +01:00
Gunar Schorcht
3085b92e8f cpu/esp32: improve UART initialization
The TX line is set and temporarily configured as a pull-up open-drain output before configuring it as a push-pull output to avoid a several msec long LOW pulse resulting in some garbage.
2023-01-14 14:38:18 +01:00
Gunar Schorcht
fe21e82079 cpu/esp32: improve initialization of UART pins
Since PR #19100 it is possible to define:
- other pins for `UART_DEV(0)` than the default pins
- different `UART_DEV(0)` pins for the bootloader and RIOT
To allow correct reinitialization of the UART pins used by the bootloader as well as their usage for other purposes, the pin usage for the default UART0 pins and the UART pins used by the bootloader are reset to `_GPIO`. This is done in `uart_system_init` which has to be called earlier in the startup procedure.
2023-01-14 14:38:18 +01:00
Gunar Schorcht
9004867fe0 cpu/esp32/bootloader: fix the UART pin configuration 2023-01-14 14:27:56 +01:00
Gunar Schorcht
d5a28ecd02 cpu/esp32: reorder the syscalls_init
If LOG_LEVEL >= 4, such as in `tests/log_printfnoformat`, the ESP-IDF config function called for the GPIO pins of the UART will output the configuration with `printf` before the `_GLOBAL_REENT` structure is initialized. This causes a crash during system startup. Therefore the initialization by `syscalls_init` must be called earlier in the startup procedure.
2023-01-14 14:27:56 +01:00
bors[bot]
fb603f2660
Merge #18459 #18724 #19081 #19082 #19136
18459: makefiles/suit: make it possible to accept multiple SUIT keys r=miri64 a=benpicco



18724: nanocoap_sock: implement DTLS socket r=miri64 a=benpicco



19081: sys/stdio_udp: add stdio over UDP r=benpicco a=benpicco



19082: core/init: add early_init() r=benpicco a=benpicco



19136: CI: re-add "synchronize" event to check-labels r=miri64 a=kaspar030



Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
Co-authored-by: Benjamin Valentin <benjamin.valentin@bht-berlin.de>
Co-authored-by: Kaspar Schleiser <kaspar@schleiser.de>
2023-01-13 13:50:55 +00:00
Benjamin Valentin
81625fd5f2 doc: sort all stdio implementations into sys_stdio group 2023-01-13 11:08:22 +01:00
bors[bot]
89ef35f9c6
Merge #19050
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>
2023-01-13 00:51:31 +00:00
Marian Buschsieweke
b0ee095051
cpu/avr8_common/avr_libc_extra: add missing errno codes
Three standard POSIX errno codes somehow slipped through the cracks.
This adds the missing ones.
2023-01-12 08:39:30 +01:00
Marian Buschsieweke
c78c0056ea
boards/common/cc26xx_cc13xx: Fix flashing with upstream OpenOCD
This adds a work around that allows flashing with upstream OpenOCD,
most of the time.
2023-01-10 22:39:35 +01:00
Gunar Schorcht
9eff2958ee cpu/esp32: fix TOC in doc.txt regarding toolchain settings 2023-01-10 22:29:02 +01:00
Benjamin Valentin
913d72cb99 socket_zep: don't discard frames if not in RX mode 2023-01-10 17:36:30 +01:00
Benjamin Valentin
3dedfb7a17 socket_zep: only report size of single datagram 2023-01-10 17:36:30 +01:00
Benjamin Valentin
8a80e70e5e cpu/native: syscalls: provide real_recv() 2023-01-10 14:24:16 +01:00
bors[bot]
bb708e2f9c
Merge #19109
19109: cpu/gd32v: fix and extend Kconfig clock settings r=benpicco a=gschorcht

### Contribution description

This PR fixes the following issus of the clock configuration which led to highly deviating peripheral clocks so that the UART interface was not usable in my case:

1. Setting the `RCU_CTL` register just to the IRC8M bit also removes the IRC8M calibration and trim adjust value in this register. Therefore IRC8M calibration and trim adjust value have to be preserved and the IRC8M has to be set.
2. `CLOCK_HXTAL` is a value and not a flag, so that shifting to the left changes anything in the register but does not set the PLLSEL bit. `RCU_CFG0_PLLSEL_Msk` has to be used instead to set the PLLSEL bit.
3. `CONFIG_BOARD_HAS_HXTAL` is used to indicate that the board has an HXTAL connected. If the HXTAL is present, it is used as PLL clock source. But if the HXTAL is not present, the half IRC8M clock should be used as PLL clock source and must not be disabled at the end of clock settings. Using IRC8M clock as PLL clock source also requires another PLL multiplication factor.

Issues 1 and 2 led to the problem that IRC8M was used without calibration instead of HXTAL. With the fixes, the GD32V is working with as well as without HXTAL correctly.

Furthermore, the Kconfig configuration has been extended. It is now possible to configure the HXTAL frequency as well, since the GD32VF103 allows HXTAL clocks from 3 MHz to 25 MHz. This has currently been added directly to the board's Kconfig, as it is currently the only GD32VF103 board. It should be moved to a common Kconfig later when more GD32V boards are added.

### Testing procedure

`BOARD=seeedstudio-gd32 make -C tests/shell flash term` should still work.

### Issues/PRs references


Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-01-09 21:06:17 +00:00
Gunar Schorcht
72d11d84b8 boards/seeedstudio-gd32: extend Kconfig by clock configuration
The configuration whether a HXTAL is present and what its clock frequency is will be added to Kconfig. Since it is the only GD32V board at the moment, the configuration is added to the Kconfig of the board, but should be moved to a common Kconfig later when more GD32V boards are added.
2023-01-09 21:51:54 +01:00
bors[bot]
e2538a898a
Merge #19076
19076: boards/hip-badge: add HiP Badge board definition r=maribu a=benpicco



Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de>
2023-01-09 13:33:40 +00:00
Benjamin Valentin
55b5c47bc8 cpu/esp32: add stdio_usb_serial_jtag 2023-01-09 00:51:27 +01:00
Marian Buschsieweke
525751c33b
cpu/riscv_common/periph_timer: Fix timer_clear()
Previously, timer_clear() was a no-op, resulting in spurious IRQs from
already canceled timeouts. This fixes the issue.
2023-01-09 00:08:59 +01:00
Benjamin Valentin
59f067171f core/init: call vfs_bind_stdio() in early_init() 2023-01-08 22:26:13 +01:00
Benjamin Valentin
124b849503 cpu: call early_init() 2023-01-08 22:26:12 +01:00
Gunar Schorcht
f4d6b2d642 cpu/gd32v: fix clock setting
`CONFIG_BOARD_HAS_HXTAL` is used to indicate that the board has an HXTAL connected. If the HXTAL is present, it is used as PLL clock source. But if the HXTAL is not present, the half IRC8M clock should be used as PLL clock source and must not be disabled at the end of clock settings. Using IRC8M clock as PLL clock source also requires another PLL multiplication factor.
2023-01-08 11:32:28 +01:00
Gunar Schorcht
e4010f7445 cpu/gd32v: fix clock setting
`CLOCK_HXTAL` is a value and not a flag, so that shifting to the left changes anything in the register but does not set the PLLSEL bit. `RCU_CFG0_PLLSEL_Msk` has to be used instead to set the PLLSEL bit.
2023-01-08 10:42:01 +01:00
Gunar Schorcht
dd0593a3c8 cpu/gd32v: fix clock setting
Setting the `RCU_CTL` register just to the IRC8M bit also removes the IRC8M calibration and trim adjust value in this register. Therefore IRC8M calibration and trim adjust value have to be preserved and the IRC8M has to be set.
2023-01-08 10:42:01 +01:00
bors[bot]
441b69964c
Merge #19106
19106: core/lib: Add macros/utils.h header r=aabadie a=maribu

### Contribution description

The macros CONCAT(), MIN(), and MAX() are defined over and over again in RIOT's code base. This de-duplicates the code by moving the macros to a common place.

### Testing procedure

Generated binaries don't change, as this only a de-duplication of macros that doesn't change their definition.

### Issues/PRs references

None

Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
2023-01-07 21:16:51 +00:00
Gunar Schorcht
32168da8d6 cpu/esp32: add flashpage support
f
2023-01-07 14:49:36 +01:00
Gunar Schorcht
80833a74e8 cpu/esp32: add flashpage support to linker scripts 2023-01-07 10:38:52 +01:00
Gunar Schorcht
6f9c64c6cb cpu/esp32: add flashpage support to Kconfig 2023-01-07 10:38:52 +01:00
Gunar Schorcht
f4c0d7da71 cpu/esp32: add flashpage definitions in CPU config 2023-01-07 10:38:52 +01:00
Marian Buschsieweke
86fdbd7054
core/lib: Add macros/utils.h header
The macros CONCAT(), MIN(), and MAX() are defined over and over again in
RIOT's code base. This de-duplicates the code by moving the macros to a
common place.
2023-01-07 09:47:44 +01:00
bors[bot]
4f1bb12720
Merge #18752 #19100 #19104
18752: nanocoap_sock: deprecate nanocoap_get() r=benpicco a=benpicco





19100: cpu/esp_common: allow configuration of UART0 r=benpicco a=gschorcht

### Contribution description

This PR
- fixes the issue for ESP32 SoCs that UART0 signals can't be routed to arbitrary GPIOs and
- allows the configuration of the UART device used by the bootloader.

The UART interface and its configuration used by the STDIO are defined in RIOT using the define `STDIO_UART_DEV` and the configuration of the corresponding UART device in `periph_conf.h`. 

However, the bootloader compiled directly in ESP-IDF uses its own definitions `CONFIG_ESP_CONSOLE_UART_*` for the UART configuration. To be able to use a consistent UART configuration in RIOT and the bootloader, e.g. to see the output of the 2nd stage bootloader, these `CONFIG_ESP_CONSOLE_UART_*` can be defined via a set of KConfig variables in RIOT (not yet implemented in Kconfig):
- `CONSOLE_CONFIG_UART_NUM` defines the UART device to be used by the bootloader and by `STDIO_UART_DEV`
- `CONSOLE_CONFIG_UART_RX` and `CONSOLE_CONFIG_UART_TX` define the GPIOs to be used by the bootloader and should be the GPIOs as defined in `periph_conf.h` for the corresponding UART device.

### Testing procedure

Any ESP32 node should still work with `stdio_uart` and the default configuration. To test an alternative configuration, use
```
CFLAGS='-DUART1_TXD=5 -DUART1_RXD=4 -DCONFIG_CONSOLE_UART_NUM=1 -DCONFIG_CONSOLE_UART_TX=5 -DCONFIG_CONSOLE_UART_RX=4' USEMODULE=esp_log_startup BOARD=esp32-wroom-32 make -C tests/shell flash
```
The bootloader output and the STDIO should be routed to UART1 at GPIO4 and GPIO5.

### Issues/PRs references

Prerequisite for PR ##18863

19104: tests/periph_uart: only exclude STDIO_UART_DEV if stdio_uart is used 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: Benjamin Valentin <benjamin.valentin@bht-berlin.de>
2023-01-06 21:15:36 +00:00
Gunar Schorcht
7230299575 cpu/esp32: use same UART device in stdio_uart and bootloader 2023-01-06 16:43:51 +01:00
Gunar Schorcht
623660b399 cpu/esp32/bootloader: allow config of UART console
The UART interface and its configuration as used by the STDIO is defined in RIOT using `STDIO_UART_DEV` and the UART configuration in `periph_conf.h`.

However, the bootloader compiled directly in ESP-IDF uses its own definitions `CONFIG_ESP_CONSOLE_UART_*` for the UART configuration. To be able to use a consistent UART configuration in RIOT and the bootloader, e.g. to see the output of the 2nd stage bootloader, these `CONFIG_ESP_CONSOLE_UART_*` can be defined via a set of KConfig variables `CONSOLE_CONFIG_UART_*`. Here the variable `CONSOLE_CONFIG_UART_NUM` is then also used as `STDIO_UART_DEV` and the variables `CONSOLE_CONFIG_UART_RX` and `CONSOLE_CONFIG_UART_TX` of the configuration in `periph_conf.h` should be used accordingly.
f
2023-01-06 16:43:51 +01:00
Gunar Schorcht
fb8d521ac6 cpu/esp_common: allow configuration of UART0 2023-01-06 16:43:51 +01:00
Gunar Schorcht
8b34d547ac cpu/esp32: fix SDK configuration for USB PHY
When using USB Serial/JTAG/OTG/CDC, USB should be enabled in `phy_init`, otherwise USB interface is not working properly.
2023-01-06 12:30:11 +01:00
bors[bot]
256da8e9b5
Merge #18869
18869: cpu/sam0_common/periph: Fix compilation with LLVM  r=benpicco a=Teufelchen1

Related to #18851 

This fixes an unused function error when compiling the gnrc_networking_mac example using LLVM as toolchain.
The fix works by only including the function when it is actually needed.


Co-authored-by: Teufelchen1 <bennet.blischke@haw-hamburg.de>
2023-01-05 16:17:53 +00:00
bors[bot]
e35c7adb73
Merge #19031
19031: cpu/stm32/periph_timer: implement timer_set() r=benpicco a=maribu

### Contribution description

The fallback implementation of timer_set() in `drivers/periph_common` is known to fail on short relative sets. This adds a robust implementation.

### Testing procedure

Run `tests/periph_timer_short_relative_set` at least a few dozen times (or use https://github.com/RIOT-OS/RIOT/pull/19030 to have a few dozen repetitions of the test case in a single run of the test application). It should now succeed.

### Issues/PRs references

None

Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
2023-01-04 19:04:26 +00:00
Marian Buschsieweke
94f9a56125
cpu/qn908x/periph_timer: Implement timer_set()
This fixes test failures in tests/periph_timer_short_relative_set.

Note: This differs a bit from the implementation in e.g. nRF5x or STM32
in that it always briefly pauses the timer. The issue is that when
running the timer can take a few ticks to actually react to the new
compare target. So even if the previously written target is still in
the future, the timer may not fire anyway. Pausing the timer while
setting and setting the target at least one higher than the current
count reliably triggers the IRQ.
2023-01-03 22:35:11 +01:00
Marian Buschsieweke
b8cc222e76
cpu/stm32/periph_timer: implement timer_set()
The fallback implementation of timer_set() in `drivers/periph_common`
is known to fail on short relative sets. This adds a robust
implementation.
2023-01-03 15:51:06 +01:00
bors[bot]
f7ef90d213
Merge #19074
19074: cpu/esp8266: build the SDK bootloader from source r=benpicco a=gschorcht

### Contribution description

This PR is a takeover of PR #17043, which is rebased to the current master and includes some corrections that became necessary after rebasing.

**Copied from description of PR #17043:**

We had four versions of pre-built bootloaders for the esp8266 with different settings of logging and color logging. These bootloaders were manually built from the SDK and shipped with RIOT-OS source code. However there are more settings that affect the bootloader build that are relevant to the app or final board that uses this bootloader. In particular, flash size and flash speed is important for the bootloader to be able to load an app from a large partition table at the fastest speed supported by the board layout and flash chip.

Another example is the UART baudrate of the logging output from the bootloader. The boot ROM will normally start at a baud rate of 74880 (depending on the crystal installed), so it might make sense to keep the UART output at the same speed so we can debug boot modes and bootloader with the same terminal.

This patch builds the `bootloader.bin` file from the ESP8266 SDK source code. The code is built as a module (`esp8266_bootloader`) which at the moment doesn't generate any object code for the application and only produces a `bootloader.bin` file set to the `BOOTLOADER_BIN` make variable for the `esptool.inc.mk` to flash.

The code needs to be compiled and linked with custom rules defined in the module's Makefile since the `bootloader.bin` is its own separate application.

The `BOOTLOADER_BIN` variable is changed from a path relative to the `$(RIOTCPU)/$(CPU)/bin/` directory to be full path. This makes it easier for applications or board to provide their own bootloader binary if needed.

As a result of building the bootloader from source we fixed the issue of having a large partition table.

### Testing procedure

Use following command to flash the application with STDIO UART baudrate of 115200 baud.
```
BAUD=74880 USEMODULE=esp_log_startup make -C tests/shell BOARD=esp8266-esp-12x flash
```
Connect with a terminal programm of your choice (unfortunatly `picocom` and `socat` don't support a baudrate close to 74880), for example:
```
python -m serial.tools.miniterm /dev/ttyUSB0 74880
```
On reset, the `esp8266-esp-12x` node shows the ROM bootloader log output
```
 ets Jan  8 2013,rst cause:2, boot mode:(3,7) 

load 0x40100000, len 6152, room 16 
tail 8
chksum 0x6f
load 0x3ffe8008, len 24, room 0 
tail 8
chksum 0x86
load 0x3ffe8020, len 3408, room 0 
tail 0
chksum 0x79
```
as well as the second-stage bootloader built by this PR (`ESP-IDF v3.1-51-g913a06a9ac3`) at 74880 baudrate.
```
I (42) boot: ESP-IDF v3.1-51-g913a06a9ac3 2nd stage bootloader
I (42) boot: compile time 11:25:03
I (42) boot: SPI Speed      : 26.7MHz
...
I (151) boot: Loaded app from partition at offset 0x10000
```
The application output is seen as garbage since the `esp8266-esp-12x` uses 115200 as baurate by default.

To see all output at a baudrate of 74880 baud, you can use the following command:
```
CFLAGS='-DSTDIO_UART_BAUDRATE=74880' BAUD=74880 USEMODULE=esp_log_startup make -C tests/shell BOARD=esp8266-esp-12x flash
```

If the application is built without options, the ROOM bootloader output will be 74880 baud and the second stage bootloader and application output will be 115200 baud.

### Issues/PRs references

Fixes issue #16402

Co-authored-by: iosabi <iosabi@protonmail.com>
Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-01-03 00:44:24 +00:00
bors[bot]
6b4b7542eb
Merge #19078
19078: cpu/esp32: define FLASHFILE_POS r=benpicco a=gschorcht

### Contribution description

Instead of using a fixed position of the image file in the flash, the variable `FLASHFILE_POS` is used which allows to override the default position of the image in the flash at 0x10000.

This PR is a prerequisite for the `periph_flashpage` implementation PR #19079.

### Testing procedure

Flashing a ESP32x SoC should work with `FLASHFILE_POS=0x20000`, for example:
```
USEMODULE=esp_log_startup FLASHFILE_POS=0x20000 BOARD=esp32-wroom-32 make -j8 -C tests/shell flash
```
The bootloader output should give `00020000` as offset for the `factory` partition
```
I (75) boot: Partition Table:
I (78) boot: ## Label            Usage          Type ST Offset   Length
I (84) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (91) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (97) boot:  2 factory          factory app      00 00 00020000 000199b0
I (104) boot: End of partition table
```
and
```
I (125) esp_image: segment 0: paddr=00020020 vaddr=3f400020 size=02140h (  8512) map
```
during the load of the image.

### Issues/PRs references

Prerequisite for PR #19079

Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-01-02 18:18:19 +00:00
bors[bot]
821acbe6fb
Merge #19077
19077: cpu/esp32: configurable linker scripts r=benpicco a=gschorcht

### Contribution description

This PR provides configurable linker scripts for ESP32x SoCs.

Using the vendor `memory.ld.in` file and a `sections.ld.in` file instead of the static versions of these files, from which the actual used `memory.ld` and  `sections.ld` are generated using the C preprocessor, allows to use the configuration in `sdkconfig.h` as well as Kconfig to define a custom memory layout. For example, it is no longer necessary to maintain different `memory.ld` files for the ESP32 BLE module, since the memory layout is now defined from the values of the configuration.

Note for the review: The `memory.ld.in` files are now simply copies of the manufacturer's `memory.ld.in` files. However, it is not possible to use the vendor's `memory.ld.in` files directly, because they have to be extended further on, e.g. for the `periph_flashpage` implementation.

This PR is prerequisite for the `periph_flashpage` support in PR #19079.

### Testing procedure

Green CI.

### Issues/PRs references

Prerequisite for PR #19079

Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-01-02 04:56:58 +00:00
Gunar Schorcht
8381cd3633 cpu/esp32: using configurable linker scripts in makefiles 2022-12-31 16:03:46 +01:00
Gunar Schorcht
409e609f46 cpu/esp32x: generate section.ld from section.ld.in
Using `sectoins.ld.in` instead of a static `sections.ld`, from which the actual used `sections.ld` is generated with the C preprocessor, allows to use the configuration in `sdkconfig.h` as well as Kconfig to use a custom section layout.
2022-12-31 15:30:34 +01:00
Gunar Schorcht
dc2dc801cc cpu/esp32x: generate memory.ld from vendor memory.ld.in
Using the vendor `memory.ld.in` instead of a static `memory.ld`, from which the actual used `memory.ld` is generated with the C preprocessor, allows to use the configuration in `sdkconfig.h` as well as Kconfig to use a custom memory layout. For example, it is no longer necessary to maintain different `memory.ld` files for the ESP32 BLE module, since the memory layout is now defined from the values of the configuration.
2022-12-31 15:30:34 +01:00
Gunar Schorcht
a0715b281b cpu/esp32: export FLASH_SIZE to SDK configuration 2022-12-31 14:10:57 +01:00
Gunar Schorcht
f23b20f91f cpu/esp: use FLASHFILE_POS for image position in flash
Instead of using a fixed position of the image file in the flash, the variable `FLASHFILE_POS` is used which allows to override the default position of the image in the flash at 0x10000.
2022-12-31 14:10:57 +01:00
bors[bot]
11d81d28f4
Merge #19064
19064: native: Remove code used for __MACH__ target r=benpicco a=Teufelchen1

### Contribution description

This PR removes code that was used to support macOS as native target. 
macOS / `__MACH__` is no longer supported by RIOT on master.

### Testing procedure

If murdock is happy, that should be enough.


Co-authored-by: Teufelchen1 <bennet.blischke@haw-hamburg.de>
2022-12-27 20:41:23 +00:00
Marian Buschsieweke
a8f1a7e007
cpu/nrf5x_common: Implement timer_set()
The fallback implementation of timer_set() in `drivers/periph_common`
is known to fail on short relative sets. This adds a robust
implementation.
2022-12-23 14:48:08 +01:00
Marian Buschsieweke
0a24d54bd5
cpu/nrf5x_common/periph_timer: Fix thread safety
Two threads using distinct sets of channels should be able to share a
timer. Hence, we need to make read-modify-write accesses on timer state
atomic.
2022-12-23 14:45:12 +01:00
Marian Buschsieweke
3ad897df2a
cpu/nrf5x_common/periph_timer: Clear periodic flag on set
A call to timer_set_absolute() should clear the periodic flag on the
specified timer and channel. This adds it.
2022-12-23 14:45:12 +01:00
Teufelchen1
c9e9a8d2f1 native: Remove code used for __MACH__ target 2022-12-22 17:57:25 +01:00
Gunar Schorcht
4f1b4ba0c9 cpu/esp_common: remove double defines from Makefile 2022-12-22 12:18:34 +01:00
iosabi
073b2209da cpu/esp8266: Build the SDK bootloader from source.
We had four versions of pre-built bootloaders for the esp8266 with
different settings of logging and color logging. These bootloaders were
manually built from the SDK and shipped with RIOT-OS source code.
However there are more settings that affect the bootloader build that
are relevant to the app or final board that uses this bootloader. In
particular, flash size and flash speed is important for the bootloader
to be able to load an app from a large partition table at the fastest
speed supported by the board layout and flash chip.

Another example is the UART baudrate of the logging output from the
bootloader. The boot ROM will normally start at a baud rate of 74880
(depending on the crystal installed), so it might make sense to keep
the UART output at the same speed so we can debug boot modes and
bootloader with the same terminal.

This patch builds the bootloader.bin file from the ESP8266 SDK source
code. The code is built as a module (esp8266_bootloader) which at the
moment doesn't generate any object code for the application and only
produces a bootloader.bin file set to the BOOTLOADER_BIN make variable
for the esptool.inc.mk to flash.

The code needs to be compiled and linked with custom rules defined in
the module's Makefile since the bootloader.bin is its own separate
application.

The `BOOTLOADER_BIN` variable is changed from a path relative to the
`$(RIOTCPU)/$(CPU)/bin/` directory to be full path. This makes it easier
for applications or board to provide their own bootloader binary if
needed.

As a result of building the bootloader from source we fixed the issue of
having a large partition table. Fixes #16402.
2022-12-22 12:18:34 +01:00
Teufelchen1
2629e81b3b cpu/sam0_common/periph: Fix compilation with LLVM 2022-12-19 15:19:51 +01:00
bors[bot]
f539035c86
Merge #18756
18756: drivers/usbdev_synopsys_dwc2: add EFM32 support r=chrysn a=gschorcht

### Contribution description

This PR provides the changes for the Synopsys USB OTG IP core DWC2 driver for EFM32 MCUs. It also provides the changes of the board definition for `stk3600` and `stk3700` for testing.

### Testing procedure

`tests/usbus_hid` should work on the EFM32 boards `stk3600` (EFM32LG family) and `stk3700` (EFM32GG family).

It is already tested for a `sltb009a` board (EFM32GG12 family).

### Issues/PRs references


Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2022-12-19 12:55:57 +00:00
Benjamin Valentin
a9120a38ca cpu/lm4f120: remove stdlib include 2022-12-14 00:22:02 +01:00
Benjamin Valentin
aa376f05c0 cpu/arm7_common: drop cyclic include 2022-12-13 15:55:17 +01:00
Joakim Nohlgård
b3d04d8270 riscv: Reduce reset trampoline code size by 2 bytes
`addi` with 20 bit immediate does not have a compressed representation,
so using `jalr` with immediate offset uncompressed is smaller than using
`addi`+`c.jr`
2022-12-08 13:26:07 +01:00
Gunar Schorcht
c6bae0b4bf cpu/efm32: increase RIOTBOOT_LEN for riotboot_dfu 2022-12-07 16:38:51 +01:00
Gunar Schorcht
4f47dc13fe cpu/efm32: add CPU_FAM_EFM32xx define 2022-12-07 16:38:51 +01:00
Gunar Schorcht
dd6c46e289 cpu/efm32: fix PM configuration
`cpu/cortexm_common/include/cpu.h` has to be included in `cpu/efm32/periph_cpu.h` so that `PROVIDES_PM_SET_LOWEST` is defined if only `periph_cpu.h` is included. Otherwise `pm_set_lowest` is defined multiple times if the `pm_layered` module is not used. `PROVIDES_PM_OFF` has to be defined in case `pm_layered` is not used, e.g. in riotboot.
2022-12-07 16:38:51 +01:00
Gunar Schorcht
6d233f1308 cpu/efm32: enable usbdev_synopsys_dwc2 driver as periph_usbdev 2022-12-07 16:34:34 +01:00
Gunar Schorcht
6146a3ea91 cpu/efm32: add support for Synopsys USB OTG FS IP core 2022-12-07 16:34:34 +01:00
Antonio Galea
ee76e21c33 sam0_common: use size_t len for I2C transfers, as declared (fixes #19008) 2022-12-04 16:57:00 +01:00
Marian Buschsieweke
0d85356180
cpu/qn908x: use bitarithm_test_and_clear() & fix cb
Previously, the callback was incorrectly passed a channel of zero as
argument regardless of the channel that triggered the IRQ. This fixes
the issue and also uses `bitarithm_test_and_clear()` to only iterate
over the channels that actually have an IRQ flag set, rather than
all channels.
2022-11-28 16:43:24 +01:00
Marian Buschsieweke
c95028655d
cpu/qn909x/periph_timer: make clangd happy
The linter was unhappy that `unsinged long` and `uint32_t` were used
inconsistency (in the `timer_init()` declaration, implementation, as
well as in the `DEBUG()` format specifiers).
2022-11-28 16:43:24 +01:00
Marian Buschsieweke
476dca2e8f
Merge pull request #18978 from maribu/cpu/atmega_common/periph_timer/spurious_irqs
cpu/atmega_common/periph_timer: fix spurious IRQs
2022-11-26 16:29:18 +01:00
benpicco
1a73fb0593
Merge pull request #18795 from benpicco/irq-track
debug_irq_disable: add module to debug time spent in irq_disable
2022-11-25 19:10:10 +01:00
Marian Buschsieweke
787884aa95
cpu/atmega_common/periph_timer: fix spurious IRQs 2022-11-25 14:46:16 +01:00
f1a8e1f636
Merge pull request #18970 from maribu/cpu/nrf5x_common/periph_timer/fix_spurious_irqs
cpu/nrf5x_common/periph_timer: fix spurious IRQs
2022-11-25 08:23:34 +01:00
Marian Buschsieweke
c89c75dbc9
Merge pull request #18971 from maribu/cpu/esp
cpu/esp{32,8266}/periph_timer: allow changing callback or freq
2022-11-25 08:22:26 +01:00
Marian Buschsieweke
03b7fe8f0c
cpu/esp8266/periph_timer: allow changing callback or freq
Allow multiple calls to timer_init(), as this is the only way to
change the timer frequency or the callback function.
2022-11-24 22:39:49 +01:00
Marian Buschsieweke
e8fd65566a
cpu/esp32/periph_timer: allow changing callback or freq
Allow multiple calls to timer_init(), as this is the only way to
change the timer frequency or the callback function.
2022-11-24 22:38:15 +01:00
Marian Buschsieweke
fbd7b77331
cpu/nrf5x_common/periph_timer: fix spurious IRQs 2022-11-24 22:36:42 +01:00
Marian Buschsieweke
20fc71dd65
cpu/stm32/periph_timer: fix spurious IRQs 2022-11-24 22:34:10 +01:00
Marian Buschsieweke
93c5755649
cpu/stm32/periph_timer: fix race conditions
Allow two threads to share the same timer - provided they use distinct
sets of timer channels - without occasionally corrupting registers or
state flags.
2022-11-24 22:34:03 +01:00
Benjamin Valentin
59a3e613fe cpu/cortexm_common: measure time spent with IRQ disabled 2022-11-24 21:27:20 +01:00
Marian Buschsieweke
020c6ff69c
Merge pull request #18954 from jue89/fix/nrf5x-uart-lowpower
cpu/nrf5x/uart: run STOPTX task after finished tx
2022-11-24 14:20:58 +01:00
Juergen Fitschen
a6ff838a4b
Merge pull request #18933 from jue89/feature/cpu_efm32_series_2_adc
cpu/efm32: add periph_adc support for Gecko Series 2
2022-11-24 11:32:56 +01:00
benpicco
86d72c7b85
Merge pull request #18940 from krzysztof-cabaj/nucleo-l496zg-ADC
boards/nucleo-l496zg: add ADC support
2022-11-23 20:34:08 +01:00
Marian Buschsieweke
cefef8fd1e
Merge pull request #18953 from jue89/fix/nrf5x-timer-lowpower
cpu/nrf5x/timer: fix high current consumption in powered off state
2022-11-23 17:03:33 +01:00
Marian Buschsieweke
232c70ba53
Merge pull request #18948 from maribu/boards/common/nrf52
boards/common/nrf52: fix timer config
2022-11-23 10:47:26 +01:00
Jue
3da1faca90 cpu/nrf5x/uart: run STOPTX task after finished tx
This reduces power consumption for UARTs that are configured in tx-only mode.
2022-11-22 21:33:14 +01:00
Jue
a7e2182bb0 cpu/nrf5x/timer: run task SHUTDOWN instead of STOP
This is a workaround for errata 78 that causes increased current consumption even in the stopped state.
2022-11-22 19:15:31 +01:00
Juergen Fitschen
97bc8252d9
Merge pull request #18920 from jue89/fix/sam0_rtt_rtc
sam0/rtc_rtt: optimizations to get around the painful long syncwaits
2022-11-22 18:12:06 +01:00
Juergen Fitschen
18e9167c73 cpu/efm32/adc: add support for Gecko Series 2
Series 2 features IADCs instead of ADCs.
2022-11-22 14:44:56 +01:00
Marian Buschsieweke
b533fcf543
cpu/nrf5x_common: improve doc on timer_conf_t::channels 2022-11-22 13:43:05 +01:00
Jue
2a81a2ab5c cpu/efm32: provide periph_uart_modecfg feature for every board 2022-11-21 23:20:19 +01:00
Jue
80b491d7dd cpu/efm32/uart: add modecfg support for Gecko Series 2 2022-11-21 23:17:52 +01:00
krzysztof-cabaj
afbb568306 cpu/stm32/l4: add ADC support for l496zg 2022-11-21 05:52:02 -05:00
Marian Buschsieweke
6b759c2a7d
Merge pull request #18935 from benpicco/makefiles/gnu-version
makefiles/gnu.inc.mk: set flags based on compiler version
2022-11-20 08:11:57 +01:00
Benjamin Valentin
b30efeeb65 makefiles/gnu.inc.mk: set flags based on compiler version 2022-11-19 23:14:54 +01:00
Benjamin Valentin
dd5c876034 cpu/native: replace RIOT_FILE_RELATIVE with __FILE__ 2022-11-19 01:48:42 +01:00
Benjamin Valentin
8777584ac8 cpu/lpc23xx: core: replace RIOT_FILE_RELATIVE with __FILE__ 2022-11-19 01:48:42 +01:00
benpicco
e1aa925c35
Merge pull request #18913 from benpicco/macro-prefix-map
makefiles/cflags.inc.mk: don't include absolute path in __FILE__ macro
2022-11-18 16:43:35 +01:00
benpicco
2f122769c3
Merge pull request #18921 from benpicco/cpu/stm32-bkup_heap
cpu/stm32: add unused backup RAM as extra heap
2022-11-18 15:48:36 +01:00
Benjamin Valentin
6f05daceb3 cpu/stm32: add unused backup RAM as extra heap 2022-11-18 12:19:10 +01:00
Gunar Schorcht
4b7578b2eb pkg/tinyusb: fix USB speed selection for STM32 2022-11-17 14:07:38 +01:00
Juergen Fitschen
268bdfec29 sam0/rtc_rtt: don't block until set_alarm has been propagated to periph
rtc_set_alarm() / rtt_set_alarm() are heavily used by ztimer during ISR. This will reduce time spent during ISR drastically. We trust that the peripheral is able to propagate the alarm asynchronously.
2022-11-16 17:02:19 +01:00
Juergen Fitschen
9c6f07f80a sam0/rtc_rtt: optimize pm_unblock/pm_block ping-pong during set alarm 2022-11-16 16:54:29 +01:00
benpicco
b33688dec4
Merge pull request #18919 from gschorcht/cpu/stm32/fix_ram_len_stm32f4{2,3}{7,9}
cpu/stm32: fix RAM_LEN for F427, F429, F437, F439 models
2022-11-16 11:32:13 +01:00
Gunar Schorcht
7b99a5152f cpu/stm32: fix RAM_LEN for F427, F429, F437, F439 models
These models have 256 kByte RAM, but the upper 64 kByte are used as CCM data RAM accessible at 0x1000:0000. The access to 0x2003:xxxx leads to a hard fault.
2022-11-15 22:29:34 +01:00
Benjamin Valentin
5b359108f7 cpu/esp8266: blacklist -fmacro-prefix-map
This requires at least GCC 8
2022-11-15 20:39:49 +01:00
Marian Buschsieweke
35149bd1c2
Merge pull request #18797 from MrKevinWeiss/pr/fixstmclk
cpu/stm32: Fix stm clock configuration
2022-11-15 11:39:25 +01:00
Benjamin Valentin
0bd67d98d9 cpu: always rely on stdio.inc.mk for default stdio selection 2022-11-09 10:42:47 +01:00
benpicco
8559472179
Merge pull request #18821 from jue89/feature/saml21_pheriph_pm
cpu/saml21: add interaction with pm_layered for peripheral drivers
2022-11-07 19:53:57 +01:00
benpicco
384e3ca534
Merge pull request #18847 from krzysztof-cabaj/nucleo-f207zg-ADC
boards/nucleo-f207zg:  support for ADC
2022-11-05 01:55:30 +01:00
krzysztof-cabaj
aa426bd3aa cpu/stm32/f2: add ADC support for f207zg 2022-11-04 18:02:28 -04:00
Jue
73e6886b2c cpu/saml21: define required power modes
We can get rid initially blocked pm modes \o/
2022-11-03 14:53:45 +01:00
Jue
24461b43f8 cpu/sam0/spi: generalize pm_layered interaction
In DMA mode SPI transfers are carried out by HW. We need to block certain pm modes during transfer.
2022-11-03 14:53:44 +01:00
Jue
db9263eeca cpu/sam0/rtc_rtt: integrate pm_layered 2022-11-03 14:53:43 +01:00
Jue
cc4e880aa8 cpu/sam0/rtc: remove overflow IRQ
Due to the RIOT_EPOCH of 2020 this overflow will happen in year 2084. It would be scary if IoT devices are still around then.

We can save RAM and ROM. Furthermore, this overflow handling should block BACKUP power mode in order to keep track of the reference year.
2022-11-03 14:52:38 +01:00
Jue
5866262122 cpu/sam0/usbdev: generalize pm_layered interaction
periph_cpu.h should define the required pm modes.
Additionally, some CPUs require a certain pm mode in USB IDLE mode.
2022-11-03 14:27:47 +01:00
Jue
220be1da7e cpu/sam0/gpio: integrate pm_layered 2022-11-03 14:27:47 +01:00
Jue
ae9190da30 cpu/sam0/uart: integrate pm_layered 2022-11-03 14:27:47 +01:00
Jue
aa5ad12f37 cpu/sam0/uart: skip uart_write() if uart isn't active
Otherwise we get stuck in an endless loop ...
2022-11-03 14:27:47 +01:00
Jue
cf5e207d62 cpu/sam0/uart: enable peripheral clock before accessing regs 2022-11-03 14:27:47 +01:00
Jue
4f25c1017d cpu/sam0/timer: integrate pm_layered 2022-11-03 14:27:47 +01:00
Gunar Schorcht
31efa61eda cpu/stm32: improvement of USB driver selection
There are STM32 families where all models use only the Synopsys DWC2 USB OTG core while others completely use only the USB Device FS core. For these families then either the driver `drivers/usbdev_synopsys_dwc2` or the driver `cpu/stm32/periph/usbdev` is used depending on the respective family. However, the STM32 families F1 and L4 use both cores. The correct driver must therefore be selected depending on the CPU line or CPU model.
2022-11-03 13:52:01 +01:00
MrKevinWeiss
28aed3cb97
cpu/stm32/kconfig: rework clock tree
This splits up the clock configs.
It allows CPU_FAM based file sourcing and also common CPU_FAMs.
The dependancies are also included in wildcards would be used for the CPU_FAM macro.
This should be much more readable.
This also takes into account the HSE speeds in order to match the make/header resolution.
Some hidden symbols were added to make sorting many CPU_SERIES dependencies easier.
2022-11-03 11:37:33 +01:00
MrKevinWeiss
ba4843b5f4
cpu/stm32/Kconfig: Fix help indent 2022-11-03 11:37:32 +01:00
MrKevinWeiss
641d539092
cpu/stm: Fix clock settings F303* 2022-11-03 11:37:31 +01:00
MrKevinWeiss
17cce015d4
treewide/stm32: Make CLOCK_HS* configurable 2022-11-03 11:37:28 +01:00
Gunar Schorcht
ccbb304eae
Merge pull request #18814 from jue89/fix/efm32_series2_timer
cpu/efm32/timer_series2: fix interaction with pm_layered
2022-11-02 16:30:13 +01:00
Jon-Mailes Graeffe
b0686ce4dd cpu/esp32: set bootloader XTAL frequency configuration to automatic 2022-11-01 03:22:38 +01:00
Jue
75295df810 cpu/saml21/pm: allow blocking IDLE mode 2022-10-31 22:18:00 +01:00
Jue
d0c11e568a cpu/saml21/pm: specify power mode names 2022-10-31 22:18:00 +01:00
krzysztof-cabaj
f82f856c63 cpu/cc26xx_cc13xx: remove broken HTML links and headings from doc 2022-10-28 08:57:17 -04:00
Jue
54e915e40d cpu/efm32/timer_series2: sync STATUS register
Make sure the STATUS register has been synced between the different clock domains.

Especially the LETIMER needs some time to update the STATUS register after it has been enabled. If the LETIMER is started and stopped with just a short delay, pm_layered gets confused because the timer seems to be inactive ...
2022-10-28 11:34:55 +02:00
Jue
e6d18af3ad cpu/efm32/timer_series2: fix timer_start() interaction with pm_layered
The timer hasn't been enabled yet, if the STATUS isn't RUNNING, yet ...
2022-10-28 11:34:55 +02:00
Juergen Fitschen
41251507a2
Merge pull request #18806 from jue89/fix/efm32_startup
cpu/efm32: include periph_conf.h for system-related methods
2022-10-27 23:26:42 +02:00
benpicco
ed1d8e0a3d
Merge pull request #18785 from maribu/boards/blxxxpill/periph_conf
boards/common/blxxxpill: Fix pin conflicts in periph_conf
2022-10-27 21:22:10 +02:00
Juergen Fitschen
6190738bf0 cpu/efm32: include periph_conf.h for system-related methods
This allows boards to define different crystal frequencies. The correct frequency is required by the system-related methods to ensure proper function of the underlying emlib.
2022-10-27 15:22:58 +02:00
benpicco
578d328ff4
Merge pull request #18711 from Enoch247/cpu-stm32-dma-fixes
cpu/stm32: fix periph_dma
2022-10-27 14:36:10 +02:00
Marian Buschsieweke
5ddc332b52
cpu/stm32/periph_pwm: support pin remap for F1
Add support to route timer peripheral to alternative pins for the
STM32F1.
2022-10-27 14:28:06 +02:00
Marian Buschsieweke
b6845cef79
cpu/stm32/periph_qdec: support pin remap for F1
Add support to route peripheral to alternative pins for the STM32F1
family.
2022-10-27 14:28:06 +02:00
Juergen Fitschen
0151279ffe
Merge pull request #18780 from jue89/feature/efm32-series2
EFM32: add cpu family EFR32ZG23 and board xG23-PK6068A
2022-10-26 19:18:30 +02:00
Joshua DeWeese
4e2c63ce8c cpu/stm32/periph/dma: make dma_prepare() generic
This patch makes dma_prepare() handle register names a bit more
generically.
2022-10-26 09:36:45 -04:00
Joshua DeWeese
c888c103c2 cpu/stm32/periph/dma: fix dma_resume
As implmented, dma_resume assumed that transfers widths were 1 byte and
that the memory address incrmenting was always on and periphial address
incrementing always off. This resulted in memory corruption anytime
these assumptions were not true and a dma was resumed. The DMA module
allows intitiating transfers that did not meet these assumption.

This patch adds proper handling inside dma_resume to safely resume any
transfer. Clearifications and errors are added/fixed in the module's
header file. Also, a few constants are removed from the gobal namespace.
2022-10-26 09:36:45 -04:00
Joshua DeWeese
264a7c8ef9 cpu/stm32/periph/dma: fix DMA2 on STMF3 families
As it was, the calculation of DMA2's IRQ number was inccrorect for some
STM families. The implmentation alocates streams numbers 0 to 7 for the
first DMA controller and 8 and up for the second DMA controller. This
offset of +8 was not accounted for when IRQ's of the second DMA
controller was calculated. This patch corrects this.
2022-10-26 09:36:44 -04:00
Martine Lenders
669e21c7f5
Merge pull request #18735 from Teufelchen1/chore/native_macos
boards/native: Remove macOS as native target
2022-10-26 12:48:00 +02:00
Teufelchen1
35a06c4806 boards/native: Remove macOS as native target 2022-10-25 19:11:23 +02:00
Jue
ee2f5e981c cpu/efm32: add efr32zg23 family
Generated with the EFM2RIOT tool: https://github.com/basilfx/EFM2RIOT
2022-10-24 23:16:39 +02:00
Jue
2ce1df5cd6 cpu/efm32/wdt: add series 2 support 2022-10-24 23:16:39 +02:00
Jue
ccf327a32b cpu/efm32/hwrng: add series 2 periph driver 2022-10-24 23:16:39 +02:00
Jue
53e444ebc7 cpu/efm32/i2c: add series 2 support 2022-10-24 23:16:39 +02:00
Jue
2c2790dde2 cpu/efm32/spi: add series 2 support 2022-10-24 23:16:39 +02:00
Jue
568448f68c cpu/efm32/timer: add series 2 periph driver 2022-10-24 23:16:39 +02:00
Jue
42c9a3c9f1 cpu/efm32/uart: add series 2 periph driver 2022-10-24 23:16:38 +02:00
Jue
2b1a260c43 cpu/efm32/gpio: fix clock enable sequence for series 2 2022-10-24 23:16:38 +02:00
Jue
1c60c95733 cpu/efm32: setup EM4 mode for series 2 CPUs 2022-10-24 23:16:38 +02:00
Jue
775861510c cpu/efm32: allow series 2 boards to setup clock trees flexibly 2022-10-24 23:16:38 +02:00
Benjamin Valentin
04287b4795 cpu/cortexm_common: improve formatting of irq_arch.h 2022-10-24 18:08:33 +02:00
benpicco
21956db2fd
Merge pull request #18776 from gschorcht/pkg/tinyusb_otg_hs_ulpi
pkg/tinyusb: add ULPI and UTMI+ HS PHY support for STM32 USB OTG HS ports
2022-10-21 20:19:23 +02:00
Gunar Schorcht
9c8ec851ce cpu/stm32: define CFG_TUSB_RHPORT{0,1}_MODE dependent on used USB ports 2022-10-21 11:43:55 +02:00
benpicco
f02113081b
Merge pull request #18779 from benpicco/socket_zep-crc16_ccitt
socket_zep: make use of crc16_ccitt_false_update()
2022-10-21 11:01:56 +02:00
Benjamin Valentin
2bb657c72c socket_zep: make use of crc16_ccitt 2022-10-20 13:08:30 +02:00
Juergen Fitschen
67b380034a cpu/efm32/pm: add debug output 2022-10-19 18:17:43 +02:00
Juergen Fitschen
360b36af16 cpu/efm32/pm: allow blocking EM1
Aligns pm logic to #17883
2022-10-19 17:51:12 +02:00
Juergen Fitschen
dc8fe69789 cpu/efm32: satisfy vera++ 2022-10-18 23:30:08 +02:00
Jue
68625e5aa9 cpu/efm32/gpio: block power modes if IRQs are enabled 2022-10-18 23:30:08 +02:00
Jue
f6016d3999 cpu/efm32: keep debug unit active during EM2 when DEVELHELP is active 2022-10-18 17:34:27 +02:00
Jue
bc51071d44 cpu/efm32: define EFM power modes for pm_layered 2022-10-18 17:34:27 +02:00
Jue
b3989bc11f cpu/efm32: remove ADC defintion for CPUs without ADC
Gecko Series 2 is shipped with a new IADC peripheral which is backed by its own emlib driver.
2022-10-18 16:39:18 +02:00
benpicco
da5cd8fa88
Merge pull request #18755 from gschorcht/boards/sltb009a
boards: add support for EFM32GG12 Thunderboard Kit (SLTB009A)
2022-10-18 11:12:28 +02:00
Gunar Schorcht
1dfe79fe7c drivers/usbdev_synopsys_dwc2: use DWC2_USB_OTG_FS_TOTAL_FIFO_SIZE
Use `DWC2_USB_OTG_FS_TOTAL_FIFO_SIZE` instead of `USB_OTG_FS_TOTAL_FIFO_SIZE` since the latter is only defined in the vendor headers for STM32 MCUs. The STM32-specific problem that `USB_OTG_FS_TOTAL_FIFO_SIZE` is not defined in the vendor headers for all STM32 families has therefore been moved from the driver to the STM32-specific USB device header.
2022-10-17 20:03:57 +02:00
Gunar Schorcht
d9dbaa3c2c cpu/esp32s{2,3}: DWC2_USB_OTG_FS_TOTAL_FIFO_SIZE must not overridable
Since the total USB OTG FIFO size is a hardware propertie, it must not be overridable.
2022-10-17 20:03:51 +02:00
Gunar Schorcht
59a84285ae cpu/esp32s{2,3}: fix MODULE_USBDEV_SYNOPSYS_DWC2 dependency in Kconfig
`MODULE_USBDEV_SYNOPSYS_DWC2` depends already on `HAS_PERIPH_USBDEV`.
2022-10-17 20:03:23 +02:00
Gunar Schorcht
a7bf2d74ba cpu/esp32: fix usbdev_synopsys_dwc2 on ztimer_msec
The `usbdev_synopsys_dwc2 driver` requires the `ztimer_msec` module and is therefore responsible for pulling it in. Therefore, the dependency on `ztimer_msec` can be removed here.
2022-10-17 20:03:04 +02:00
Gunar Schorcht
550a599da9 cpu/efm32: fix RTT_MAX_VALUE selection
EFM32GG12 have both a RTC and a RTCC. `_RTC_CNT_MAX` is used as `RTT_MAX_VALUE` in this case.
2022-10-17 08:19:08 +02:00
Gunar Schorcht
ae98c3e6d3 cpu/efm32: add EFM32GG12 family (generated with EFM2RIOT) 2022-10-17 08:19:08 +02:00
benpicco
4fded73f63
Merge pull request #18742 from maribu/cpu/stm32/KConfig2
cpu/stm32: fix periph_usb modeling for STM32F1
2022-10-15 21:13:47 +02:00
Marian Buschsieweke
c58817f839
Merge pull request #18739 from jue89/feature/pkg-gecko_sdk_41
pkg/gecko_sdk: Bump to version 4.1.2
2022-10-15 18:11:23 +02:00
Jue
f3d1773483 cpu/efm32/gpio: fix deprecated GPIO_IntConfig() call 2022-10-15 15:43:17 +02:00
Jue
65d4c046a8 cpu/efm32/efr32*: model librail integration 2022-10-15 15:43:17 +02:00
Marian Buschsieweke
40dd3bd68e
cpu/stm32: fix periph_usb modeling for STM32F1
- Fix source selection for STM32F105xx and STM32F107xx
- Fix KConfig modeling for STM32F105xx and STM32F107xx
2022-10-14 16:20:04 +02:00
Marian Buschsieweke
ea53b35d75
cpu/stm32: fix KConfig modeling for STM32F1 / usbdev_synopsys_dwc2
This fixes incorrect module selection for STM32F1 boards with feature
periph_usbdev, a regression introduced by
https://github.com/RIOT-OS/RIOT/pull/17812
2022-10-14 10:05:12 +02:00
Marian Buschsieweke
ea0a53521f
Merge pull request #17812 from benpicco/boards/blxxxpill-usb
boards/blxxxpill: configure usbdev_fs
2022-10-14 01:10:23 +02:00
Marian Buschsieweke
22c2e85f1d
Merge pull request #18641 from maribu/cpu/arm7_common/alignment
cpu/arm7_common: align stacks correctly
2022-10-13 13:59:18 +02:00
Benjamin Valentin
aa6e8cafcf cpu/stm32: enable usbdev_fs for STM32F1 2022-10-13 12:00:22 +02:00
benpicco
5f75f7fa7d
Merge pull request #18729 from gschorcht/cpu/stm32/periph/usbdev_fs/pma_access
cpu/stm32/periph/usbdev_fs: support for STM32F1 family
2022-10-13 03:27:01 +02:00
Marian Buschsieweke
f57a15131e
cpu/arm7_common: align stacks correctly
`thread_stack_init()` didn't correctly set up the stack alignment.
This fixes the issue and brings the function closer to the Cortex M
version, laying the groundwork for future code duplication.

This fixes https://github.com/RIOT-OS/RIOT/issues/11885
2022-10-12 21:53:16 +02:00
Gunar Schorcht
96fad3fb3b
Merge pull request #18720 from maribu/cpu/esp32/uart
cpu/esp_common/periph_uart: fix call to _uart_set_mode
2022-10-12 15:17:01 +02:00
Gunar Schorcht
a76297c55e cpu/stm32/periph/usbdev_fs: small cleanup of comment formatting 2022-10-12 15:15:10 +02:00
Gunar Schorcht
dde72ad41b cpu/stm32/periph/usbdev_fs: implement PMA access schemes
There are two schemes for accessing the packet buffer area (PMA) from the CPU:
 - 2 x 16 bit/word access scheme where two 16-bit half-words per word can be accessed. With this scheme the access can be half-word aligned and the  PMA address offset corresponds therefore to the local USB IP address.  The size of the PMA SRAM is usually 1024 byte.
- 1 x 16 bit/word access scheme where one 16-bit half word per word can be  accessed. With this scheme the access can only be word-aligned and the  PMA address offset to a half-word is therefore twice the local USB IP  address. The size of the PMA SRAM is usually 512 byte.
Which access scheme is used depends on the STM32 model.
2022-10-12 15:15:10 +02:00
Gunar Schorcht
0177018277 cpu/stm32/periph/usbdev_fs: always use 16-bit addresses for PMA
The addressing of the Packet buffer Memory Area (PMA) is done locally in the USB IP core in half-words with 16-bit. The `_ep_in_buf` and `_ep_out_buf` arrays which hold these USB IP local addresses in the PMA for initialized EPs therefore always use `uint16_t`.
2022-10-12 14:19:30 +02:00
Gunar Schorcht
add766f3e1 cpu/stm32/periph/usbdef_fs: emulate disconnect/connect
If the MCU does not have an internal D+ pullup and there is no dedicated GPIO to simulate a USB disconnect, the D+ GPIO is temporarily configured as an output and pushed down to simulate a disconnect/connect cycle to allow the host to recognize the device. However, this requires an external pullup on D+ signal to work
2022-10-12 14:19:23 +02:00
Gunar Schorcht
58ebf02e58 cpu/stm32/periph/usbdev_fs: configure USB clock predivider
If `RCC_CFGR_USBPRE` is defined, the USB device FS clock of 48 MHz is derived from the PLL clock. In this case the PLL clock must be configured and must be either 48 MHz or 72 MHz. If the PLL clock is 72 MHz it is pre-divided by 1.5, the PLL clock of 48 MHz is used directly.
2022-10-12 14:18:55 +02:00
Martine Lenders
b35a291332
Merge pull request #18718 from MrKevinWeiss/pr/fixnightlies
Fix kconfig models breaking nightlies
2022-10-11 15:07:50 +02:00
Gunar Schorcht
65d5d28e09
Merge pull request #18717 from maribu/cpu/esp32/ESP32_SDK_DIR
cpu/esp32: move ESP32_SDK_DIR definition here
2022-10-11 11:06:19 +02:00
Marian Buschsieweke
c1a62f316e
cpu/esp32: move ESP32_SDK_DIR definition here
The definition in `pkg/esp32_sdk/Makefile.include` was evaluated by
`make` after the include paths were already set, resulting in
`ESP32_SDK_DIR` being empty in

    INCLUDES += -I$(ESP32_SDK_DIR)/components
    [...]

This in turn resulted in

    cc1: error: /components: No such file or directory [-Werror=missing-include-dirs]
    [...]
2022-10-10 20:39:47 +02:00
Marian Buschsieweke
6d874c2882
cpu/esp_common/periph_uart: fix call to _uart_set_mode
The parameters for parity and stop bits was confused, resulting in
the following compilation error with GCC 12.2.0:

    /home/maribu/Repos/software/RIOT/cpu/esp_common/periph/uart.c: In function '_uart_config':
    /home/maribu/Repos/software/RIOT/cpu/esp_common/periph/uart.c:394:61: error: implicit conversion from 'uart_stop_bits_t' to 'uart_parity_t' -Werror=enum-conversion]
      394 |     if (_uart_set_mode(uart, _uarts[uart].data, _uarts[uart].stop,
          |                                                 ~~~~~~~~~~~~^~~~~
    /home/maribu/Repos/software/RIOT/cpu/esp_common/periph/uart.c:395:42: error: implicit conversion from 'uart_parity_t' to 'uart_stop_bits_t' -Werror=enum-conversion]
      395 |                              _uarts[uart].parity) != UART_OK) {
          |                              ~~~~~~~~~~~~^~~~~~~
    cc1: all warnings being treated as errors

This swaps the parameters.
2022-10-10 14:27:27 +02:00
MrKevinWeiss
82dca7841f
cpu/stm32: fix stm32f3 kconfig model
MODULE_USBDEV_SYNOPSYS_DWC2 was being selected when it shouldn't
2022-10-10 12:37:10 +02:00
MrKevinWeiss
842ba5f51c
cpu/stm32: fix kconfig model usb clock 2022-10-10 12:10:29 +02:00
Benjamin Valentin
cd9c8c354e cpu/esp32: allow GPIO_UNDEF in SPI config
e.g. a display or string of LEDs might not have a MISO pin defined
2022-10-08 22:02:49 +02:00
Benjamin Valentin
2b2298b796 cpu/esp32: implement periph_spi_reconfigure 2022-10-08 22:02:49 +02:00
Marian Buschsieweke
90c92797bd
Merge pull request #18697 from kaspar030/cortexm_clear_fpu_state_on_thread_exit
cpu/cortexm: clear FPU state in `cpu_switch_context_exit()`
2022-10-06 19:05:38 +02:00
5cc43e5d5e cpu/cortexm: clear FPU state in cpu_switch_context_exit() 2022-10-05 22:17:26 +02:00
Dylan Laduranty
d7d91935a4
Merge pull request #18680 from gschorcht/drivers/usbdev_stm32f3
cpu/stm32/periph/usbdev_fs: add support for STM32F3 family
2022-10-05 18:35:53 +02:00
Dylan Laduranty
1a1b41bea5
Merge pull request #18688 from benpicco/cpu/sam0_common-muxpos
cpu/sam0_common: ADC keep muxpos as legacy define
2022-10-05 16:56:26 +02:00
Marian Buschsieweke
f02bc5791a
Merge pull request #18571 from maribu/sys/tiny_strerror
sys/tiny_strerror: add tiny `strerror()` implementation
2022-10-05 09:24:40 +02:00
Gunar Schorcht
08bd418baa cpu/stm32/periph/usbdev_fs: coding style fix 2022-10-05 09:15:29 +02:00
Gunar Schorcht
7f4613da34 cpu/stm32/periph/usbdev_fs: changes to support STM32F3 2022-10-05 09:15:29 +02:00
Gunar Schorcht
1fde5a4401 cpu/stm32/periph/usbdev_fs: support GPIO for USB connect/disconnect
Since some STM32 MCU don't have internal D+ pullup, there are boards that use a GPIO for USB bus connect/disconnect.
2022-10-05 09:15:29 +02:00
Benjamin Valentin
5843ff4127 cpu/sam0_common: ADC keep muxpos as legacy define 2022-10-04 15:45:25 +02:00
Gunar Schorcht
3d1a3bf560 cpu/stm32/periph/usbdev_fs: allow USB signals as additional function
For a number of STM32 MCUs with the USB-FS device interface the signals USB_DP and USB_DM are not defined as GPIO alternative function but as additional function. Additional functions are directly selected/enabled through peripheral registers hand have not to be configured. In this case, the configuration defines GIO_AF_UNDEF as alternative function.
2022-10-04 13:59:43 +02:00
Gunar Schorcht
20bdd3452e cpu/stm32/periph/usbdev_fs: conditional configuration of CRS
Conditional configuration of CRS_CR_AUTOTRIMEN allows the compilation of the driver for STM32 MCUs that don't have Clock Recovery System.
2022-10-04 13:59:43 +02:00
Gunar Schorcht
66d0f948ba cpu/stm32/periph/usbdev_fs: fix register name
RCC_APB1SMENR1 is used if RCC_APB1SMENR_USBSMEN is defined. Without this fix, the conditional doesn't have any effect.
2022-10-04 13:59:43 +02:00
benpicco
429ee839cc
Merge pull request #18676 from krzysztof-cabaj/nucleo-l4r5zi-ADC
boards/nucleo-l4r5zi:  support for ADC
2022-10-04 13:26:16 +02:00
Dylan Laduranty
11aebb6003
Merge pull request #18592 from gschorcht/pkg/tinyusb
pkg/tinyusb: add tinyUSB as package
2022-10-04 13:08:36 +02:00
Gunar Schorcht
75071319de cpu/stm32: define HSE_VALUE for tinyUSB Synopsys DWC2 driver 2022-10-04 11:10:43 +02:00
Gunar Schorcht
9cf0119233 pkg/tinyusb: add tinyusb_hw_defaults.h for platform specific defaults 2022-10-04 07:40:18 +02:00
krzysztof-cabaj
3a23f2632e boards/nucleo-l4r5zi: add ADC support 2022-10-03 17:13:20 -04:00
Marian Buschsieweke
3227fb3b17
Merge pull request #18619 from maribu/core/mutex/cleanup
core/mutex: clean up
2022-10-03 10:58:07 +02:00
benpicco
da6b16da7e
Merge pull request #18669 from benpicco/mtd_native_ftell
cpu/native: get mtd size from file size
2022-10-01 16:47:48 +02:00
Gunar Schorcht
76848492b0 cpu/stm32: add tinyUSB package support 2022-09-30 19:05:51 +02:00