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

1049 Commits

Author SHA1 Message Date
Marian Buschsieweke
5381b6187f
boards/wemos-zero: fix Arduio I/O Map
Two pins were incorrectly mapped because D2 and D4 are swapped on the
WeMos zero compared to the Arduino Zero. This takes the difference
into account.
2024-11-19 13:12:03 +01:00
crasbe
168829f865 boards/nrf52: always recover device before flashing with OpenOCD 2024-11-08 16:04:35 +01:00
Benjamin Valentin
0047222124 boards/saml10-xpro: enable ATECC508A 2024-10-16 16:44:20 +02:00
Marian Buschsieweke
cbf06649aa
boards/common/arduino-zero: Add Arudino SPI mapping
The Arduino Zero based boards already provided the feature
`arduino_spi`, but were missing the corresponding mapping. This fixes
the issue by adding the SPI bus numbers for the ISP SPI bus and the
D11D12D13 SPI bus.

(And in order to actually add the D11D12D13 SPI bus, the `periph_conf.h`
was extended to provide an SPI configuration for it.)
2024-10-01 18:27:33 +02:00
Dylan Laduranty
82ce32ee10 boards/saml1x: convert bitfields to new masks name
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2024-09-08 15:17:34 +02:00
chrysn
7ea574fd20 boards/particle-xenon: Don't provide LED[012] if they are used by SAUL
Otherwise they show as provided but do not have any effect.
2024-08-26 11:12:51 +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
Mikolai Gütschow
bb97445b20
boards/*: include periph/gpio.h in board.h 2024-07-12 15:02:43 +02:00
Marian Buschsieweke
798793e60a
build system: add netif_openwsn feature
Boards / MCUs now provide the newly introduced  netif_openwsn feature
if they have a network interface supported by OpenWSN.
2024-05-27 22:56:37 +02:00
Marian Buschsieweke
77dfc7e2a5
boards/esp32*: move saul_gpio dep to board level
The ESP32 Ethernet Kit has only a single GPIO pin exposed to SAUL via
`saul_gpio`, but that GPIO doubles as PHY clock input when `esp32_eth`
is used. Hence, the `saul_gpio` dep should be optional and only kick
in when `esp32_eth` is not used.
2024-05-22 13:38:33 +02:00
Marian Buschsieweke
97a6543c10
tree-wide: Introduce netif feature and use it
This gets rid of a long list of boards with network interfaces and
instead let's boards (or MCUs with peripheral network interfaces)
provide the netif feature.

The apps that before used the long list are not depending on the
feature instead (in case of the default example, this is an
optional dependency).

Co-authored-by: mguetschow <mikolai.guetschow@tu-dresden.de>
Co-authored-by: mewen.berthelot <mewen.berthelot@orange.com>
2024-05-22 10:39:56 +02:00
benpicco
772bc7a876
Merge pull request #20617 from Enoch247/simplify-stm32-ifdefs
boards/common/stm32: simplify ifdef logic
2024-04-24 12:57:47 +00:00
Joshua DeWeese
3152301c3f boards/common/stm32: simplify ifdef logic 2024-04-23 16:31:01 -04:00
Joshua DeWeese
fe3a6ba462 boards/common/nucleo144: revert waitespace changes
This commit reverts the whitespace changes from commit
53d53d8cc8
2024-04-23 11:13:48 -04:00
crasbe
6f0e81fb34 boards/nRF52xx: correctly set JLINK_DEVICE 2024-04-22 11:25:08 +02:00
MrKevinWeiss
e0fdc3c16c
*Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
MrKevinWeiss
7a68fb0d5e
*Kconfig*: Remove dep-only Kconfig files 2024-03-26 14:54:22 +01:00
Ollrogge
53d53d8cc8 boards/nucleo-u575zi-q: Add support 2024-03-01 11:18:18 +01:00
Marian Buschsieweke
38ab1472e6
boards/common/makefiles/stdio_cdc_acm.dep.mk: fix
This fixes compilation issues in `tests/pkg/tinyusb_netdev` with
newer versions of the RISC-V toolchain due to two competing USB
stacks being pulled in. With the older toolchain the build system
warns:

    The following features may conflict: periph_usbdev tinyusb_device

But builds fine (even though surprises at runtime are likely). The
newer toolchain takes an issue with the same symbol being linked
in more than once (and more than one instance not being `weak`).
2024-02-12 19:55:40 +01:00
Marian Buschsieweke
8403f6b7cc
boards/common/nrf52: add OpenOCD's RIOT awareness
This enables RIOT awareness in OpenOCD, so that `info threads` actually
shows RIOT's threads.
2024-02-02 12:25:11 +01:00
benpicco
4ea27d4c13
Merge pull request #20300 from jparker324/stm32c0_and_nucleo_c031c6
cpu/stm32: add support for STM32C0 and NUCLEO-C031C6
2024-01-31 15:09:25 +00:00
Jason Parker
a2f4a13beb boards/nucleo-c031c6 initial add 2024-01-30 10:11:57 -05:00
Marian Buschsieweke
c6c5d9a1a7
boards/common/gd32v: reorder members in initialization
C has this feature that the order of struct members in the
initialization doesn't need to match the order in the declaration.
C++ has not yet caught up:

    boards/common/gd32v/include/cfg_usbdev_default.h:50:1: error: designator order for field 'dwc2_usb_otg_fshs_config_t::type' does not match declaration order in 'const dwc2_usb_otg_fshs_config_t'

So, just reorder the fields for now by hand.
2024-01-20 16:42:49 +01:00
Marian Buschsieweke
9fbb23b167
boards/common/gd32v: make common OpenOCD config opt-in
Let boards explicitly use the common OpenOCD config if it works for
them, rather than having boards with specific needs opt out.
2024-01-19 23:17:35 +01:00
Marian Buschsieweke
f22fc0080b
boards/common/gd32v: Allow overwriting OPENOCD_TRANSPORT 2024-01-17 09:16:26 +01:00
Gunar Schorcht
a376b3c915 boards/common/esp32x: add sanity check for SPI in case SDMMC is used 2024-01-05 07:22:27 +01:00
Gunar Schorcht
5646cc02e4 boards/common/esp32x: add SDMMC support 2024-01-05 07:22:27 +01:00
MrKevinWeiss
fb5ebea1a5
boards/common/e104-bt50xxa-tb: Override WS281X_TIMER_* 2023-12-19 11:13:44 +01:00
MrKevinWeiss
0d31432cb3
boards/nrf51: Defined TIMER_x_MAX_VALUE 2023-12-19 11:13:44 +01:00
chrysn
d32c32ffae
boards/nrf52: Defined TIMER_x_MAX_VALUE
The macro's presence is documented in `timer_init`, but was missing from
this platform.
2023-12-19 11:13:41 +01:00
Marian Buschsieweke
bb07bb6613
Merge pull request #20160 from maribu/cpu/msp430/timer
cpu/msp430: improve periph_timer
2023-12-10 13:02:30 +00:00
Marian Buschsieweke
b51ea4ca24
boards: clean up MSP430 board configuration
Move common configuration for MSP430 based boards to
`boards/common/msp430` and make use of that.
2023-12-10 09:11:24 +01:00
Gunar Schorcht
26030e28af boards: remove extern mtd_dev_t* Declarations 2023-12-07 15:32:49 +01:00
Marian Buschsieweke
3848a37d14
boards/nucleo-f303re: add more timers 2023-11-21 09:02:31 +01:00
Kyle Burk
986488db85
cpu/stm32/f1: prevent corrupting AFIO->MAPR
The `SWJ_CFG` field of the `AFIO_MAPR` register is write only and values
read are undefined (random). Hence, using `AFIO->MAPR |= mask;` to
enable flags can corrupt the state of the `SWJ_CFG` (configure it to
an unintended value).

Two helper functions have been introduced:
- `afio_mapr_read()` reads the value, but sanitizes the `SWJ_CFG` field
  to zero
- `afio_mapr_write()` writes the given value, but applies the `SWJ_CFG`
  configured by the board before writing.

Finally, the `nucleo-f103rb` and `bluepill*`/`blackpill*` boards have
been updated to no longer specify `STM32F1_DISABLE_JTAG`, as this
is handled by the `SWJ_CFG` setting (which defaults to disabling JTAG).
2023-11-20 20:28:52 +01:00
Marian Buschsieweke
7446cf543a
boards/common/nucleo64: fix doc 2023-11-15 09:57:42 +01:00
Gunar Schorcht
03e2537be5 boards/common/esp32x: fix doxygen group 2023-11-09 16:46:09 +01:00
Gunar Schorcht
46040a4361 boards: use XFA with MTD pointers for defined MTDs 2023-10-02 12:28:08 +02:00
Gunar Schorcht
c80591779f boards: fix references in documentation 2023-09-27 09:12:06 +02:00
bors[bot]
1691dbe0d3
Merge #19914 #19915
19914: boards: complete SD Card MTD definition for several bords r=benpicco a=gschorcht

### Contribution description

This PR completes the MTD definition for the following boards:
- `seeedstudio-gd32`
- `sipeed-longan-nano` including `sipeed-longan-nano-tft`
- `waveshare-nrf52840-eval-kit`
- ESP32x boards that have an SPI SD Card interface and use `mtd_sdcard_default`

### Testing procedure

Green CI

### Issues/PRs references#19465 

Prerequisite for PR #19465 

19915: drivers/lcd: support MCU 8080 8-bit parallel mode r=benpicco a=gschorcht

### Contribution description

LCD driver ICs usually support
- SPI serial mode,
- MCU 8080 8-bit parallel mode and
- MCU 8080 16-bit parallel mode.

This PR extends the LCD display driver API to support the MCU 8080 8-/16-bit parallel modes and implements a GPIO-driven MCU 8080 8-bit parallel mode.

The following features are already working locally and will be provided as follow-on PRs for which this PR is a prerequisite.

- GPIO-driven bit-banging implementation of the 16-bit mode of the MCU 8080 parallel interface
- Enabling the display on `stm32f723e-disco` and `stm32l496g-disco` using the feature above
- Definition of a low-level API for the parallel modes using the LCD controller of the MCU
- Using FMC for the display on `stm32f723e-disco` and `stm32l496g-disco`
- Using LCD controller for the display of `esp32-wt32-sc01-plus` (PR #19917)

### Testing procedure

The PR can be tested with PR #19917 on top of this PR.
```
BOARD=esp32s3-wt32-sc01-plus make -j8 -C tests/drivers/st77xx flash
```
The following video shows the test.

**Please note** The test is pretty slow because the display has 480 x 320 pixels and the MCU 8080 8-bit parallel interface is realized by a GPIO-driven bit-banging implementation where each GPIO of the data bus is set separately. A follow-up PR will use the ESP32-S3 LCD controller and DMA for this board. This PR just defines the extension of the driver by the parallel interface and provides the bit-banging implementation for MCUs that don't have a LCD controller on chip.

https://github.com/RIOT-OS/RIOT/assets/31932013/c1e3e3d7-05d9-4ca5-8fff-9a5eaca50fba

### Issues/PRs references

Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-09-20 15:55:34 +00:00
Gunar Schorcht
bf981c81ba boards: complete SD Card MTD definition 2023-09-20 14:15:42 +02:00
Marian Buschsieweke
4524880581
boards/nucleo64: fix SPI Arduino mapping for most boards
Before, the Arduino SPI mapping for all Nucleo-64 boards was
incorrect. With this, the situation improves to the following:

- [x] nucleo-f030r8
- [ ] nucleo-f070rb
    - No SPI buses provided
- [x] nucleo-f072rb
- [x] nucleo-f091rc
- [x] nucleo-f103rb
- [ ] nucleo-f302r8
    - No SPI bus at D11, D12, D13 provided
- [x] nucleo-f303re
- [x] nucleo-f334r8
- [x] nucleo-f401re
- [x] nucleo-f410rb
- [x] nucleo-f411re
- [x] nucleo-f446re
- [x] nucleo-g070rb
- [x] nucleo-g071rb
- [x] nucleo-g431rb
- [x] nucleo-g474re
- [x] nucleo-l053r8
- [x] nucleo-l073rz
- [x] nucleo-l152re
- [ ] nucleo-l433rc
    - No SPI bus at D11, D12, D13 provided
- [x] nucleo-l452re
- [x] nucleo-l476rg
- [x] nucleo-wl55jc

The remaining offenders still need to be fixed, but that is better done
one PR at a time.
2023-09-20 10:49:40 +02:00
Lena Boeckmann
40902cd947 pkg/cryptoauthlib: Add PSA Wrappers 2023-08-31 14:38:50 +02:00
Gunar Schorcht
89846f8cea boards/common/gd32v: cleanup default I2C and SPI config
This commit includes the following cleanups:
- The macros `I2C_DEV_1_USED` and `SPI_DEV_1_USED` are now used with the values 0 and 1. This allows to enable but also to disable the second interface even if the board definition enables it by default.
- The second I2C device `I2C_DEV(1)` and the second SPI device `SPI_DEV(1)` are now disabled by default.
- The second SPI device `SPI_DEV(1)` now uses PB5 as default CS signal instead of PA4 to keep PA4 free for ADC or DAC even if `SPI_DEV(1)` is used, for example for the TFT display.
2023-08-07 12:48:15 +02:00
Hugues Larrive
e8327a4a9a boards/atmega8: new board 2023-07-11 21:22:02 +02:00
bors[bot]
37c6233bcb
Merge #19764 #19781
19764: drivers/shield_w5100: add module for the W5100 Ethernet Shield r=benpicco a=maribu

### Contribution description

This module provides no more than the correct configuration parameters for the `w5100` driver using the Arduino I/O mapping features. But by doing so, it will work out of the box with every mechanically and electrically compatible board for which the Arduino I/O mapping features are implemented.


19781: cpu/nrf{53,9160}: add pwm support r=benpicco a=dylad

### Contribution description

This PR moves the nRF52 PWM driver to `cpu/nrf5x_common` to allow nRF9160 and nRF53 to use this driver.
IP is identical on these families.

I didn't test on nRF9160DK and I didn't test if there is any regression on nRF52-based board as I don't have any so tests are welcome !
However it works fine on nRF53-based board.


### Testing procedure

Flash the `tests/periph/pwm` test application on `nrf5340dk` or `nrf9160dk`.
You can then use the `osci` command to make the onboard LEDs "breath".
You can also attach an oscilloscope and/or logic analyzer to watch the signal.


### Issues/PRs references
~~Based on #19769~~

Co-authored-by: Marian Buschsieweke <marian.buschsieweke@posteo.net>
Co-authored-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
Co-authored-by: dylad <dylan.laduranty@mesotic.com>
2023-07-10 10:51:20 +00:00
bors[bot]
a345e00fa6
Merge #19789 #19796 #19802 #19803
19789: cpu/nrf5x/periph/wdt: enable support for nRF53/nRF9160 r=benpicco a=dylad

### Contribution description

This PR enables support for the watchdog driver on nRF53.
This MCU has two watchdog peripherals, for now, it only uses the first one.
The use of the second watchdog can be add in a followup PR later.


### Testing procedure
Flash and play with `tests/periph/wdt` application.


### Issues/PRs references
None.


19796: boards/b_u585i_ iot02a/periph usbdev r=benpicco a=gschorcht

### Contribution description

This PR adds the USB OTG support for STM32U5 and the `b_u585i_iot02a` board.

This PR includes PR #19795 since it uses directly the changes made in PR #19795.

### Testing procedure

Compile and flash
```
BOARD=b-u585i-iot02a make -C tests/sys/usbus_cdc_ecm/ flash term
```
Use the `sudo dmesg` command to get the kernel messages.
```pyhon
[766948.556645] usb 1-2.2: new full-speed USB device number 108 using xhci_hcd
[766948.658688] usb 1-2.2: New USB device found, idVendor=1209, idProduct=7d00, bcdDevice= 1.00
[766948.658696] usb 1-2.2: New USB device strings: Mfr=3, Product=2, SerialNumber=4
[766948.658699] usb 1-2.2: Product: b-u585i-iot02a
[766948.658702] usb 1-2.2: Manufacturer: RIOT-os.org
[766948.658704] usb 1-2.2: SerialNumber: AA140057DA41D467
[766948.668681] cdc_ether 1-2.2:1.0 usb0: register 'cdc_ether' at usb-0000:00:14.0-2.2, CDC Ethernet Device, ea:dc:44:71:d9:24
[766948.743250] cdc_ether 1-2.2:1.0 enxeadc4471d924: renamed from usb0
```
Use the `ifconfig` command on the node to determine the IPv6 LLUA and ping the node.
```
ping6 -c 3 fe80::e8dc:44ff:fe71:c524%enxeadc4471d924
PING fe80::e8dc:44ff:fe71:c524%enxeadc4471d924(fe80::e8dc:44ff:fe71:c524%enxeadc4471d924) 56 data bytes
64 bytes from fe80::e8dc:44ff:fe71:c524%enxeadc4471d924: icmp_seq=1 ttl=64 time=0.523 ms
64 bytes from fe80::e8dc:44ff:fe71:c524%enxeadc4471d924: icmp_seq=2 ttl=64 time=0.546 ms
64 bytes from fe80::e8dc:44ff:fe71:c524%enxeadc4471d924: icmp_seq=3 ttl=64 time=0.599 ms
```

### Issues/PRs references

Includes PR #19795 

19802: cpu/nrf53: enable flashpage support r=benpicco a=dylad

### Contribution description
This PR enables flashpage support on nRF53 family.
The peripheral is identical to nRF52, just add the flashpage configuration and enable the module in both Makefiles.features and Kconfig.


### Testing procedure
run `/tests/periph/flashpage` on `nrf5340dk-app`

output of `make BOARD=nrf5340dk-app flash test`


```
/home/dylan/work/RIOT/dist/tools/pyterm/pyterm -p "/dev/ttyACM0" -b "115200" --no-reconnect --noprefix --no-repeat-command-on-empty-line 
Twisted not available, please install it if you want to use pyterm's JSON capabilities
Connect to serial port /dev/ttyACM0
Welcome to pyterm!
Type '/exit' to exit.

> 
> 
test_last_raw

> test_last_raw
wrote raw short buffer to last flash page
> help
help
Command              Description
---------------------------------------
info                 Show information about pages
dump                 Dump the selected page to STDOUT
dump_local           Dump the local page buffer to STDOUT
read                 Copy the given page to the local page buffer and dump to STDOUT
write                Write the local page buffer to the given page
write_raw            Write (ASCII, max 64B) data to the given address
erase                Erase the given page buffer
edit                 Write bytes to the local page buffer
test                 Write and verify test pattern
test_last_pagewise   Write and verify test pattern on last page available
test_last_pagewise
test_reserved_pagewise Write and verify short write on reserved page
test_last_raw        Write and verify raw short write on last page available
> test_last_pagewise
wrote local page buffer to last flash page
> help
help
Command              Description
---------------------------------------
info                 Show information about pages
dump                 Dump the selected page to STDOUT
dump_local           Dump the local page buffer to STDOUT
read                 Copy the given page to the local page buffer and dump to STDOUT
write                Write the local page buffer to the given page
write_raw            Write (ASCII, max 64B) data to the given address
erase                Erase the given page buffer
edit                 Write bytes to the local page buffer
test                 Write and verify test pattern
test_last_pagewise   Write and verify test pattern on last page available
test_reserved_pagewise Write and verify short write on reserved page
test_reserved_pagewise
test_last_raw        Write and verify raw short write on last page available
> test_reserved_pagewise
Reserved page num: 5 
Since the last firmware update this test has been run 0 times 
wrote local page buffer to reserved flash page

When running on a bootloader, as an extra check, try restarting the board and check whether this application still comes up.
> help
help
Command              Description
---------------------------------------
info                 Show information about pages
dump                 Dump the selected page to STDOUT
dump_local           Dump the local page buffer to STDOUT
read                 Copy the given page to the local page buffer and dump to STDOUT
write                Write the local page buffer to the given page
write_raw            Write (ASCII, max 64B) data to the given address
erase                Erase the given page buffer
edit                 Write bytes to the local page buffer
test                 Write and verify test pattern
test_last_pagewise   Write and verify test pattern on last page available
test_reserved_pagewise Write and verify short write on reserved page
test_last_raw        Write and verify raw short write on last page available
> 
make : on quitte le répertoire « /home/dylan/work/RIOT/tests/periph/flashpage »

```
### Issues/PRs references
None.


19803: cpu/nrf5x_common: rework LFCLK source selection r=benpicco a=dylad

### Contribution description
This PR changes the source selection of LFCLK for all nRF families.
This idea is to use the values provided by Nordic vendor files to properly populate the source of the LFCLK. Then setup a per CPU check to ensure the value provided at board level is fine. In the end, the LFCLK source selection is a mere assignment.
The selection of the LFCLK source is still done at board level. I also add a bit of documentation to help users to select another value if needed.


I'll provide in a followup PR, `periph_rtt` support for both nRF9160 and nRF53.

### Testing procedure
CI should be enough I think. Otherwise, one can ran tests/periph/rtt on any nRF51-based board and any nRF52-based board.
You can also change the LFCLK source at board level to ensure the guards are doing their jobs.

### Issues/PRs references
None.

Co-authored-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-07-06 14:57:33 +00:00
Dylan Laduranty
0a5d07c391 boards/nrfxx: update LFCLK selection to be more generic
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2023-07-06 15:41:34 +02:00
Gunar Schorcht
db10337b11 boards/common/stm32: add common USB OTG FS config for U5 family 2023-07-05 09:41:15 +02:00