Skip to content

Conversation

@mathieuchopstm
Copy link
Collaborator

Add a new script autogenpackage (better name suggestions welcome) which can be used to automatically generate various files that were so far hand-authored:

  • list of series supported by the HAL module
  • HAL assert header stm32_assert.h
    • Build system is slightly tweaked to use a common file as done with common_ll
    • This makes the package more maintainable and reduces space usage
  • per-series CMakeLists.txt

Additionally, the script can generate the Zephyr-side modules/Kconfig.stm32, ensuring that the HAL and Zephyr side of the module are always in sync. Other features include the ability to gate different drivers under the same Kconfig option (e.g., DLYB for drivers called dlyb.c on some series and delayblock.c on others) and easily include or force-exclude drivers from the build system (although this should be done as little as possible).

As part of this PR, the series list and stm32_assert.h are updated for the new infrastructure, but per-series CMakeLists.txt is left unchanged for now.

There are still some points to discuss (e.g., script is oriented towards system_stm32XXxx.c removal) so this PR is opened as draft for discussion.

Add an automatic generator for various files found in the hal_stm32 repo:
 - global stm32_assert.h header
 - global series list enumeration
 - per-series top-level CMakeLists
 - Zephyr-side modules/Kconfig.stm32

Signed-off-by: Mathieu Choplain <[email protected]>
Generate series list using autogenpackage and consume this auto-generated
list in the module's top-level CMakeLists.txt

Signed-off-by: Mathieu Choplain <[email protected]>
Generate multi-series stm32_assert.h using autogenpackage and consume it
by replacing all existing files with one in a shared include directory,
which is then added to the zephyr_include_directories().

Signed-off-by: Mathieu Choplain <[email protected]>
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.

1 participant