Commit Graph

92 Commits

Author SHA1 Message Date
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
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
Benjamin Björnsson
c130b16ef3 boards: arm: nucleo_f207zg: Add PWM LEDs to board DTS
This commit adds PWM LEDs to the boards DTS. This was
verified by running the pwm_leds example.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-04-26 09:00:33 +02: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
ed5ea6022a boards: arm: stm32: add pinctrl state name for ethernet peripheral
Add the pinctrl state name (default) for the ethernet peripherals.

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
Johann Fischer
e4f894788a boards: add zephyr_udc0 nodelabel to all boards with USB support
USB devicetree nodes in Zephyr have different names,
mostly derived from the designations in data sheets.
Add zephyr_udc0 (USB device controller) nodelabel to
specific USB node to allow generic USB sample to be build.

Follow up on commit b4242a8 ("boards: add USB node aliases")

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-19 16:56:54 +02:00
Francois Ramu
d074d07062 boards: arm: nucleo_f207zg: DTS and Documentation updates
This commit updates the DTS and documentation with DMA feature.
only the DMA2 is enable here.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-07-29 11:48:23 -04:00
Krishna Mohan Dani
dea03d4c2d boards/arm: nucleo_f207zg: Enabling true rng (Random Number Generator)
This commit enables true rng for nucleo_f207zg platform. This has been
tested with tests/drivers/entropy/api and is working as expected.

Signed-off-by: Krishna Mohan Dani <krishnamohan.d@hcl.com>
2021-07-15 06:46:18 -04:00
Alexandre Bourdiol
bba34064ee boards: arm: nucleo_f207zg: full Arduino SPI support
Full Arduino SPI support for nucleo_f207zg

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-06-29 11:32:15 -04:00
Krishna Mohan Dani
fcc38a9080 boards/arm: nucleo_f207zg: Enabling flash support in device tree.
This commit enables flash support for nucleo-f207zg in device tree.
The last sector of 128KB is used as storage partition.

Signed-off-by: Krishna Mohan Dani <krishnamohan.d@hcl.com>
2021-06-17 12:40:39 +02:00
Alexandre Bourdiol
704a0e4cb0 boards: nucleo_f207zg: 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:06 -04:00
Sidhdharth Yadav
679df67940 boards: arm: enable PWM support for nucleo_f207zg in device tree
Enabling PWM for STM32 nucleo_f207zg in device tree.

Signed-off-by: Sidhdharth Yadav <sidhdharth.yadav@hcl.com>
2021-04-16 15:15:27 -05:00
Krishna Mohan Dani
c4325aa800 boards/arm: Nucleo_F207zg: Enabling I2C support in device tree.
Enabling I2C support for Nucleo-F207zg in device tree.
This has been tested with mpu6050 sample application on I2C-1.
Documentation has been updated.

Signed-off-by: Krishna Mohan Dani <krishnamohan.d@hcl.com>
2021-03-26 15:31:59 -04:00
Krishna Mohan Dani
3a6baa3e09 boards/arm: Nucleo_F207zg: Enabling SPI support in device tree
Enabling SPI support for Nucleo-F207zg in device tree.
This has been tested with test_spi_loopback on SPI-1.
Documentation has been updated.

Signed-off-by: Krishna Mohan Dani <krishnamohan.d@hcl.com>
2021-03-26 08:26:01 -04:00
Gerard Marull-Paretas
05f903f307 boards: arm: nucleo_f207zg: enable backup SRAM
Enable backup SRAM DT node and update documentation.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-02-15 08:04:24 -05:00
Erwan Gouriou
bf62ef172e boards: stm32: Remove pinmux.c files
Following migration of pinctrl configuration from pinmux.c files
to device tree and deprecation of pinctrl defines, remove
pinmux.c files when possible.
Additionally remove the CMakeLists.txt files when it makes sense.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-11-03 11:11:04 +01:00
Erwan Gouriou
199cf5668b boards: stm32: Move USB pins to device tree configuration
Move STM32 based board USB pin configuration to device tree.

Exceptions:
* olimex_stm32_h407: Node not enabled and not documented.
Signal added in disabled node.
* L0/G4 based boards as signals are not available yet.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-11-02 09:17:09 -06:00
Gerard Marull-Paretas
fc9f9059b5 boards: arm: move ethernet pinmux to DT pinctrl on all STM32 boards
Move Ethernet pinmux settings to DT pinctrl on all boards based on
STM32.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-10-30 15:54:13 +01:00
Martin Jäger
cd908d9085 boards: arm: stm32: use DT for ADC pinmux
Use the new DT facilities to configure ADC pinmux on all boards with
STM32 MCUs currently supporting the ADC.

Signed-off-by: Martin Jäger <martin@libre.solar>
2020-10-14 07:15:12 -05:00
Martin Jäger
c765b92944 boards: arm: nucleo stm32: use DT for DAC pinmux
Use the new DT facilities to configure DAC pinmux on all STM32 nucleo
boards currently supporting the DAC.

Signed-off-by: Martin Jäger <martin@libre.solar>
2020-10-12 08:49:36 -05:00
Jeremy LOCHE
13a32f045c boards: nucleo_f207zg: configure serial pins from DT
usart3, usart6 pinmuxes are now configured from DT pinctrl.

Signed-off-by: Jeremy LOCHE <lochejeremy@gmail.com>
2020-10-08 05:05:20 -05:00
Erwan Gouriou
3ab5ac81ca boards: stm32: Turn hardware stack protection on by default
Enable HW stack protection by default on all STM32 when possible.
This excludes all series based on M0(FO) and M0+(G0/L0).
Also this is made only on boards with enabled MPU (SRAM > 64K).

Cf similar change on nRF boards: #28470

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-09-30 10:46:16 -05:00
Erwan Gouriou
8efd1d7767 boards/arm: Remove soc compatible from board compatible
There's no reason to add soc compatible at this level.


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-09-30 09:54:41 -05:00
Tomasz Bursztyka
e18fcbba5a device: Const-ify all device driver instance pointers
Now that device_api attribute is unmodified at runtime, as well as all
the other attributes, it is possible to switch all device driver
instance to be constant.

A coccinelle rule is used for this:

@r_const_dev_1
  disable optional_qualifier
@
@@
-struct device *
+const struct device *

@r_const_dev_2
 disable optional_qualifier
@
@@
-struct device * const
+const struct device *

Fixes #27399

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-09-02 13:48:13 +02:00
Alexandre Bourdiol
5ae149a17b board: arm: nucleo_f207zg: add DAC support
Add DAC support to nucleo_f207zg:

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2020-08-27 16:06:34 +02:00
Erwan Gouriou
c062cd260a drivers/ethernet: stm32: Enable Kconfig symbol ETH_STM32_HAL using dts
It should not be needed to configure ETH_STM32_HAL from boards.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-07-24 12:03:33 +02:00
Erwan Gouriou
e8f1c17e79 boards: stm32: Enable ethernet devices through device tree
Update boards that use to declare ethernet support to enable
matching ethernet node.
Similarly to other devices, use dts API to control ethernet pin
settings.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-07-24 12:03:33 +02:00
Alexandre Bourdiol
6f55614222 board: arm: Enable MPU for all STM32 boards supporting it
Only boards with at least 64K Flash will activate MPU because:
MPU + UERSPACE + All switches implicity activated
(CONFIG_MPU_STACK_GUARD, CONFIG_ARM_STACK_PROTECTION ...)
will consume about 40K Flash
(value computed on nucleo_f767_zi on tests/arch/arm/arm_ramfunc/).

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2020-06-19 08:55:44 -05:00
Francois Ramu
4a8fb854bb boards: arm: stm32f207 add rtc feature on the nucleo board
This patch enables the rtc so that the testcase
tests/drivers/counter/counter_basic_api
can run on this nucleo_stm32f207 board
also when running sanity check

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-06-10 09:40:21 +02:00
Erwan Gouriou
0993fa5682 boards: stm32: pinmux: Restore Kconfig control on pinmux (adc)
In order to avoid pin configuration conflicts between peripherals,
add CONFIG_ADC flag to for each adc pinmux configuration.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-05-20 12:09:19 +02:00
Erwan Gouriou
f9d5df3937 boards: stm32: pinmux: Restore Kconfig control on pinmux (serial)
In order to avoid pin configuration conflicts between peripherals,
add CONFIG_SERIAL flag to for each serial pinmux configuration.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-05-20 12:09:19 +02:00
Martí Bolívar
6e8775ff84 devicetree: remove DT_HAS_NODE_STATUS_OKAY
Several reviewers agreed that DT_HAS_NODE_STATUS_OKAY(...) was an
undesirable API for the following reasons:

- it's inconsistent with the rest of the DT_NODE_HAS_FOO names
- DT_NODE_HAS_FOO_BAR_BAZ(node) was agreed upon as a shorthand
  for macros which are equivalent to
  DT_NODE_HAS_FOO(node) && DT_NODE_HAS_BAR(node) &&
- DT_NODE_HAS_BAZ(node), and DT_HAS_NODE_STATUS_OKAY is an odd duck
- DT_NODE_HAS_STATUS(..., okay) was viewed as more readable anyway
- it is seen as a somewhat aesthetically challenged name

Replace all users with DT_NODE_HAS_STATUS(..., okay), which is
semantically equivalent.

This is mostly done with sed, but a few remaining cases were done by
hand, along with whitespace, docs, and comment changes. These special
cases include the Nordic SOC static assert files.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-13 18:24:42 +02:00
Kumar Gala
fdd85d5ad7 dts: Rename DT_HAS_NODE macro to DT_HAS_NODE_STATUS_OKAY
Rename DT_HAS_NODE to DT_HAS_NODE_STATUS_OKAY so the semantics are
clear.  As going forward DT_HAS_NODE will report if a NODE exists
regardless of its status.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-06 05:25:41 -05:00
Erwan Gouriou
1be8bda215 boards: stm32: Fix boards names in yaml and/or doc files
For auto doc generation purpose, get name value of boards' yaml files
in sync with name provided as board name in .rst file


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-05-05 10:05:56 -05:00
Kumar Gala
024ea0e44e adc: Kconfig: Remove per instance ADC_{0..2} Kconfig symbols
No code utilizes CONFIG_ADC_{0..2} so we can now remove the Kconfig
sybmols for them.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-04 09:04:16 -05:00
Erwan Gouriou
c29e94ca12 boards: stm32: adc: Move adc pinmuxing to device tree
Use new DT API to configure ADC peripheral pins.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-04-29 16:09:15 -05:00
Erwan Gouriou
81f27c2265 boards: stm32: Use dt API for serial peripheral configuration
Replace use of Kconfig UART_X symbols by calls to DT API.
Clean driver from symbols definitions

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-04-20 15:27:56 -05:00
Ulf Magnusson
a42a42cd5a kconfig: Replace defconfig singe-symbol 'if's with 'depends on'
Same deal as in commit eddd98f ("kconfig: Replace some single-symbol
'if's with 'depends on'"), for all symbols defined within defconfig
files. See that commit for an explanation.

Maybe 'if's were used originally to mirror the 'if's in the main Kconfig
files, and then it got copied around by people assuming 'if' must work
differently from 'depends on'. It doesn't match in every spot at least.
Better to keep it simple and just consistently use 'depends on' when
it's a single symbol/choice I think. Helps reinforce that 'if' isn't
magic too.

Verified by printing all Kconfig menu nodes (symbols, choices, menus,
etc.) before and after the change and diffing (should show no
difference).

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-02-12 10:32:13 -06:00
Ulf Magnusson
c5839f834b kconfig: Remove assignments to CONFIG_<arch> syms and hide them
All board defconfig files currently set the architecture in addition to
the board and the SoC, by setting e.g. CONFIG_ARM=y. This spams up
defconfig files.

CONFIG_<arch> symbols currently being set in configuration files also
means that they are configurable (can be changed in menuconfig and in
configuration files), even though changing the architecture won't work,
since other things get set from -DBOARD=<board>. Many boards also allow
changing the architecture symbols independently from the SoC symbols,
which doesn't make sense.

Get rid of all assignments to CONFIG_<arch> symbols and clean up the
relationships between symbols and the configuration interface, like
this:

1. Remove the choice with the CONFIG_<arch> symbols in arch/Kconfig and
   turn the CONFIG_<arch> symbols into invisible
   (promptless/nonconfigurable) symbols instead.

   Getting rid of the choice allows the symbols to be 'select'ed (choice
   symbols don't support 'select').

2. Select the right CONFIG_<arch> symbol from the SOC_SERIES_* symbols.
   This makes sense since you know the architecture if you know the SoC.

   Put the select on the SOC_* symbol instead for boards that don't have
   a SOC_SERIES_*.

3. Remove all assignments to CONFIG_<arch> symbols. The assignments
   would generate errors now, since the symbols are promptless.

The change was done by grepping for assignments to CONFIG_<arch>
symbols, finding the SOC_SERIES_* (or SOC_*) symbol being set in the
same defconfig file, and putting a 'select' on it instead.

See
https://github.com/ulfalizer/zephyr/commits/hide-arch-syms-unsquashed
for a split-up version of this commit, which will make it easier to see
how stuff was done. This needs to go in as one commit though.

This change is safer than it might seem re. outstanding PRs, because any
assignment to CONFIG_<arch> symbols generates an error now, making
outdated stuff easy to catch.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-02-08 00:50:08 -06:00