Mbed forum

Can I use HAL library in MBED?


(maryam magdy) #1

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(https://github.com/JoeMerten/Stm32L4-Workshop/blob/master/AudioPlayer/AudioPlayer/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr.c) that uses all the 8 power modes. My question is can I use the HAL library with the MBED compiler?


(Jan Jongboom) #2

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.


(Stephen Davis) #3

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: https://os.mbed.com/forum/mbed/topic/33580/