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
bors[bot]
829af7c105
Merge #19703 #19724 #19735
19703: cpu/sam0_eth: interrupt based link detection/auto-negotiation r=benpicco a=benpicco



19724: dist/tools/openocd: add OPENOCD_SERVER_ADDRESS variable r=benpicco a=fabian18



19735: nrf5x_common: Clear I2C periph shorts r=benpicco a=bergzand

### Contribution description

The I2C peripheral's shortcuts are used with the read and write register to automatically stop the I2C transaction or to continue with the next stage.

With simple I2C read and write bytes these shorts are not used, but are also not cleared by the function in all cases, causing it to use the shortcut configuration set by a previous function call. This patch ensures that the shorts are always set by the read and write functions

### Testing procedure

Should be possible to spot with a logic analyzer and the I2C periph test. Maybe the HIL test can also detect it :)

### Issues/PRs references

None

Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
Co-authored-by: Fabian Hüßler <fabian.huessler@ml-pa.com>
Co-authored-by: Koen Zandberg <koen@bergzand.net>
2023-06-14 12:34:33 +00:00
Benjamin Valentin
2a255ff3e8 cpu/sam0_eth: interrupt based link detection/auto-negotiation 2023-06-14 14:21:52 +02:00
e5d25e0b04
nrf5x_common: Clear I2C periph shorts
The I2C peripheral's shortcuts are used with the read and write register
to automatically stop the I2C transaction or to continue with the next
stage.

With simple I2C read and write bytes these shorts are not used, but are
also not cleared by the function in all cases, causing it to use the
shortcut configuration set by a previous function call. This patch
ensures that the shorts are always set by the read and write functions
2023-06-14 10:37:24 +02:00
Marian Buschsieweke
98b38399df
cpu/qn908x/periph_i2c: enable internal pull-up on SCL
Always enable the internal pull-up on the SCL line to always have a
functional I2C bus. This may increase power consumption where an
external pull up is present as well. But let's wait for a real world
use case where this would help to extend battery life before making
this configurable.

This fixes https://github.com/RIOT-OS/RIOT/issues/19021
2023-06-13 14:43:36 +02:00
Marian Buschsieweke
97857d2740
cpu/msp430_common: add support for MSP432F2618 2023-06-08 23:42:50 +02:00
Marian Buschsieweke
6df03ecb93
cpu/msp430_common: update vendor header files 2023-06-08 09:50:41 +02:00
Marian Buschsieweke
f2250015c2
cpu/msp430fxyz: Fix DCO calibration for MSP430F2xx
The MSP430F2xx family has on RSEL bit more than the MSP430x1xxx family.
This updates the clock calibration accordingly.
2023-06-07 15:45:44 +02:00
Benjamin Valentin
04b895ce8a cpu/sam0_eth: use 64 bit bus 2023-06-05 11:42:55 +02:00
Benjamin Valentin
6b70459f77 cpu/sam0_eth: report link status 2023-06-05 11:42:55 +02:00
bors[bot]
0dce63b242
Merge #19689 #19700 #19701
19689: cpu/sam0_eth: disable PHY when MAC is sleeping r=maribu a=benpicco





19700: pkg/openthread: Fix Kconfig and broken example r=maribu a=MrKevinWeiss

### Contribution description

There were some improvements that could be make to the kconfig modeling of the `pkg/openthread` after looking a bit closer.

The bigger problem is the hash check on nightlies require reproducible builds, however, even with make, the builds are not reproducible.  So, for now, I just rename the `app.config.test` to `skip.app.config.test` to prevent murdock from trying to do a hash check but still letting it be useable.

### Testing procedure

Green murdock, all modules match `examples/openthread`


- Rename `skip.app.config.test` to `app.config.test`
- Run the following
```
./dist/tools/compile_test/compile_like_murdock.py -j 8 -a examples/openthread/ -b all -m
```

<details>

```
examples/openthread/           cc2538dk                       PASS
examples/openthread/           frdm-kw41z                     PASS
examples/openthread/           iotlab-a8-m3                   PASS
examples/openthread/           iotlab-m3                      PASS
examples/openthread/           nrf52840-mdk                   PASS
examples/openthread/           nrf52840dk                     PASS
examples/openthread/           omote                          PASS
examples/openthread/           openlabs-kw41z-mini            PASS
examples/openthread/           openlabs-kw41z-mini-256kib     PASS
examples/openthread/           openmote-cc2538                PASS
examples/openthread/           phynode-kw41z                  PASS
examples/openthread/           reel                           PASS
examples/openthread/           remote-reva                    PASS
examples/openthread/           remote-revb                    PASS
examples/openthread/           samr21-xpro                    PASS
examples/openthread/           usb-kw41z                      PASS
```
</details>


### Issues/PRs references

Fixes an aspect of broken master


19701: sys/usb/Kconfig: Fix default PID r=maribu a=MrKevinWeiss


### Contribution description

Seems like I just didn't have the correct `USB_PID` defined in the `usb-codes.inc.mk`.

It should be 0x7D01 not 0x7001.

It only shows up in nightlies since the hash would mismatch.

### Testing procedure

Simulated nightly testing with:

```
./dist/tools/compile_test/compile_like_murdock.py -j 8 -a tests/pkg/tinyusb_cdc_acm_stdio/ tests/pkg/tinyusb_cdc_msc/ tests/pkg/tinyusb_cdc_msc/ tests/sys/fido2_ctap/ tests/sys/usbus_board_reset/ tests/sys/usbus_msc/  -b arduino-zero samd21-xpro nucleo-f767zi -v
```

<details>

```
tests/pkg/tinyusb_cdc_acm_stdio/ arduino-zero                   PASS
ctests/pkg/tinyusb_cdc_acm_stdio/ nucleo-f767zi                  PASS
tests/pkg/tinyusb_cdc_acm_stdio/ samd21-xpro                    PASS
tests/pkg/tinyusb_cdc_msc/     arduino-zero                   PASS
tests/pkg/tinyusb_cdc_msc/     nucleo-f767zi                  PASS
tests/pkg/tinyusb_cdc_msc/     samd21-xpro                    PASS
tests/pkg/tinyusb_cdc_msc/     arduino-zero                   PASS
tests/pkg/tinyusb_cdc_msc/     nucleo-f767zi                  PASS
tests/pkg/tinyusb_cdc_msc/     samd21-xpro                    PASS
tests/sys/fido2_ctap/          arduino-zero                   PASS
tests/sys/fido2_ctap/          samd21-xpro                    PASS
tests/sys/usbus_board_reset/   arduino-zero                   PASS
tests/sys/usbus_board_reset/   nucleo-f767zi                  PASS
tests/sys/usbus_board_reset/   samd21-xpro                    PASS
tests/sys/usbus_msc/           arduino-zero                   PASS
tests/sys/usbus_msc/           nucleo-f767zi                  PASS
tests/sys/usbus_msc/           samd21-xpro                    PASS
```

### Issues/PRs references

Broken master in nightlies.

Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
Co-authored-by: MrKevinWeiss <weiss.kevin604@gmail.com>
2023-06-02 12:54:07 +00:00
Benjamin Valentin
385d260069 cpu/sam0_eth: disable PHY when MAC is sleeping
- idle         13.88 mA
 - MAC off      11.48 mA
 - MAC+PHY off  10.73 mA
2023-05-31 14:08:50 +02:00
MrKevinWeiss
92794c0eca
boards/*: Model usb and stdio in Kconfig 2023-05-31 13:04:42 +02:00
MrKevinWeiss
e481571b4e
cpu/esp32: Move MODULE_STDIO_USB_SERIAL_JTAG to cpu 2023-05-31 12:55:51 +02:00
bors[bot]
f10426709c
Merge #19677 #19683
19677: boards/nucleo-l432k: provide three periph_timer instances r=maribu a=maribu

### Contribution description

- `cpu/stm32/periph_timer`: Generalize to also work with timers that do not have 4 channels
- `boards/common/stm32`: Add timer config for three timers based on TIM2, TIM15, and TIM16 (the three general-purpose timers of the STM32L4)
- `boards/nucleo-l432kc`: Make use of the new timer config


19683: cpu/sam0_eth: clean up init() r=maribu a=benpicco





Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2023-05-30 20:01:21 +00:00
bors[bot]
00b5bc12a2
Merge #19610 #19670 #19678 #19679 #19680 #19681
19610: drivers/periph/rtc: improve doc on rtc_set_alarm r=maribu a=maribu

### Contribution description

- point out behavior on denormalized time stamps
- use errno codes to indicate errors (and adapt the few instances of actual error handling to use them)


19670: cpu/stm32: stm32f4 BRR from BSRR r=maribu a=kfessel

### Contribution description

sometimes one wants to save one instruction :) 
just write the bits we need to write.

### Testing procedure

tests/periph/gpio_ll tests this 

### Issues/PRs references

`@maribu` might know some reference

maybe #19407

19678: gnrc_sixlowpan_iphc: fix NULL pointer dereference r=maribu a=miri64



19679: gnrc_sixlowpan_frag_sfr: fix ARQ scheduler race-condition r=maribu a=miri64



19680: gnrc_sixlowpan_frag_rb: fix OOB write in _rbuf_add r=maribu a=miri64



19681: sys/xtimer: improve documentation r=maribu a=maribu

### Contribution description

- Add a warning that xtimer is deprecated, so that new code hopefully starts using ztimer
- Add a hint that `ztimer_xtimer_compat` can be used even after `xtimer` is gone


Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
Co-authored-by: Karl Fessel <karl.fessel@ovgu.de>
Co-authored-by: Martine Lenders <m.lenders@fu-berlin.de>
2023-05-30 17:11:06 +00:00
Marian Buschsieweke
51127f674a
drivers/periph/rtc: improve doc on rtc_set_alarm
- point out behavior on denormalized time stamps
- use errno codes to indicate errors (and adapt the few instances of
  actual error handling to use them)
2023-05-30 17:41:36 +02:00
Karl Fessel
f8a64dfb1c
cpu/stm32: stm32f4 BRR from BSRR 2023-05-30 16:06:35 +02:00
Benjamin Valentin
faf8be39c6 cpu/sam0_eth: clean up init()
- don't enable PHY twice
 - properly set NCFGR register
 - sam0_read_phy() does not return a signed value
2023-05-30 15:41:24 +02:00
Marian Buschsieweke
7c0a4b8390
cpu/stm32/periph_timer: Support timers with channels != 4
The assumption that all STM32 timers have exactly four channels no
longer holds. E.g. the STM32L4 has the following general purpose timers:

- TIM2: 32 bit, 4 channels
- TIM15: 16 bit, 2 channels
- TIM16: 16 bit, 1 channel

Hence, a new field is added to the timer configuration to also contain
the number of timer channels. Due to alignment the `struct` previously
was padded by 16 bit, so adding another 8 bit field doesn't increase
its size.

For backward compatibility, a value of `0` is considered as alias for
`TIMER_CHANNEL_NUMOF` (or 4), so that the number of timer channels
only needs to be set when the timer is different from the typical 4
channel timer. This helps backward compatibility.
2023-05-30 12:55:29 +02:00
bors[bot]
f08ab0814c
Merge #19629
19629: cpu/stm32/periph/adc: fix setting ADC clock r=benpicco a=Enoch247

### Contribution description

The current implementation uses the core clock frequency to calculate the needed prescalar to achieve a given ADC clock frequency. This is incorrect. This patch fixes the calculation to use the correct source clock (PCKLK2 ie APB2). It also changes the defined max clock rate to use the frequency macro to improve readability.

I based on code similarity. I believe the gd32v CPU may need this same fix, but I am not familiar with that MCU.

### Testing procedure

I tested this on a nucleo-f767zi. The the MCU's reference manual is in agreement with what I have implemented here. I spot checked references manuals for a random [STM32F1](https://www.st.com/resource/en/reference_manual/cd00171190-stm32f101xx-stm32f102xx-stm32f103xx-stm32f105xx-and-stm32f107xx-advanced-arm-based-32-bit-mcus-stmicroelectronics.pdf) and [STM32F2](https://www.st.com/resource/en/reference_manual/rm0033-stm32f205xx-stm32f207xx-stm32f215xx-and-stm32f217xx-advanced-armbased-32bit-mcus-stmicroelectronics.pdf), and they are clocked similar to the F7 I have.

### Issues/PRs references

None known.


Co-authored-by: Joshua DeWeese <jdeweese@primecontrols.com>
2023-05-28 05:23:29 +00:00
MrKevinWeiss
adbf951481
cpu/rpx0xx: Fix kconfig model 2023-05-24 09:53:23 +02:00
bors[bot]
a272abb15d
Merge #19618 #19639 #19644 #19649 #19656
19618: cpu/stm32: fix riotboot settings for L4 and WB r=benpicco a=gschorcht

### Contribution description

This PR fixes the `riotboot` configuration for L4 and WB.

The family is not called `stm32l4` or `stm32wb` but `l4` and `wb`. That is, the `riotboot` configuration didn't work at all. Furthermore, a minimum `RIOTBOOT_LEN` of `0x2000` is required for L4.

Found when investigating the compilation errors for `bootloaders/riotboot_serial` in PR #19576.

### Testing procedure

1. Green CI.
2. Use the following commands:
    ```
    BOARD=nucleo-l496zg make -C tests/riotboot info-debug-variable-RIOTBOOT_HDR_LEN
    BOARD=p-nucleo-wb55 make -C tests/riotboot info-debug-variable-RIOTBOOT_HDR_LEN
    ```
    In master these commands give
    ```
    0x400
    ```
    With this PR these commands give
    ```
    0x200
    ```
    as expected.
3. Use the following commands:
    ```
    BOARD=nucleo-l496zg make -C tests/riotboot info-debug-variable-RIOTBOOT_LEN
    BOARD=p-nucleo-wb55 make -C tests/riotboot info-debug-variable-RIOTBOOT_LEN
    ```
    In master these commands give
    ```
    0x1000
    ```
    With this PR these commands give
    ```
    0x2000
    ```
    as expected.

### Issues/PRs references


19639: tests/net/gnrc_mac_timeout: add automated test r=aabadie a=aabadie



19644: gnrc_ipv6_nib: include RIO with all subnets in downstream RA r=benpicco a=benpicco



19649: gnrc_sixlowpan_iphc: prefix bits outside context must be zero r=benpicco a=benpicco



19656: gnrc/ipv6_auto_subnets: allow to configure minimal prefix length r=benpicco a=benpicco



Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
Co-authored-by: Alexandre Abadie <alexandre.abadie@inria.fr>
Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2023-05-23 20:02:58 +00:00
bors[bot]
3469fce248
Merge #19335 #19581 #19612 #19643 #19655
19335: ipv6/nib: 6LBR should not send RS on their downstream interface r=fabian18 a=fabian18



19581: cpu/samd5x: enable FDPLL1 at 200MHz r=benpicco a=dylad

### Contribution description

This PR allows to use the second FDPLL (the first one is used to generated the 120MHz frequency used by the core and some peripherals). The second FDPLL is setup to run at 200MHz which is the maximum allowed by this MCU.
In fact, I reused the existing function which setup FDPLL0 so it can be used in a generic way for both PLL (since they are the same IP).

I change the way the computation offset (left shift by 5)  is done because 200MHz << 5 wouldn't fit inside an `uint32_t` and I wanted to avoid using an `uint64_t` here

Two additional commits are present for a small cleanup and a fix.

This is currently unused in our codebase, so it shouldn't impact this platform too much as the `ONDEMAND` bit is set. the FDPLL will not be running out of the box. But `@gschorcht` might need it pretty soon.

### Testing procedure

This PR can be tested on a `same54-xpro` and an oscilloscope using the following the patch:
```
From 76490845ec72387b24116bdd364a61365c186aa1 Mon Sep 17 00:00:00 2001
From: Dylan Laduranty <dylan.laduranty@mesotic.com>
Date: Thu, 11 May 2023 17:42:16 +0200
Subject: [PATCH] removeme! for debug purpose

Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
---
 cpu/samd5x/cpu.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/cpu/samd5x/cpu.c b/cpu/samd5x/cpu.c
index f778991a5b..2866c8c9e5 100644
--- a/cpu/samd5x/cpu.c
+++ b/cpu/samd5x/cpu.c
`@@` -220,7 +220,7 `@@` static void fdpll_init(uint8_t idx, uint32_t f_cpu)
 }
 
 static void gclk_connect(uint8_t id, uint8_t src, uint32_t flags) {
-    GCLK->GENCTRL[id].reg = GCLK_GENCTRL_SRC(src) | GCLK_GENCTRL_GENEN | flags | GCLK_GENCTRL_IDC;
+    GCLK->GENCTRL[id].reg = GCLK_GENCTRL_SRC(src) | GCLK_GENCTRL_GENEN | flags | GCLK_GENCTRL_OE | GCLK_GENCTRL_IDC;
     while (GCLK->SYNCBUSY.reg & GCLK_SYNCBUSY_GENCTRL(id)) {}
 }
 
`@@` -384,6 +384,12 `@@` void cpu_init(void)
     dma_init();
 #endif
 
+    sam0_gclk_enable(SAM0_GCLK_200MHZ);
+    /* output both FDPLL (GCLK0 and GCLK4) to gpios */
+    gpio_init_mux(GPIO_PIN(PB, 14), GPIO_MUX_M);
+    gpio_init_mux(GPIO_PIN(PB, 10), GPIO_MUX_M);
+    /* PB14 -> EXT2    PB10 -> QSPI SCK */
+
     /* initialize stdio prior to periph_init() to allow use of DEBUG() there */
     early_init();
 
-- 
2.35.3
```

It will output both FDPLLs to PB14 and PB10. Their frequency can then be measured using an oscilloscope.


### Issues/PRs references
None.

19612: pkg/ndn-riot: drop unmaintained pkg r=benpicco a=maribu

### Contribution description

Upstream [1] has seen no activity since 2018, so it safe to assume this is dead. It is reasonable to assume that any users - if there ever were any - have moved on.

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

[1]: https://github.com/named-data-iot/ndn-riot


19643: examples/suit_update: some test fixes r=aabadie a=kaspar030



19655: net/ipv6: make use of clz in ipv6_addr_match_prefix() r=benpicco a=benpicco



Co-authored-by: Fabian Hüßler <fabian.huessler@st.ovgu.de>
Co-authored-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
Co-authored-by: Kaspar Schleiser <kaspar@schleiser.de>
Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2023-05-23 16:23:19 +00:00
Gunar Schorcht
e6c1aec7d0 cpu/stm32: fix riotboot settings for L4 and WB
The family is not called `stm32l4` or `stm32wb` but `l4` and `wb`. That is, the `riotboot` configuration didn't work. A minimum `RIOTBOOT_LEN` of `0x2000` is required for WB.
2023-05-23 17:47:04 +02:00
bors[bot]
f3150120f7
Merge #17425
17425: cpu/rpx0xx: initial PIO support r=maribu a=fabian18



Co-authored-by: Fabian Hüßler <fabian.huessler@st.ovgu.de>
2023-05-23 07:02:45 +00:00
Fabian Hüßler
dd13df2943 cpu/rpx0xx: add convenience functions to initialize mapped PIO pins 2023-05-23 08:49:37 +02:00
Fabian Hüßler
116c579cb5 cpu/rpx0xx: Add PIO I2C implementation 2023-05-23 08:49:37 +02:00
Fabian Hüßler
18315d3ddc cpu/rpx0xx: Add PIO implementation 2023-05-23 08:49:37 +02:00
bors[bot]
dc0fe5283f
Merge #19611 #19640
19611: sys/net/rpl: fix possible NULL dereference r=benpicco a=maribu

### Contribution description

As the title says


19640: core/thread: drop unused thread_arch_t r=benpicco a=maribu

### Contribution description

No architecture makes use of thread_arch_t anymore, so let's drop it.


Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
2023-05-22 14:10:24 +00:00
Marian Buschsieweke
aed175b14b
core/thread: drop unused thread_arch_t
No architecture makes use of thread_arch_t anymore, so let's drop it.
2023-05-21 22:17:52 +02:00
bors[bot]
a28f6e5a41
Merge #19628 #19637
19628: Fix periph clk r=aabadie a=Enoch247

### Contribution description

This fixes some minor doc and argument type errors. See commit messages for details.

### Testing procedure

It compiles without errors for me.

### Issues/PRs references

None known

19637: sys/usb/usbus_msc: fix typo in C expression r=aabadie a=maribu

### Contribution description

Rather than setting the correct blk_len, the code only wrote 1 and 0 into the three bytes due to the use of a logic and where a bitwise and should be used.


Co-authored-by: Joshua DeWeese <jdeweese@primecontrols.com>
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
2023-05-21 06:04:07 +00:00
bors[bot]
7ac0b6f821
Merge #19433
19433: cpu/esp32: deduplication in Kconfig for ESP32x SoCs r=aabadie a=gschorcht

### Contribution description

This PR reduces the code duplication in Kconfig for ESP32x SoCs.

It defines a new common CPU symbol `CPU_COMMON_ESP32X` in Kconfig that is used by all `CPU_FAM_ESP32x` symbols. It selects all features, modules and packages that are common for all ESP32x SoC variants. This avoids the selection of features, modules and packages again and again for each ESP32x SoC variant.

The same is done in PR #19432 for common ESP32x board definitions.

### Testing procedure

Green CI

### Issues/PRs references

Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-05-20 15:42:00 +00:00
bors[bot]
06e27d5aba
Merge #19619
19619: cpu/arm7: Fix undefined behavior based on invalid assembly r=aabadie a=Teufelchen1

### Contribution description

Hellooo! 🦤

In this PR a single `NOP` is added after an `ldm` in ARM7 common code in the scheduling management.
The change is necessary because this particular `ldm` affects certain banked registers, including `R14 / lr`. The next instruction then immediately accesses `lr`. This is invalid and the exact effect depends on the underlying hardware implementation. An intermediate `NOP` ensures correct behaviour in such cases.

The ARM docs can be found [here](https://documentation-service.arm.com/static/5f8dacc8f86e16515cdb865a), in section `A4.1.21 LDM (2)`. It states:
> In ARM architecture versions earlier than ARMv6, this form of LDM must not be
followed by an instruction that accesses banked registers. A following NOP is a good
way to ensure this.


### Testing procedure

Without this change, on the Game Boy Advance, RIOT behaves irregularly. With the `NOP`, it works fine!
If possible, this change should be tested on other ARM7 hardware as well but I do not have access to any.  

----

Special thanks `@pyropeter` for spotting the extremely tiny note on this issue within the ARM docs. You saved me hours of tears! 👾

Co-authored-by: Teufelchen1 <bennet.blischke@outlook.com>
2023-05-20 12:51:14 +00:00
bors[bot]
f47003c1db
Merge #19572
19572: cpu/stm32/periph_pwm: support of complementary timer outputs r=maribu a=gschorcht

### Contribution description

This PR provides the support of complementary timer outputs as PWM channels for advanced timers (TIM1/TIM8).

To use a complementary output of an advanced timer as PWM channel, the output is defined with an offset of 4, i.e. normal outputs are in the range of 0 to 3 (CH1...CH4) and complementary outputs are in the range of 4 to 6 (CH1N...CH3N). If the defined output is less than 4, the normal output is enabled, otherwise the complementary output is enabled.

This change is required to support PWM on boards that have connected the complementary outputs of advanced timers to the PWM connector pins, for example the STM32L496-DISCO board.

### Testing procedure

- Green CI
- Use any STM32 board which supports the `periph_pwm` feature. `tests/periph_pwm` should still work.
- Change the configuration for this board so that either timer TIM1 or TIM8 and a complementary channel is used for any exposed GPIO. `tests/periph_pwm` should also work with such a configuration.

### Issues/PRs references


Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-05-20 09:57:27 +00:00
bors[bot]
a46b49a24c
Merge #19605 #19624 #19625
19605: drivers/at86rf2xx: setting rx timestamp based on symbol counter for ATmega*RFR2 r=maribu a=chudov



19624: pkg/tensorflow-lite: remove deprecated package r=maribu a=aabadie

Use tflite-micro instead



19625: sys/hashes: remove deprecated aes cmac hashing r=maribu a=aabadie



Co-authored-by: chudov <chudov@gmail.com>
Co-authored-by: Alexandre Abadie <alexandre.abadie@inria.fr>
2023-05-19 17:05:02 +00:00
Joshua DeWeese
fe28f93691 cpu/stm32/periph/adc: fix setting ADC clock
The current implementation uses the core clock frequency to calculate
the needed prescalar to achieve a given ADC clock frequency. This is
incorrect. This patch fixes the calculation to use the correct source
clock (PCKLK2 ie APB2). It also changes the defined max clock rate to
use the frequency macro to improve readability.
2023-05-19 12:02:34 -04:00
Gunar Schorcht
d8cf5a0c66 cpu/stm32/periph_pwm: add doc for complementary timer channels 2023-05-19 16:51:26 +02:00
Gunar Schorcht
62210303ab cpu/stm32/periph_pwm: allow to use complementary timer channels
To use a complementary output of an advanced timer as PWM channel, the output is defined with an offset of 4, i.e. normal outputs are in the range of 0 to 3 (CH1...CH4) and complementary outputs are in the range of 4 to 6 (CH1N...CH3N). If the defined output is less than 4, the normal output is enabled, otherwise the complementary output is enabled.
2023-05-19 16:51:26 +02:00
Joshua DeWeese
094977d9e0 cpu/stm32: make bus arg consistent
Some periph clock functions took the bus arg as a `uin8_t`, others took
it as a `bus_t`. This patch makes them all take it as a `bus_t`.
2023-05-19 10:44:24 -04:00
Joshua DeWeese
99337cda9c cpu/stm32: fix incorrect doc
The doxygen doc for `periph_lpclk_dis()` and `periph_clk_dis()` we
flip-flopped. This patch corrects this.
2023-05-19 10:44:24 -04:00
chudov
c52f6e71c2 drivers/at86rf2xx: rx timestamp generation for ATmegaRFR2
Signed-off-by: chudov <chudov@gmail.com>
2023-05-19 15:33:15 +02:00
Teufelchen1
583a1da348 cpu/arm7: Fix undefined behavior based on invalid assembly 2023-05-19 11:34:30 +02:00
Marian Buschsieweke
5457014c4a
build-system: Allow out of tree BUILD_DIR
- Replace all users of `$(RIOTBASE)/build` with the already present
  `$(BUILD_DIR)` variable
- Replace all users of `$(BUILD_DIR)/pkg` with the already present
  `$(PKGDIRBASE)` variable
- Create a `CACHEDIR.TAG` file in the `$(BUILD_DIR)`
2023-05-16 22:23:03 +02:00
Dylan Laduranty
6607ed10f6 cpu/samd5x: add support for FDPLL1 running at 200MHz
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2023-05-16 16:04:17 +02:00
Dylan Laduranty
f790d9fe36 cpu/samd5x: replace fdpll0_init by two generic functions
These functions can be used to set both FDPLL0 and FDPLL1 by using an extra argument 'idx' (index) and allow to set the ONDEMAND bit using the 'flags' argument

Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2023-05-16 16:03:15 +02:00
Dylan Laduranty
af2fa99470 cpu/samd5x: remove duplicate USE_VREG_BUCK
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2023-05-16 15:54:18 +02:00
Dylan Laduranty
ba83e13d10 cpu/samd5x: fix SAM0_DPLL_FREQ_MAX_HZ value
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2023-05-16 15:53:20 +02:00
Marian Buschsieweke
df5c319978
cpu/msp430fxyz: clean up clock initialization
Provide a common clock initialization driver rather than leaving
clock initialization to the boards code. A declarative description of
the board's clock configuration using a struct does still allow to
fine-tune settings. In addition, a board is still allowed to just
provide a custom `void clock_init(void)` if there really is the need
to do crazy things.
2023-05-16 10:05:09 +02:00
bors[bot]
2b97b76d83
Merge #18056 #19571 #19589
18056: pkg/cmsis: use unique package for CMSIS headers, DSP and NN modules r=benpicco a=aabadie



19571: cpu/stm32/periph_adc: fixes and improvements for L4 support r=benpicco a=gschorcht

### Contribution description

This PR provides the following fixes and improvements for the `periph_adc` implementation for STM32L4.
- Support STM32L496AG added.
- Instead of defining the number of ADC devices for each MCU model, the number of ADC devices is determined from ADCx definitions in CMSIS header.
- MCU specific register/value defines are valid for all L4 MCUs, model based conditional compilation is removed.
- The ADC clock disable function is fixed using a counter. The counter is incremented in `prep` and decremented in `done`. The ADC clock is disabled if the counter becomes 0.
- For boards that have not connected the V_REF+ pin to an external reference voltage, the VREFBUF peripheral can be used as V_REF+ (if supported) by setting `VREFBUF_ENABLE=1`.
- The ASCR register is available and has to be set for all STM32L471xx, STM32L475xx, STM32L476xx, STM32L485xx and STM32L486xx MCUs. Instead of using the CPU model for conditional compilation, the CPU line is used to support all MCU of that lines.
- Setting of SQR1 is fixed. Setting the SQR1 did only work before because the `ADC_SRQ_L` is set to 0 for a sequence length of 1.
- Setting the `ADC_CCR_CKMODE` did only work for the reset state. It is now cleared before it is set. Instead of using the `ADC_CCR_CKMODE_x` bits to set the mode, the mode defines are used.
 - Support for V_REFINT as ADC channel added.

### Testing procedure



19589: gnrc/gnrc_netif_hdr_print: printout timestamp if enabled r=aabadie a=chudov



Co-authored-by: Alexandre Abadie <alexandre.abadie@inria.fr>
Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
Co-authored-by: chudov <chudov@gmail.com>
2023-05-15 12:41:48 +00:00
Gunar Schorcht
caa50a57e6 cpu/stm32/periph_adc: support V_REFINT as ADC channel on L4 2023-05-15 14:24:53 +02:00