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

Introduce the STM32WB0 series #230

Merged

Conversation

mathieuchopstm
Copy link
Contributor

Introduce the STM32CubeWB0 package in hal_stm32 for the upcoming introduction of the STM32WB0 series support in Zephyr.

This PR includes two little hacks to work around a difference in the naming convention between STM32CubeWB0 and other Cube packages, that are clearly annotated with a HACK: comment:

  • in genllheaders.py, replace <stm32wb0xx_ with <stm32wb0x_) after rendering the common LL header to fix wrong filenames being used
  • in stm32cube/stm32wb0xx/CMakeLists.txt, add -DSTM32WB0n define in addition to inappropriate -DSTM32WB0nxx from top-level CMakeLists.txt
    • (n here is the SoC number - 5/6/7/9)
    • the -DSTM32WB0yxx define is not removed to avoid modifying top-level CMakeLists.txt
      • this should not bring any negative consequence

@mathieuchopstm mathieuchopstm force-pushed the stm32wb0_cube_introduction branch 3 times, most recently from 0e092c0 to 106f449 Compare August 30, 2024 15:43
@mathieuchopstm
Copy link
Contributor Author

V2:

  • remove CMakeLists.txt hack
    • Found not necessary after discussion
  • rework genllheaders.py hack into a more generic patch
    • All series ending with a single x are now gracefully handled
  • use the appropriate stm32wb0x name for the series, instead of stm32wb0xx

Copy link
Contributor

@djiatsaf-st djiatsaf-st left a comment

Choose a reason for hiding this comment

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

LGTM

stm32cube/CMakeLists.txt Outdated Show resolved Hide resolved
stm32cube/stm32wb0x/README Outdated Show resolved Hide resolved
@mathieuchopstm
Copy link
Contributor Author

mathieuchopstm commented Sep 5, 2024

v2:

  • rebased on main
  • fixed a few typos
  • moved compatibility patches to separate commit
  • added patch for PAGESIZE issue
  • added comments to top-level CMakeLists.txt

Copy link
Member

@erwango erwango left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM

stm32cube/stm32wb0x/drivers/src/stm32wb0x_hal_radio.c Outdated Show resolved Hide resolved
@mathieuchopstm
Copy link
Contributor Author

V3:

  • reworked patches
    • #if 0 blocks for deleted parts
    • comment for CMakeLists.txt
    • USE_RADIO_PROPRIETARY_DRIVER untouched
      • Patch is non-destructive and comment makes it self-explanatory

This commit adds support for the STM32WB0 serie in genpinctrl by
providing the serie's pinctrl base address, and modifying the script's
configuration file to accept the STM32WB0 names for ADC input pins.

Signed-off-by: Mathieu Choplain <[email protected]>
Add support for series residing in folders ending with a single 'x', such
as the STM32WB0 series (residing in "stm32cube/stm32wb0x"). For these
series, the Cube HAL/LL headers are named with a single 'x' at the end, but
the SOC_SERIES Kconfig symbol also ends with an X, such as
CONFIG_SOC_SERIES_STM32WB0X.

Update the genllheaders template to accept such series gracefully.

Signed-off-by: Mathieu Choplain <[email protected]>
Add documentation in the top-level CMakeLists for the STM32Cube library.
Also add support for STM32Cube package where the series' name contains
a single `x`, such as the STM32WB0 series.

Signed-off-by: Mathieu Choplain <[email protected]>
Generated from STM32_open_pin_data repository.
(commit f4ec11f00e762e37ffc4020f6d4f20d225bc061d)

Signed-off-by: Mathieu Choplain <[email protected]>
Add the STM32CubeWB0 package to hal_stm32.

Signed-off-by: Mathieu Choplain <[email protected]>
Add patches to make the STM32CubeWB0 package compatible with Zephyr.

Signed-off-by: Mathieu Choplain <[email protected]>
Regenerate generic LL headers after integration of STM32CubeWB0.

Signed-off-by: Mathieu Choplain <[email protected]>
@erwango erwango merged commit 1e6116b into zephyrproject-rtos:main Sep 10, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants