On linux the script crashes, when subprocess.check_call()
parameters are passed as list and shell=True is set,
or if subprocess.check_call() parameters are passed as string
and shell=True is not set. These changes fix that.
When an STM32 SoC goes into STOP mode, the SPI device is disabled. This
cause the pins to not be drived anymore (i.e. they are floating) except
through their pull-up or pull-down.
From the logical point of view, the NSS pin is held high by a pull-up so
it's not a problem if the other pins are floating. However those pins
are floating input for the slaves, which increase their power
consumption.
The solution is to hold the state of the pins through a pull-up or a
pull-down. This is already done for the NSS and MOSI pins, but not for
SCK. Fix that by using pull-down on the SCK pin the same way it is
already done for the MOSI pin.
(For the STM32L4 series, this is a regression introduced by the switch
to the device tree bindings for SPI pins configuration, see
zephyr #24097).
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
When running ./update_stm32_package.py, script breaks due to
unexpected presence of common_ll/ under stm32cube/ .
Skip update when this directory is parsed.
Additionally, update README to avoid recurrent issue when using
the script.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Change script to require STM32 Open Pin Data as input. README file is
now autogenerated so that it will always include the STM32 Open Pin Data
commit used for generation.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
It is now possible that mode is not provided for non-F1 series
configs.
On F1 series ADC1_IN0 could be af 0.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Due to inference of mode for default configurations, mode
should not be set unless it specifies a specific signal variant.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
For non-F1 series:
Add generation of additional functions by inferring mode based
on AF detection instead of the mode value filed in config file.
This allows to detect that a signal should use 'analog' mode
when no AF function is associated to it.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Add systematic compialtion of '..._hal_rcc_ex.c' in 'CMakeLists.txt'
generation. There is more and more dependence of HAL IP to
'..._hal_rcc_ex.c'
Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
Define class Stm32SerieUpdate
Use Pathlib instead of os.path
Add CLI option to provide directory path where to clone
STM32Cube repo (-r <repo_path>)
Reformat README.rst
Add *.pyc to .gitignore
Refactor variable naming (mainly paths),
* to be fully compilant with PEP8
* to be more understandable
* to simplify maintenance
Usage changed. Basic usage:
* update a single serie:
'python3 update_stm32_package.py -s <stm32_serie>'
* update all serie at once:
'python3 update_stm32_package.py
Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
The script is able to generate common LL headers which can be used in
both Zephyr and applications to make it easier to create family
independent code.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
STM32 timers are multi-purpose peripherals ranging from PWM, Input
capture, encoder, HALL sensor... In all series except F1 the timer pins
will always be configured in the same mode, i.e. alternate. So using a
variant for each functionality is not necessary. When working with F1
series mode is still required because the pin may operate in either
alternate or input mode depending on the assigned functionality.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Add support for ethernet pins.
F1 settings taken from RM0008 Rev 20, Table 209.
Other series settings are taken from current Zephyr settings. Note that
they will likely need to be adjusted, as very-high-speed is not needed
for all signals.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Includes USB, OTG_FS and OTG_HS various signals.
This only concerns signals that are configured using alternate.
Signals requiring analog configuration are left a part for now on.
This could lead to situations where only USB_NOE signals are
available on some SoCs (other signals will require a script update
to be generated).
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Only first remap block was being processed, take into account all of
them now. Note that ``FULL_REMAP`` has been adjusted to ``REMAP_FULL``
as it was wrong. Tests updated to cover multiple remap cases.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
When working with F1 series pins not present in the GPIO IP files need
to be taken into account with the NO_REMAP setting.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Now that dts contain a README file, don't clean up the entire
directory but only sub directories.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Some SoCs have the CAN signals without a number identifier (CAN_TX,
CAN_RX) so tweak regex to support with and without a number id.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Some pin names have another name appended, e.g. "PA15 (JTDI)". Current
regex did not handle those cases, so it has been adjusted to handle
them.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Initial version of the genpinctrl script. This script can be used to
automatically generate DT files with pinctrl configuration for all STM32
families using CubeMX database.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Some files were missing explicit License information.
Add Apache-2.0 SPDX tag in these few cases.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
For stm32 series, get the version tree found on
https://github.com/STMicroelectronics/STM32Cube
and apply patches to update module to the latest version
run with $ python ./scripts/update_stm32_package.py stm32xx
Signed-off-by: Francois Ramu <francois.ramu@st.com>