Moving away from HAL in my STM32CubeMX projects

This evening I found out that almost all peripheral driver initializations can be generated by STM32CubeMX using LL alone instead of HAL, which means I can easily get rid of HAL completely in my STM32F103 project!

Not so fast though. I would have to substitute the call to the following functions with equivalent ones that only rely on LL:

  • HAL_GPIO_TogglePin
  • HAL_Delay
  • HAL_RTC_GetTime
  • HAL_RTC_GetDate
  • HAL_RTC_SetTime
  • HAL_RTC_SetDate

The first one is the simplest one to deal with, as I can replace it with LL_GPIO_TogglePin, which I already use elsewhere.

Obviously I also have to avoid using the data structures, defines, etc. used by the above functions. I might do that in the longer run.

Unfortunately, the USB_DEVICE middleware is only provided for HAL, which means I won’t be able to completely move away from HAL in my STM32F4 and STM32H7 implementations.

Stay tuned for more!

About Luigi Di Fraia

I am a Senior DevOps Engineer so I get to work with the latest technologies and open-source software. However, in my private time I enjoy retro-computing.
This entry was posted in Embedded systems, Retrocomputing, Technical and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s