Skip to content

Conversation

mathieuchopstm
Copy link

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
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

@mathieuchopstm mathieuchopstm force-pushed the stm32wb0_cube_introduction branch from 106f449 to 8832190 Compare September 5, 2024 12:05
@mathieuchopstm
Copy link
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

@mathieuchopstm mathieuchopstm force-pushed the stm32wb0_cube_introduction branch from 8832190 to c4c4a5f Compare September 9, 2024 09:22
@mathieuchopstm
Copy link
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

Mathieu Choplain added 7 commits September 9, 2024 15:58
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]>
@mathieuchopstm mathieuchopstm force-pushed the stm32wb0_cube_introduction branch from c4c4a5f to dab1b41 Compare September 9, 2024 13:58
@erwango erwango merged commit 1e6116b into zephyrproject-rtos:main Sep 10, 2024
2 checks passed
@mathieuchopstm mathieuchopstm deleted the stm32wb0_cube_introduction branch October 15, 2024 08:34
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