Commit graph

33 commits

Author SHA1 Message Date
Marc Desvaux 08720b0d2a dts: arm: st: nodes moved from <boards>.dts to <soc>.dtsi
stm32l5x/u5x/g4x/l4x/g0x/wlx/wbx power-states node moved
from <boards>.dts to <soc>.dtsi

Signed-off-by: Marc Desvaux <marc.desvaux-ext@st.com>
2023-03-14 10:50:09 +01:00
Erwan Gouriou 5cebe4c332 boards: nucleo_g0b1re: Enable FDCAN node
Enable FDCAN node on nucleo_g0b1re.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2023-02-06 10:06:57 +01:00
Erwan Gouriou 69cc659c92 boards: stm32: fix --reset argument for stm32cubeprogrammer runner
stm32cubeprogrammer runner takes a --reset-mode argument to specify the
type of reset used in the flashing process.
Though, argparse default configuration in python allows shortened command
arguments and it happened that --reset was used on most boards instead
of --reset-mode.
This argparse configuration is being changed in order to prevent shortened
command  args (see #53495). As a consequence all board configs using
--reset should be updated to use the full length version.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2023-01-05 11:16:03 -06:00
Erwan Gouriou 33d14f49a6 boards: nucleo_g0b1re: enables HSI48 clock for USB
Enables the HSI48 clock on the nucleo_g0b1re platform.
Fix warning when building USB related samples.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-12-13 08:23:57 -05:00
Guillaume Gautier dbbfff5002 boards: arm: Add RTC clock source for STM32 boards dts
For every board using an STM32, add the RTC clock source in its dts

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2022-11-10 11:27:49 +00:00
Gerard Marull-Paretas e81e92dbb9 boards: convert images to JPEG and reduce image size
The boards folder uses ~142.8 MB, being the largest in the repository.
This is due mostly to board images, which are in most cases not
optimized for web content. This patch tries to address this problem by
converting all pictures to JPEG (quality 75) and by adjusting its size
up to 750 px (the width of the documentation content). Images that
specified a fixed width in rst files are converted down to that value
instead.

With this patch, folder goes down to ~53.5 MB from 142.8 MB (-~63%).
Note that this patch introduces a new set of binary files to git
history, though (bad).

The process has been automated using this quickly crafted Python script:

```python
from pathlib import Path
import re
import subprocess

def process(doc, image, image_jpeg, size):
    subprocess.run(
        (
	     f"convert {image}"
	     "-background white -alpha remove -alpha off -quality 75"
	     f"-resize {size}\> {image_jpeg}"
	),
        shell=True,
        check=True,
        cwd=doc.parent,
    )
    if image != image_jpeg:
        (doc.parent / image).unlink()

for doc in Path(".").glob("boards/**/*.rst"):
    with open(doc) as f:
        content = ""
        image = None
        for line in f:
            m = re.match(r"^(\s*)\.\. (image|figure):: (.*)$", line)
            if m:
                if image:
                    process(doc, image, image_jpeg, size)

                image = Path(m.group(3))
                if image.suffix not in (".jpg", ".jpeg", ".png"):
                    content += line
                    image = None
                    continue

                image_jpeg = image.parent / (image.stem + ".jpg")
                size = 750
                content += (
                    f"{m.group(1)}.. {m.group(2)}:: {image_jpeg}\n"
                )
            elif image:
                m = re.match(r"\s*:height:\s*[0-9]+.*$", line)
                if m:
                    continue

                m = re.match(r"\s*:width:\s*([0-9]+).*$", line)
                if m:
                    size = min(int(m.group(1)), size)
                    continue

                content += line
                if line == "\n":
                    process(doc, image, image_jpeg, size)
                    image = None
            else:
                content += line

    with open(doc, "w") as f:
        f.write(content)
```

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-29 10:18:18 +02:00
TLIG Dhaou d97b51d248 boards: arm: Enable the die-temp capabilities of ADC
-Enable the die-temp capabilities of ADC in each dts file of stm32
 boards where it is available.
-Execute the testcase running the samples/sensor/stm32_temp_sensor on each
 available target board.

Signed-off-by: TLIG Dhaou <dhaou.tlig-ext@st.com>
2022-08-24 11:35:45 +02:00
Erwan Gouriou ddd6207ce5 boards: stm32: Define lptim domain clock using device tree
Convert lptim configuration from Kconfig to device tree.
Note that some boards were using Kconfig default value (LSI),
which now has to be made explicit using device tree.

If not done already, enable the required clock node (lse/lsi).

Clean up related Kconfig bits when required.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-08-12 08:50:29 +01:00
Benjamin Björnsson ab4a926c27 boards: Add alias to boards with watchdog enabled
Add alias to boards with watchdog enabled to facilitate the
move of samples/drivers/watchdog to use DT_ALIAS.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-07-19 09:28:43 -05:00
TLIG Dhaou 4de1d01956 boards: stm32: use size helpers to describe size of storage partition
The goal of this commit is to update existing STM32 boards descriptions
to use these size "DT_SIZE" macros to enhance readability. To realize this
i used a python script, which will detect the STM32 Boards
/zephyr/board/arm, and then will update in the dts files the partition
description using "DT_SIZE_K" and "DT_SIZE_M" macros.
Check manually and modify in .overlay files in samples and tests.

Signed-off-by: TLIG Dhaou <dhaou.tlig-ext@st.com>
2022-05-10 09:22:43 -05:00
Gerard Marull-Paretas b1ae0b6bd1 boards: arm: nucleo_g0b1re: update pinctrl node file
The file with pinctrl nodes has been updated to
st/g0/stm32g0b1r(b-c-e)tx-pinctrl.dtsi for this board.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-05 14:33:06 -05:00
Nazar Kazakov f483b1bc4c everywhere: fix typos
Fix a lot of typos

Signed-off-by: Nazar Kazakov <nazar.kazakov.work@gmail.com>
2022-03-18 13:24:08 -04:00
Erwan Gouriou 955ef39623 boards: stm32: Remove use of CONFIG_PINMUX
Now that all drivers and all boards have been converted to the
use of PINCTRL, remove usage of PINMUX.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-11-26 11:36:42 +01:00
Erwan Gouriou 1d14517ede boards: arm: stm32: add pinctrl state name for PWM peripheral
Add the pinctrl state name (default) for the PWM peripherals.
Changes performed based on the script proposed in
"boards: arm: stm32: add pinctrl state name for UART peripheral"

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-11-26 11:36:42 +01:00
Erwan Gouriou ad4e5d85fe boards: arm: stm32: add pinctrl state name for USB peripheral
Add the pinctrl state name (default) for the USB peripherals.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-11-26 11:36:42 +01:00
Erwan Gouriou 1c66ccdac3 boards: arm: stm32: add pinctrl state name for SPI peripheral
Add the pinctrl state name (default) for the CAN peripherals.
Changes performed based on the script proposed in
"boards: arm: stm32: add pinctrl state name for UART peripheral"

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-11-26 11:36:42 +01:00
Erwan Gouriou dfbaa4149d boards: arm: stm32: add pinctrl state name for I2C peripheral
Add the pinctrl state name (default) for the I2C peripherals.
Changes performed based on the script proposed in
"boards: arm: stm32: add pinctrl state name for UART peripheral"

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-11-26 11:36:42 +01:00
Erwan Gouriou 8b0c2ca290 boards: arm: stm32: add pinctrl state name for DAC peripheral
Add the pinctrl state name (default) for the CAN peripherals.
Changes performed based on the script proposed in
"boards: arm: stm32: add pinctrl state name for UART peripheral"

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-11-26 11:36:42 +01:00
Erwan Gouriou 36204c3c80 boards: arm: stm32: add pinctrl state name for ADC peripheral
Add the pinctrl state name (default) for the ADC peripherals.
Changes performed based on the script proposed in
"boards: arm: stm32: add pinctrl state name for UART peripheral"

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-11-26 11:36:42 +01:00
Gerard Marull-Paretas 4b9c3d7134 boards: arm: stm32: add pinctrl state name for UART peripheral
Add the pinctrl state name (default) for the UART/USART/LPUART
peripherals. Changes performed using the following Python script run
from the repository root:

```
from pathlib import Path
import re

for fpath in Path(".").glob("boards/arm/**/*.dts"):
    lines = open(fpath).readlines()

    is_stm32 = False
    for line in lines:
        if "stm32" in line:
            is_stm32 = True
            break

    if not is_stm32:
        continue

    with open(fpath, "w") as f:
        for line in lines:
            f.write(line)

            m = re.match(r"(\s+)pinctrl-0.*us?art.*", line)
            if m:
                f.write(m.group(1) + "pinctrl-names = \"default\";\n")
```

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-26 11:36:42 +01:00
Gerard Marull-Paretas 070e2f0782 boards: arm: stm32: enable pinctrl driver
Enable the pin control driver on all STM32 based boards. The following
script has been used to do this task:

```
from pathlib import Path
import re

for fpath in Path(".").glob("boards/arm/**/*_defconfig"):
    lines = open(fpath).readlines()

    is_stm32 = False
    for line in lines:
        if "CONFIG_SOC_SERIES_STM32" in line:
            is_stm32 = True
            break

    if not is_stm32:
        continue

    lines += ["\n", "# enable pin controller\n", "CONFIG_PINCTRL=y\n"]

    with open(fpath, "w") as f:
        f.writelines(lines)
```

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-26 11:36:42 +01:00
Alexandre Bourdiol 877379fba4 boards: arm: stm32: move "st,prescaler" to timers instead of pwm
Prescaler was misplaced in pwm binding, instead of timers binding.
For example, TIM6/TIM7 doesn't have PWM capability,
but have a prescaler.
This change also prepares the introduction of timer based counter
(which requires prescaler at timer level)

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-11-16 09:55:30 -06:00
Yong Cong Sin 5c85dcc47f boards: nucleo_g0b1re: Enable PM support
Enable PM support for nucleo_g0b1re.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2021-09-03 09:42:09 -04:00
Erwan Gouriou 661bf176bb boards: nucleo_g01re: Missing zephyr_udc0 alternate node label
This board is missing new usb device controller alternate node label.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-08-25 18:03:31 -04:00
Yong Cong Sin ae0ef7e56a boards: arm: nucleo_g0b1re: Enable support for USB
Enable USB support for nucleo_g0b1re board.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2021-08-23 08:24:46 -04:00
Thomas Stranger 405c6977bf boards: nucleo_g0b1 add timers, move spi2, nucleo_g474, add timers
nucleo_g0b1re:
removes spi2 from arduino header pins to ST morpho pins in order to
free pins for other peripherals.
Adds tim15 with pwm on pb14, changes tim3 pwm to pb4.
As a result timers are available on arduino pins D5 and D6.

nucleo g474re:
Adds timer 3 with pwm  pin on pb4 and changes tim2 pwm pin
from pa5 to pb10.
As a result timers are available on arduino pins D5 and D6.

Use default prescaler (==1) for 32-bit timer and
10.001 for 16-bit timers as these are commonly used.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-08-13 07:33:09 -04:00
Erwan Gouriou 0d320b3d6b boards: stm32: Update pwm nodes after change of default "st,prescaler"
Since "st,prescaler" default value is now 0,
set the expected application value on board side.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-06-16 10:41:01 +02:00
Alexandre Bourdiol 8ee592368e boards: nucleo_g0b1re: Use dts for clocks configuration
Convert board to use of device tree for clocks configuration.

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-05-03 19:58:21 -04:00
Thomas Stranger 2cf23469e5 tests: driver: dma: enable tests on stm32g0 boards
Enables dma test cases loop_transfer and chan_blen_transfer
on stm32g03116_disco, nucleo_g071rb and nucleo_g0b1re.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-04-26 14:16:03 -04:00
Raúl Sánchez Siles 563a083e08 board: arm: Fix nucleo_g0b1re dts compatible
It should be st,stm32g0b1re-nucleo

Signed-off-by: Raúl Sánchez Siles <rsanchezs@k-lagan.com>
2021-03-26 08:35:21 -04:00
Raúl Sánchez Siles d6644674a4 board: arm: Fix nucleo_g0b1re arduino connector dts
According to ST documentation for nucleo-g0b1re board:
https://my.st.com/resource/en/schematic_pack/mb1360-g0b1re-c02_schematic.pdf
the D0 and D1 lines in the Arduino UNO connector are mapped to the PC5
and PC4 pins.

Signed-off-by: Raúl Sánchez Siles <rsanchezs@k-lagan.com>
2021-03-26 08:35:21 -04:00
Raúl Sánchez Siles 60a368deb0 board: arm: Fix nucleo_g0b1re dts warnings.
* Removed leading 0 from slot0_partition starting offset
* Fixed slot1_partition starting offset

This fixes the following warnings:

nucleo_g0b1re.dts.pre.tmp:1749.36-1752.5: Warning
 (unit_address_format):
 /soc/flash-controller@40022000/flash@8000000/partitions/
 partition@0C000:unit name should not have leading 0s
warning: unit address and first address in 'reg' (0x3e000) don't match
 for /soc/flash-controller@40022000/flash@8000000/partitions/
 partition@31000

Signed-off-by: Raúl Sánchez Siles <rsanchezs@k-lagan.com>
2021-03-26 08:35:21 -04:00
Thomas Stranger 64a4328ca0 board: arm: add support for the nucleo_g0b1re board
Support for the nucleo_g0b1re.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-03-17 11:30:20 +01:00