Commit Graph

211 Commits

Author SHA1 Message Date
Gerard Marull-Paretas 5280d13c1e github: add test workflow
Add a new test workflow to run tests for scripts and to run code linter.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-09-29 09:03:24 -05:00
Gerard Marull-Paretas a92cd408d8 scripts: add Python development tools
Add some useful development tools like the flake8 linter and black
autoformatter.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-09-29 09:03:24 -05:00
Gerard Marull-Paretas a59c7ce6d8 dts: initial batch of pinctrl files
Initial batch of DT pinctrl files. Generated using CubeMX 5.6.1

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-09-29 09:03:24 -05:00
Gerard Marull-Paretas fdba45dc89 gitignore: add Python and editor files
Add some rules to exclude files generated by Python runtime, pytest,
editors, etc.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-09-29 09:03:24 -05:00
Gerard Marull-Paretas 8eb3d3fd0b scripts: tests: genpinctrl: add initial tests
Add some tests for genpinctrl script to make sure parsed and generated
data are correct.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-09-29 09:03:24 -05:00
Gerard Marull-Paretas bd2e89c49b scripts: genpinctrl: script for DT pinctrl generation
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>
2020-09-29 09:03:24 -05:00
Francois Ramu cea57f86d3 stm32cube: update stm32h7 to version V1.7.0
Update Cube version for STM32H7xx series
   on https://github.com/STMicroelectronics
   from version v1.6.0
   to version v1.7.0

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-07-22 12:08:13 +02:00
Erwan Gouriou 6b330f0af9 LICENSE: License root file should contain explicit licenses
Put full length text for mentioned licenses.


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-07-08 11:58:26 -05:00
Erwan Gouriou f3fa6b5ebb LICENSE: Add root LICENSE file
Provide root LICENSE file.
This describe the license scheme that is applied in this repo.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-06-25 21:31:01 -05:00
Erwan Gouriou 49cd8ccc6f Licenses: Add Apache-2.0 SPDX when missing
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>
2020-06-25 21:31:01 -05:00
Giancarlo Stasi 6e2d3f9514 stm32cube: extend public SetFlashLatency API to all families
The LL_SetFlashLatency public API is now defined for families
beyond G4, L4 and L5. In most case the private function has been
made public, in one case (H7) it's built on top of existing ones.

Signed-off-by: Giancarlo Stasi <giancarlo.stasi.co@gmail.com>
2020-06-24 21:45:39 +02:00
Andreas Sandberg 6812113dc5 stm32l0xx: Add stm32l0xx_ll_usb to CMakeLists
Some STM32L0 SoCs contain a USB device controller. Add the LL USB HAL
to enable USB support in Zephyr.

Signed-off-by: Andreas Sandberg <andreas@sandberg.pp.se>
2020-06-10 07:51:44 -05:00
Erwan Gouriou d1bc80d021 hal_stm32: rename HAS_STLIB in HAS_STM32LIB
Both modules ST and STM32 use the same HAS_STLIB Kconfig symbol.
This is not coherent, so rename the one used in stm32 module
as HAS_STM32LIB

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-05-08 12:13:33 -05:00
Erwan Gouriou ff9b7f295d lib/stm32wb: hci: Update lib to V1.5.0 Cube version
Tested with 1.5 and default binary

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-04-24 20:01:21 +02:00
Erwan Gouriou 12f79fb75b stm32cube: CMakeLists.txt: Add support for stm32l5
Add stm32l5 series support.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-04-07 07:53:39 -05:00
Erwan Gouriou aa8da9ae9d stm32cube: Add stm32l5 package (v1.2.0)
Introduce STM32Cube package for STM32L5xx series

URL:
   https://github.com/STMicroelectronics/STM32CubeL5

Commit:
   2ca47b7feebb1852e49ff34752201999fe01eb53

Maintained-by:
   External

License:
   BSD-3-Clause

License Link:
   https://opensource.org/licenses/BSD-3-Clause

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-04-07 07:53:39 -05:00
Francois Ramu 37dcc0e120 stm32cube: update stm32f2 to version V1.9.0
Update Cube version for STM32F2xx series
   on https://github.com/STMicroelectronics
   from version v1.8.0
   to version v1.9.0

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-03-26 14:58:28 -05:00
Francois Ramu c25d94c94f stm32cube: update stm32mp1 to version 1.2.0
Update Cube version for STM32MP1xx series
   on https://github.com/STMicroelectronics
   from version 1.0.0
   to version 1.2.0

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-03-26 14:58:28 -05:00
Francois Ramu 4fa9c62e00 stm32cube: update stm32f7 to version V1.16.0
Update Cube version for STM32F7xx series
   on https://github.com/STMicroelectronics
   from version v1.15.0
   to version v1.16.0

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-03-26 14:58:28 -05:00
Francois Ramu 5687b77796 stm32cube: update stm32f4 to version V1.25.0
Update Cube version for STM32F4xx series
   on https://github.com/STMicroelectronics
   from version v1.24.1
   to version v1.25.0

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-03-26 14:58:28 -05:00
Francois Ramu 2f51141f97 stm32cube: update stm32h7 to version V1.6.0
Update Cube version for STM32H7xx series
   on https://github.com/STMicroelectronics
   from version v1.5.0
   to version v1.6.0

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-03-26 14:58:28 -05:00
Francois Ramu 12efc04aa1 stm32cube: update stm32g4 to version V1.2.0
Update Cube version for STM32G4xx series
   on https://github.com/STMicroelectronics
   from version v1.1.0
   to version v1.2.0

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-03-26 14:58:28 -05:00
Francois Ramu 766f5b1a65 stm32cube: update stm32wb to version V1.5.0
Update Cube version for STM32WBxx series
   on https://github.com/STMicroelectronics
   from version v1.3.0
   to version v1.5.0

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-03-26 14:58:28 -05:00
Francois Ramu 507e36a8dc stm32cube: update stm32l4 to version V1.15.1
Update Cube version for STM32L4xx series
   on https://github.com/STMicroelectronics
   from version v1.14.0
   to version v1.15.1

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-03-26 14:58:28 -05:00
Kumar Gala 3c98339c2a stm32l0xx: Fix warnings for extraneous parentheses
Building with clang reports the following warnings:

stm32l0xx_hal_rcc.c.c: error: equality comparison with extraneous
parentheses [-Werror,-Wparentheses-equality]
    if((sysclk_source == RCC_CFGR_SWS_MSI) )
        ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~

Removing the extra () fixes the warning

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-12 09:29:52 -06:00
Kumar Gala 3136888301 stm32l1xx: Fix warnings for extraneous parentheses
Building with clang reports the following warnings:

stm32l1xx_hal_rcc.c.c: error: equality comparison with extraneous
parentheses [-Werror,-Wparentheses-equality]
    if((sysclk_source == RCC_CFGR_SWS_MSI) )
        ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~

Removing the extra () fixes the warning

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-12 09:29:52 -06:00
Francois Ramu dee4413253 stm32cube: stm32l4Rx/stm32l4Sx : Update AHB prescaler settings
set the AHB prescaler with correct value in case the pll
requires LL_RCC_SYSCLK_DIV_1 for HSE and HSI or MSI

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-02-12 09:28:28 -06:00
Richard Osterloh 004ec24e84 stm32cube: stm32g4xx: Fix SystemCoreClock value > 80MHz
SystemCoreClock value should be updated after AHB prescale
is set back to 1.

Signed-off-by: Richard Osterloh <richard.osterloh@gmail.com>
2020-02-12 09:28:28 -06:00
Erwan Gouriou 94d735c261 lib: stm32wb hci: cleanup unused header files
Due to header reorganization, some header files are no more
used by library. Remove them to ease maintenance.
For hw_conf.h, app_conf.h should be modified to remove dependency.
Document this fix in README.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-01-15 08:15:30 -06:00
Erwan Gouriou c1ba924a4b lib: stm32wb hci: Update lib from stm32wb cube package 1.3.0
Origin:
    ST Microelectronics
        https://github.com/STMicroelectronics/STM32CubeWB

Status:
    version 1.3.0

Patch list:

Following files are distributed under ST License SLA0044.
For Zephyr they are made available under BSD-3 Clause.
* hw_ipcc.c
* app_common.h
* stm32_wpan_common.h
* app_conf.h
* hw_conf.h
* tl_conf.h

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-01-15 08:15:30 -06:00
Erwan Gouriou 7d9ca4f0c7 lib: stm32wb hci: Add patch list to README
Document the few patches are done on top of Cube package files.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-01-15 08:15:30 -06:00
Francois Ramu 2f1923cb20 stm32cube: update stm32wb to version V1.3.0
Update Cube version for STM32WBxx series
   on https://github.com/STMicroelectronics
   from version v1.1.1
   to version v1.3.0

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-01-14 15:30:36 +01:00
Francois Ramu 769d92f325 stm32cube: update stm32g0 to version V1.3.0
Update Cube version for STM32G0xx series
   on https://github.com/STMicroelectronics
   from version v1.2.0
   to version v1.3.0

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-01-14 15:30:36 +01:00
Francois Ramu 7196d9f6ca stm32cube: update stm32f0 to version V1.11.0
Update Cube version for STM32F0xx series
   on https://github.com/STMicroelectronics
   from version v1.10.1
   to version v1.11.0

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-01-14 15:30:36 +01:00
Francois Ramu 7447c32a7a stm32cube: update stm32f3 to version V1.11.0
Update Cube version for STM32F3xx series
   on https://github.com/STMicroelectronics
   from version v1.10.0
   to version v1.11.0

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-01-14 15:30:36 +01:00
Erwan Gouriou 90c7f61574 stm32cube: update stm32h7xx cube version to V1.5.0
Update Cube version for STM32H7XX series
from version: V1.4.0
to version: V1.5.0


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-01-14 15:30:36 +01:00
Erwan Gouriou 71db3d280a stm32cube: update stm32f2xx cube version to V1.8.0
Update Cube version for STM32F2XX series
from version: V1.7.0
to version: V1.8.0

Fixes following issues:
   *Fix VBUS sensing deactivation
     The error is detected if USART1 TX configured to PA9 and RX to PA10.
     The serial cable removal stops the USB communication.
     In case of VBUS sensing deactivation, erroneously
     both USB_OTG_GCCFG_VBUSBSEN and USB_OTG_GCCFG_NOVBUSSENS are set in GCCFG.
     Correct handling is:
      - VBUS sensing deactivation: set USB_OTG_GCCFG_NOVBUSSENS in GCCFG.
      - VBUS sensing activation:   set USB_OTG_GCCFG_VBUSBSEN in GCCFG.
    Impacted files:
     ext/hal/st/stm32cube/stm32f2xx/drivers/src/stm32f2xx_ll_usb.c
    ST Bug Tracker ID: 34714

    *Use of (__packed uint32_t *) produces warning
      Using GNU 8.2.0, (__packed uint32_t *) generates warning.
      Replace with CMSIS macros __UNALIGNED_UINT32_READ and
      __UNALIGNED_UINT32_WRITE.
     Impacted files:
      drivers/include/stm32f2xx_ll_usb.c
     ST Bug tracker ID: 61324

    *Fix warnings for extraneous parentheses
      Using clang 7.0.1, if ((htim->State == HAL_TIM_STATE_BUSY))
      generates warnings.  Remove the extra parentheses
     Impacted files:
      drivers/src/stm32f2xx_hal_tim.c
      drivers/src/stm32f2xx_hal_tim_ex.c
     ST Bug tracker ID: 63615


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-01-14 15:30:36 +01:00
Erwan Gouriou fc5cb1a603 stm32cube: update stm32f1xx cube version to V1.8.0
Update Cube version for STM32F1XX series
from version: V1.7.0
to version: V1.8.0

Includes following fixes:
    *Update LSI_VALUE to 40 KHz
     Impacted files:
      drivers/include/stm32f1xx_ll_rcc.h
     ST Bug tracker ID: 37419

    *Use of (__packed uint32_t *) produces warning
      Using GNU 8.2.0, (__packed uint32_t *) generates warning.
      Replace with CMSIS macros __UNALIGNED_UINT32_READ and
      __UNALIGNED_UINT32_WRITE.
     Impacted files:
      drivers/include/stm32f1xx_ll_usb.c
     ST Bug tracker ID: 61323

    *Fix warnings for extraneous parentheses
      Using clang 7.0.1, if ((htim->State == HAL_TIM_STATE_BUSY))
      generates warnings.  Remove the extra parentheses
     Impacted files:
      drivers/src/stm32f1xx_hal_tim.c
      drivers/src/stm32f1xx_hal_tim_ex.c
     ST Bug tracker ID: 63614


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-01-14 15:30:36 +01:00
Francois Ramu a9347d32a7 script: build new zephyr module from a new STM32Cube
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>
2020-01-14 14:35:30 +01:00
Francois Ramu 566f4eb616 stm32cube: stm32g4xx: wrong clock setup
When configuring the PLL > 80MHz, an intermediate step is needed
with AHB prescaler set to 2 before setting the actual value.
Then the AHB prescaler 1 must be set, though

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-01-10 14:15:50 +01:00
Erwan Gouriou 99d01ff65d README: Adapt to ReStructectedText
Since README now appears an interpreted .rst directly in github,
restructure a bit to get a nicer output.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-01-06 09:55:15 -06:00
Erwan Gouriou 2c6083970c README: Add an intro section and lib section
Add intro section explaining basics of the package.
Also add few words on the lib folder.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-01-06 09:55:15 -06:00
Erwan Gouriou 6a41423781 README: Add a section to use STM32Cube API in an application
Some people want to access STM32Cube API directly in their
application. Explain the few steps required to do it seamlessly.


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-01-06 09:55:15 -06:00
Erwan Gouriou a270b35fb4 README: Move README to module root
Move README so it can appear directly on module guthub page:
https://github.com/zephyrproject-rtos/hal_stm32

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-01-06 09:55:15 -06:00
Erwan Gouriou 92bdc131f9 stm32cube: all: Rename Kconfig symbol xxx_CRYPT to xxx_CRYP
Each Cube peripheral API _foo.h has a matching Kconfig symbol
USE_STM32_HAL_FOO. This convention is useful for automatic package
update.
Crypto API derogates from this rule, which breaks automatic update:
- API is _cryp.h
- Kconfig is USE_STM32_HAL_CRYPT

Fix this by aligning Kconfig symbol on API naming.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-12-09 11:54:23 -06:00
Marc Herbert 2077622128 make stm32cube a zephyr_library()
Stops leaking very long source paths in build directories; makes them
deterministic.

This is identical to what was already merged in
https://github.com/zephyrproject-rtos/hal_nordic/pull/6
or https://github.com/zephyrproject-rtos/zephyr/pull/19531
see previous code reviews there.

See also CMake issue https://gitlab.kitware.com/cmake/cmake/issues/19475
for more details.

This is basically a search/replace of "zephyr_sources" with
"zephyr_library_sources"

For instance, when running sanitycheck -p stm3210c_eval, this changes
the build directories from:

sample.helloworld/
└── zephyr
    ├── CMakeFiles
    │   │   ├── HOME
    │   │   │   └── JOHN
    │   │   │      └── ZEPHYRPROJECT
    │   │   │          └── modules
    │   │   │             └── hal
    │   │   │                └── stm32
    │   │   │                    └── stm32cube
    │   │   │                       └── stm32f1xx
    │   │   │                          ├── drivers
    │   │   │                          │  └── src
    │   │   │                          │     ├── stm32f1xx_hal.c.obj
    │   │   │                          │     ├── stm32f1xx_hal_rcc.c.obj
    │   │   │                          │     └── stm32f1xx_ll_utils.c.obj
    │   │   │                          └── soc
    │   │   │                              └── system_stm32f1xx.c.obj

... to:

sample.helloworld/
├── modules
│   ├── stm32
│   │   ├── CMakeFiles
│   │   └── stm32cube
│   │       ├── CMakeFiles
│   │       │   └── ..__modules__hal__stm32__stm32cube.dir
│   │       │       └── stm32f1xx
│   │       │           ├── drivers
│   │       │           │   └── src
│   │       │           │       ├── stm32f1xx_hal.c.obj
│   │       │           │       ├── stm32f1xx_hal_rcc.c.obj
│   │       │           │       └── stm32f1xx_ll_utils.c.obj
│   │       │           └── soc
│   │       │               └── system_stm32f1xx.c.obj
│   │       ├──
│   │       ├── lib..__modules__hal__stm32__stm32cube.a

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2019-10-23 06:37:43 -05:00
Karl Palsson 886636e6db stm32l151xb: add missing SPI_CR2_FRF definitions
This is a bug in upstream CMSIS, but I don't have any contacts to get it
fixed there.

Fixes ST Bug: 73643

Signed-off-by: Karl Palsson <karlp@etactica.com>
2019-10-11 06:34:39 -05:00
Richard Osterloh 41ae0cf14c stm32cube: Add HAL for the STM32G4x series
This commit adds the STM32CUBE HAL for STM32G4x series MCUs.

Signed-off-by: Richard Osterloh <richard.osterloh@gmail.com>
2019-10-04 07:45:12 -07:00
Benoit Leforestier d08c4e98f1 HAL STM32: Synchronize STM Cube HSE clock value with zephyr clock value
Define HSE_VALUE as the same value of CONFIG_CLOCK_STM32_HSE_CLOCK.

Signed-off-by: Benoit Leforestier <benoit.leforestier@gmail.com>
2019-10-04 07:33:41 -07:00
Yaël Boutreux 272281a199 stm32cube: stm32mp1xx: drivers: add SPI's LL
Add SPI LL files for STM32MP1x.

Signed-off-by: Yaël Boutreux <yael.boutreux@st.com>
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>
2019-08-02 09:28:01 -04:00