Can I use HAL library in MBED?

Hello,

I have Stm32 L4 microcontroller. I want to make use of all its power modes and I have only found the HAL library generated by the Cube software(Stm32L4-Workshop/stm32l4xx_hal_pwr.c at master · JoeMerten/Stm32L4-Workshop · GitHub) that uses all the 8 power modes. My question is can I use the HAL library with the MBED compiler?

Yes, it’s included in Mbed OS 5 as well. See https://github.com/ARMmbed/mbed-os/blob/master/targets/TARGET_STM/TARGET_STM32L4/device/stm32l4xx_hal_pwr.c so you can use STM HAL functions in your Mbed program. This means the code won’t be portable of course.

You have most likely moved on from this issue, but for any others who are looking for a solution to the problem the link below is very useful: Using STM32 HAL with mbedOS | Mbed