identify register and bit naming in manual and the HAL function naming
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-08-07 6:17 AM - last edited on ‎2024-08-07 6:22 AM by Andrew Neil
Hi,
a bit of a basic question... for years I used PIC micros so I was very familiar with their manuals, register and bit naming etc.But being new to STM32 I found it difficult to figure out an easy way to find the naming of registers and bits inside register (without having to read tens of pages every time)?
Both in the reference manual (RM0394) and also the related HAL function?
So for example, what is a quick and simple way to find the register name and description for things like changing the polarity PWM CH1 CHN polarity as highlighted in the screenshot below (or any other register and register bit)?
Thank you as always.
Solved! Go to Solution.
- Labels:
-
STM32Cube MCU Packages
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-08-07 8:07 AM
> So for example, what is a quick and simple way to find the register name and description for things like changing the polarity PWM CH1 CHN polarity as highlighted in the screenshot below (or any other register and register bit)?
CubeMX has a different naming scheme than the registers in the reference manual. It's not always a 1:1 correspondence, so this is not possible in general. The HAL source code is the best place to look, although you can also use the manual.
Naming of registers and bits within registers will be in the RM, and the naming convention of these within the CMSIS headers is very consistent with the RM.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-08-07 6:21 AM
Usually, the HAL definitions follow the RM.
Try a text search through the code.
Use one of the example projects, and see what it does - the register names are quite systematic so, once you've found one, the others should follow easily ...
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-08-07 8:07 AM
> So for example, what is a quick and simple way to find the register name and description for things like changing the polarity PWM CH1 CHN polarity as highlighted in the screenshot below (or any other register and register bit)?
CubeMX has a different naming scheme than the registers in the reference manual. It's not always a 1:1 correspondence, so this is not possible in general. The HAL source code is the best place to look, although you can also use the manual.
Naming of registers and bits within registers will be in the RM, and the naming convention of these within the CMSIS headers is very consistent with the RM.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-08-07 6:32 PM
Thank you both
