Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STM32: Add support for STM32L5 series and nucleo_l552ze_q board #23551

Merged
merged 10 commits into from
May 8, 2020

Conversation

erwango
Copy link
Member

@erwango erwango commented Mar 18, 2020

This work add support for first STM32 Cortex-M33 based Series.
Support for board nucleo_l552_q is also added with minimum peripheral support for now.

@zephyrbot
Copy link
Collaborator

zephyrbot commented Mar 18, 2020

All checks are passing now.

checkpatch (informational only, not a failure)

-:431: WARNING:UNDOCUMENTED_DT_STRING: DT compatible string "st,stm32l552ze-nucleo-q" appears un-documented -- check ./dts/bindings/
#431: FILE: boards/arm/nucleo_l552ze_q/nucleo_l552ze_q.dts:13:
+	compatible = "st,stm32l552ze-nucleo-q", "st,stm32l552";

-:431: WARNING:UNDOCUMENTED_DT_STRING: DT compatible string "st,stm32l552" appears un-documented -- check ./dts/bindings/
#431: FILE: boards/arm/nucleo_l552ze_q/nucleo_l552ze_q.dts:13:
+	compatible = "st,stm32l552ze-nucleo-q", "st,stm32l552";

-:1053: WARNING:COMPLEX_MACRO: Macros with complex values should be enclosed in parentheses
#1053: FILE: drivers/pinmux/stm32/pinmux_stm32l5x.h:101:
+#define STM32L5X_PINMUX_FUNC_PC7_USART6_RX  \
+	(STM32_PINMUX_ALT_FUNC_8 | STM32_PUPDR_NO_PUL

- total: 0 errors, 3 warnings, 1363 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Your patch has style problems, please review.

NOTE: Ignored message types: AVOID_EXTERNS BRACES CONFIG_EXPERIMENTAL CONST_STRUCT DATE_TIME FILE_PATH_CHANGES MINMAX NETWORKING_BLOCK_COMMENT_STYLE PRINTK_WITHOUT_KERN_LEVEL SPDX_LICENSE_TAG SPLIT_STRING VOLATILE

NOTE: If any of the errors are false positives, please report
      them to the maintainers.

Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages.

@erwango erwango force-pushed the stm32l5 branch 5 times, most recently from eff79b3 to 47ec9e4 Compare March 18, 2020 13:27
@ioannisg ioannisg added the Release Notes To be mentioned in the release notes label Mar 23, 2020
Copy link
Member

@ioannisg ioannisg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the security domain of the added board definition? Looks like the SoC has TrustZone-M so the options are

  • default (implying Secure domain)
  • non-secure (in that case you need to set CONFIG_TRUSTED_EXECUTION_NONSECURE)

@erwango
Copy link
Member Author

erwango commented Mar 24, 2020

@ioannisg , @MaureenHelm, thanks for the reviews and guidance. I've updated the changes.

Copy link
Member

@MaureenHelm MaureenHelm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine except for the west.yml update

west.yml Outdated Show resolved Hide resolved
@erwango erwango force-pushed the stm32l5 branch 2 times, most recently from 62b088e to ac93535 Compare May 6, 2020 09:04
Copy link
Collaborator

@FRASTM FRASTM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commit msg
Add support for stm32l5 socs on stm32 external interrupts driver

@erwango
Copy link
Member Author

erwango commented May 6, 2020

commit msg
Add support for stm32l5 socs on stm32 external interrupts driver

@FRASTM Fixed, txs

Copy link
Collaborator

@FRASTM FRASTM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could have a line in the file header too (MP1 seems not here though)
STM32F0/STM32L0/STM32L4/STM32L5/STM32G0/STM32G4: Lines 0 to 15. Lines > 15 are not mapped on an IRQ

@erwango
Copy link
Member Author

erwango commented May 6, 2020

could have a line in the file header too (MP1 seems not here though)
STM32F0/STM32L0/STM32L4/STM32L5/STM32G0/STM32G4: Lines 0 to 15. Lines > 15 are not mapped on an IRQ

Done

@erwango erwango added this to the v2.3.0 milestone May 6, 2020
@erwango erwango requested a review from ioannisg May 7, 2020 19:13
# console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Together with ARM_MPU, I believe you would need to enable ARM_TRUSTZONE_M option, if you ever would like to run a Zephyr firmware explicitly "secure-aware", i.e. with TRUSTED_EXECUTION_SECURE=y. If you don't wish that, then it's ok to not enable ARM_TRUSTZONE_M

select ARM
select CPU_CORTEX_M33
select SOC_FAMILY_STM32
select ARM_TRUSTZONE_M
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a SoC-capability option and needs to be enabled in the Board defconfig (if required)

@ioannisg ioannisg dismissed their stale review May 7, 2020 21:06

removing -1

@ioannisg
Copy link
Member

ioannisg commented May 7, 2020

@erwango I had a look, and removed my -1 on this, to make it go in for v2.3, but, I am confused regarding the objectives here: I see a single board target, now (a single defconfig). This target does not enable any of TRUSTED_EXECUTION_SECURE or _NONSECURE, so when building Zephyr , is this desirable?

I was more thinking you would like to have 2 board targets, here, one "default" to be used for zephyr test suites, and one strictly "non-secure", to build Zephyr as a Non-Secure RTOS (i assumed the latter would need TRUSTED_EXECUTION_NONSECURE=y, but if you managed to set the whole thing up without this need, then I 've got no objections. BTW, the "double board target" is used, now, for nRF, Musca, and MPS2 platforms, see respective board definitions ).

erwango added 7 commits May 7, 2020 23:11
This provides basic stm32l5 series SoC support.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Add l5 secure and non secure device tree files

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Add clock_control driver for STM32L5.
It's based on L4/WB driver since it is similar IP.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Add support for stm32l5 socs on stm32 external interrupts driver

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Add basic GPIO support. Regarding interface with EXTI,
STM32L5 is similar to STM32G0.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Add serial support for STM32L5 serial driver and instances

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Copy/pasted from L4 series.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
erwango added 3 commits May 7, 2020 23:16
Tested with hello_world, basic/blinky, basic/button.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
When MSI clock is used a source of PLL, it should be possible to
select its frequency range. Fix this.


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Use MSI as PLL source. This enables to run system clock at 110MHz.
To achieve this, voltage regulator should be set to scale 0.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
@galak galak merged commit f81c554 into zephyrproject-rtos:master May 8, 2020
@erwango erwango deleted the stm32l5 branch June 5, 2020 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants