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

[HELP] STM32 Macro Naming Conventions #14551

Open
1 task done
stbenn opened this issue Oct 29, 2024 · 3 comments
Open
1 task done

[HELP] STM32 Macro Naming Conventions #14551

stbenn opened this issue Oct 29, 2024 · 3 comments
Labels
Community: Question Further information is requested

Comments

@stbenn
Copy link
Contributor

stbenn commented Oct 29, 2024

Description

There seems to be two naming conventions when defining macros for STM32 boards:

  1. Identifiers typically omit chip type, and start with STM32_
    • An example would be the STM32H7. In arch/arm/src/stm32h7/hardware/, and the board.h file for the nucleo-h743zi (boards/arm/stm32h7/nucleo-h743zi/include/board.h
  2. Identifiers typically include chip type, and start with STM32XX_
    • An example would be the STM32L5. In arch/arm/src/stm32l5/hardware/, and the board.h file for nucleo-l552ze (boards/arm/stm32l5/nucleo-l552ze/inclue/board.h

I cannot figure out why some chips use the first style, and some use the second.

Are the differences between these naming conventions purely stylistic, or are there specific reasons to use one convention instead of the other?

When adding support for a new STM32 chip family, which naming convention would be preferred?

Verification

  • I have verified before submitting the report.
@stbenn stbenn added the Community: Question Further information is requested label Oct 29, 2024
@raiden00pl
Copy link
Contributor

Please use the shorter version: STM32_. The longer version comes from stm32l4 port and the ports using it are most likely based on stm32l4 port (or any of its later derivatives).
The shorter version is easier to maintain, helps when we have to update all stm32 chips at once and porting between stm32 boards is then easier.
I think STM32XX_ should be modifed to STM32_ someday.

@stbenn
Copy link
Contributor Author

stbenn commented Oct 30, 2024

Should function and file names follow this shorter version as well then?

@raiden00pl
Copy link
Contributor

Should function and file names follow this shorter version as well then?

I think so. Let's follow how stm32h7 is made: short version where possible, long version for Kconfig options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community: Question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants