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

46284 Commits

Author SHA1 Message Date
SamuelLegouix
febf6f22c1
pkg/nanocbor - upgrade to last version 2024-08-16 12:08:32 +02:00
benpicco
3d5582d563
Merge pull request #20811 from nmeum/pr/riscv_common-format-error-llvm
riscv_common: Use unsiged long format specifier for printing CSR values
2024-08-12 16:40:30 +00:00
Sören Tempel
e7325ec02a riscv_common: Use unsiged long format specifier for printing CSR values
The read_csr macro returns the CSR value as a `unsigned long`. However,
the format specifier presently treats it as a `uint32_t`. This causes
a -Wformat error to be emitted by Clang 18:

	cpu/riscv_common/irq_arch.c:149:49: error: format specifies type 'unsigned int'
			   but the argument has type 'unsigned long' [-Werror,-Wformat]
	  149 |             printf("  mepc:   0x%" PRIx32 "\n", read_csr(mepc));
2024-08-12 15:09:00 +02:00
benpicco
5267300029
Merge pull request #20810 from krzysztof-cabaj/stm32l0538-disco-pinout
boards/stm32l0538-disco: addition of pinout to documentation page
2024-08-09 10:39:54 +00:00
krzysztof-cabaj
ba3878050a boards/stm32l0538-disco: add pinout to documentation page 2024-08-09 12:01:57 +02:00
krzysztof-cabaj
2c112488cc boards/stm32l0538-disco: add pinout file 2024-08-09 11:50:02 +02:00
Marian Buschsieweke
4c55f92b1b
Merge pull request #20805 from maribu/cpu/stm32/periph_gpio_ll_periph_gpio_ll_switch_dir
cpu/stm32: implement `periph_gpio_ll_switch_dir`
2024-08-08 20:34:52 +00:00
Marian Buschsieweke
8839ccbe50
cpu/stm32: implement periph_gpio_ll_switch_dir
This implements periph_gpio_ll_switch_dir for STM32 except for STM32F1,
which has a different register layout.
2024-08-08 22:17:35 +02:00
Marian Buschsieweke
af61cf40e3
tests/periph/gpio_ll: add delays to test_switch_dir()
In all other tests we added a delay after writing to the output buffer
of GPIO A before expected the input buffer of GPIO B (connected to A)
to reflect the change, but not in test_switch_dir().

This adds the delay here as well to make the test more robust in regard
to GPIO peripherals that react not as fast as the CPU can query them.
2024-08-08 16:22:36 +02:00
Marian Buschsieweke
a6b459eff3
drivers/periph/gpio_ll: change gpio_ll_switch_dir API
It turns out that the feature to switch the GPIO direction quickly
is not only a way to emulate open drain / open source mode for less
sophisticated GPIO peripherals that do not natively support it.
It also enables tri-state output (push-pull high, push-pull low,
high impedance), which is useful e.g. for driven charlieplexed LEDs
quickly.

This changes the API by introducing a `gpio_ll_prepare_switch_dir()`
function that prepares the value used to identify which pins should
be switched to input or to output mode. This is useful for GPIO
peripherals in which the GPIO mode register does not allocate one bit
per pin (so that only the direction is given there), such as the one
for STM32. This allows an STM32 implementation in which preparing the
bitmask needed to modify the direction of pins is not trivial.
2024-08-08 16:22:36 +02:00
benpicco
a1efa07c07
Merge pull request #20808 from krzysztof-cabaj/stm32l476g-pinout
boards/stm32l476g-disco: add pinout to documentation page
2024-08-07 12:50:08 +00:00
krzysztof-cabaj
abc46d7538 boards/stm32l476g-disco: add pinout to documentation page 2024-08-07 11:06:09 +02:00
krzysztof-cabaj
705dc253cb boards/stm32l476g-disco: add pinout file 2024-08-07 10:54:50 +02:00
Marian Buschsieweke
3735cc196d
Merge pull request #20679 from maribu/cpu/msp430/periph_gpio_ll
cpu/msp430: Implement periph_gpio_ll & periph_gpio_ll_irq
2024-08-05 20:19:32 +00:00
benpicco
cf1bb15c86
Merge pull request #20807 from krzysztof-cabaj/stm32l476g-PWM
boards/stm32l476g-disco: add PWM support
2024-08-05 19:10:11 +00:00
krzysztof-cabaj
72f8a8f268 boards/stm32l476g-disco: add PWM config and doxygen doc 2024-08-05 17:48:20 +02:00
Marian Buschsieweke
22df6cc6e3
Merge pull request #20804 from krzysztof-cabaj/nucleo-l053r8-DOC
boards/nucleo-l053r8: MCU table addition to doc page
2024-08-05 14:09:53 +00:00
krzysztof-cabaj
b2ef0c67d7 boards/stm32l476g-disco: add initial PWM config 2024-08-05 16:07:04 +02:00
Marian Buschsieweke
c8b65141ff
Merge pull request #20806 from maribu/boards/weact-g030f6
boards/weact-g030f6: fix use with stdio_rtt
2024-08-05 13:12:25 +00:00
Marian Buschsieweke
5a02899457
boards/weact-g030f6: fix use with stdio_rtt
Running

    USEMODULE=stdio_rtt make BOARD=weact-g030f6 -C ... flash term

failed due the programmer not being specified by the time the serial
is configured:

    makefiles/tools/serial.inc.mk:44: "Warning: No RIOT_TERMINAL set,
    but using stdio_rtt: The default terminal is likely not to work."

This reorders the setup of the board to first configure the programmer
and then the serial, so that using stdio_rtt now works out of the box.
2024-08-04 10:28:41 +02:00
Marian Buschsieweke
fc907f9251
cpu/msp430/periph_gpio: resolve conflict with GPIO LL
In case both periph_gpio_irq and periph_gpio_ll_irq are used, the
periph_gpio_irq implementation now uses periph_gpio_ll_irq, so that
they can coexist.
2024-08-02 13:41:37 +02:00
Marian Buschsieweke
355f2335d5
cpu/msp430: implement gpio_ll_irq 2024-08-02 13:41:37 +02:00
Marian Buschsieweke
1a0da9a7af
cpu/msp430: fix warnings
clock.c: The MSP430 may need nop instructions after (and in some cases
         even before) touching the global interrupt enable bit in the
         status register. The assembler generates a warning when in
         doubt. Those nops should not be needed in our cases, but maybe
         it is better two waste flash for two instructions than having
         to live with the warning.

cpu.c: drop unneeded include
2024-08-02 13:41:37 +02:00
Marian Buschsieweke
0ce7b8dfde
cpu/msp430: add periph_gpio_ll 2024-08-02 13:41:37 +02:00
Marian Buschsieweke
5db461c28b
drivers/periph_gpio_ll: always use hardware features
GPIO LL headers might be included even when not using GPIO LL. Some
functions may be provided by the common header or the platform specific
one, depending on the features used. Hence, the header can only be
safely included if the correct set of GPIO LL hardware features is used.
2024-08-02 13:41:37 +02:00
Marian Buschsieweke
422042bd00
drivers/periph_gpio_ll_irq: make support for both edges optional
The assumption that every MCU has this feature turned out wrong. Hence,
add a feature to allow testing for support of edge triggered IRQs on
both flanks.
2024-08-02 13:41:36 +02:00
Marian Buschsieweke
340caa83af
Merge pull request #20639 from maribu/drivers/periph_gpio_ll/api-change
drivers/periph_gpio_ll: change API to access GPIO ports
2024-08-02 08:11:27 +00:00
Marian Buschsieweke
4a092862f8
cpu/stm32/periph_eth: adapt to GPIO LL API change 2024-08-02 09:55:25 +02:00
Marian Buschsieweke
84a4399135
tests/periph/gpio_ll: fix randomly failing test
A test intended to ensure that a configuration toggling the direction
of a GPIO two times restores the original configuration not only
compared the configuration at the two points in time, but also the
value of the input buffer. Since a floating input reads back random
values when not externally driven, the test was actually randomly
failing. Apparently I got lucky before consistently and this never
triggered until now.

This now clears the input value from both the configuration reported
before and after toggling the direction twice and should now indeed
succeed consistently.
2024-08-02 09:55:24 +02:00
Marian Buschsieweke
97b91b4f8f
boards/stm32: use GPIO LL for LEDs
This fixes a race in `LED<NUM>_TOGGLE`, which is a read-copy-write
operation. Any access to a GPIO pin on the same GPIO port that
happens concurrently could result in data corruption. Using the
GPIO LL API, which is thread-safe, fixes the issue.

Note: The used GPIO LL functions will work even in when the GPIO LL
      module is not used.
2024-08-02 09:55:24 +02:00
Marian Buschsieweke
36e8526046
drivers/periph_gpio_ll: change API to access GPIO ports
The API was based on the assumption that GPIO ports are mapped in memory
sanely, so that a `GPIO_PORT(num)` macro would work allow for constant
folding when `num` is known and still be efficient when it is not.

Some MCUs, however, will need a look up tables to efficiently translate
GPIO port numbers to the port's base address. This will prevent the use
of such a `GPIO_PORT(num)` macro in constant initializers.

As a result, we rather provide `GPIO_PORT_0`, `GPIO_PORT_1`, etc. macros
for each GPIO port present (regardless of MCU naming scheme), as well as
`GPIO_PORT_A`, `GPIO_PORT_B`, etc. macros if (and only if) the MCU port
naming scheme uses letters rather than numbers.

These can be defined as macros to the peripheral base address even when
those are randomly mapped into the address space. In addition, a C
function `gpio_port()` replaces the role of the `GPIO_PORT()` and
`gpio_port_num()` the `GPIO_PORT_NUM()` macro. Those functions will
still be implemented as efficient as possible and will allow constant
folding where it was formerly possible. Hence, there is no downside for
MCUs with sane peripheral memory mapping, but it is highly beneficial
for the crazy ones.

There are also two benefits for the non-crazy MCUs:
1. We can now test for valid port numbers with `#ifdef GPIO_PORT_<NUM>`
    - This directly benefits the test in `tests/periph/gpio_ll`, which
      can now provide a valid GPIO port for each and every board
    - Writing to invalid memory mapped I/O addresses was treated as
      triggering undefined behavior by the compiler and used as a
      optimization opportunity
2. We can now detect at compile time if the naming scheme of the MCU
   uses letters or numbers, and produce more user friendly output.
    - This is directly applied in the test app
2024-08-02 09:55:24 +02:00
krzysztof-cabaj
95102fdbe6 boards/nucleo-l053r8: MCU table addition to doc page 2024-08-02 09:04:59 +02:00
benpicco
687a30af33
Merge pull request #20802 from miri64/mailmap/enh/tud
mailmap: add my TU Dresden e-mail address
2024-07-31 11:15:02 +00:00
Martine Lenders
9cab9e1fcf
mailmap: add my TU Dresden e-mail address 2024-07-31 10:54:57 +02:00
Martine Lenders
11ea4a359d
Merge pull request #20801 from Teufelchen1/fix/dhcpv6
net/dhcpv6: Improve option handling in dhcpv6 advertise
2024-07-31 07:51:42 +00:00
Bennet Blischke
cc9855b3ae net/dhcpv6: Improve option handling in dhcpv6 advertise 2024-07-30 19:21:09 +02:00
mguetschow
2d6d3acce7
Merge pull request #20797 from mguetschow/2024.07-release-notes
release-notes.txt: add 2024.07 release notes
2024-07-30 17:13:35 +00:00
Mikolai Gütschow
79734f946f
release-notes.txt: add 2024.07 release notes
Co-authored-by: Marian Buschsieweke <maribu@users.noreply.github.com>
Co-authored-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
Co-authored-by: Teufelchen1 <bennet.blischke@haw-hamburg.de>
Co-authored-by: Marian Buschsieweke <maribu@users.noreply.github.com>
2024-07-30 18:55:50 +02:00
Teufelchen
1e6164fd68
Merge pull request #20549 from chrysn-pull-requests/gcoap-asan
gcoap: Avoid reading beyond defined input buffer
2024-07-30 10:13:41 +00:00
mguetschow
fe3a4e24a1
Merge pull request #20798 from benpicco/gcoap-fix-guards
net/gcoap: fix guards around defines
2024-07-30 08:13:06 +00:00
Benjamin Valentin
2aaaf6df9e net/gcoap: fix guards around defines 2024-07-29 19:04:15 +02:00
benpicco
9781bc0ad3
Merge pull request #20757 from xnumad/offl-lifetimes
gnrc/ipv6: Store all SLAAC prefixes
2024-07-29 14:06:22 +00:00
benpicco
41204c8b81
Merge pull request #20450 from benpicco/THREAD_CREATE_STACKTEST-delete
core/thread: always use THREAD_CREATE_STACKTEST when DEVELHELP is enabled
2024-07-29 11:52:06 +00:00
Benjamin Valentin
0fbc10fb45 core/thread: introduce THREAD_CREATE_NO_STACKTEST 2024-07-29 11:45:58 +02:00
Benjamin Valentin
312a550f1a treewide: remove THREAD_CREATE_STACKTEST from thread creation 2024-07-29 11:45:58 +02:00
Benjamin Valentin
b1d3825c27 core/thread: always use THREAD_CREATE_STACKTEST with DEVELHELP 2024-07-29 11:45:58 +02:00
xnumad
e25066768b gnrc/ipv6: Store all SLAAC prefixes
Incl. off-link ones, since lifetimes for the autoconfigured addresses are managed by the prefix entry.
2024-07-28 09:53:55 +02:00
benpicco
d2fa0c6ce1
Merge pull request #20796 from krzysztof-cabaj/examples-leds_shell-fix-segfault
examples/leds_shell: use periph_gpio_mock on native
2024-07-26 15:45:07 +00:00
krzysztof-cabaj
ca9835fc53 examples/leds_shell: fix segfault 2024-07-26 17:40:21 +02:00
benpicco
9afad95487
Merge pull request #20793 from krzysztof-cabaj/stm32l476g-ADC
boards/stm32l476g-disco: add ADC support
2024-07-24 16:47:19 +00:00