cancel
Showing results for 
Search instead for 
Did you mean: 

I want to use STM32 HAL driver along with Standard Peripheral Driver

Bhavin1
Associate II

Hi,

I am using STM32F107VCT6 MCU.

I already implemented my whole application using StdPeripheral driver. Now i want to use USB and FatFs but there is no support for this in StdPeripheral driver for that i need to use HAL driver.

I tried to integrate HAL driver in to my current project which is using StdPeripheral driver but it's giving lot's of errors.

So can you please let me know how can i use HAL driver along with StdPeripheral driver?

Thanks,

Bhavin Maru

5 REPLIES 5

FATFS integrates fine with​ SPL

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
TDK
Guru

> I tried to integrate HAL driver in to my current project which is using StdPeripheral driver but it's giving lot's of errors.

What are the errors?

If you feel a post has answered your question, please click "Accept as Solution".

Hi @Community member​  thanks for reply. I also need to integrate USB_HOST and USB_OTG_FS because i need to read/write from USB.

so is it possible?

Hi @TDK​  thanks for reply.

if possible i will try to attach all errors but i am explaining all errors as below:

StdPeripheral driver uses all it's source and header files with file name stm32f10x.h or stm32f10x_gpio, etc

whereas HAL driver uses all it's source and header files with file name stm32f1xx.h or stm32f1xx_hal_gpio.h, etc.

currently i am using StdPeripheral driver so in my project stm32f10x.h file is already present so when i try to integrate USB_HOST, USB_OTG_FS and FATFS then they are using HAL driver so i have to add stm32f1xx.h. This is just one file example i have explained but actually i need to integrate many files from HAL driver in to StdPeripheral driver.

so mostly all errors are related to redeclaration of all macros, enum and structures.

Yes, there were SPL libraries for that too

https://www.st.com/en/embedded-software/stsw-stm32046.html

The SPL existed for very many years before the HAL libraries appeared, and I used them exclusively for F1,F2,F4,L1 based designs.

You have to decide if it's easier to port your application to HAL, or integrate in the SPL features you need to finish. No real idea of the complexity you're working with.

When I ported my last F2 project to the L4 platform, I built a framework using HAL, with all the clock and pin configuration for the new design and merged over the core functionality from the old SPL project. The bulk of the work only took a couple of days.

Difficulty real comes if the project was poor coded for portability, or wasn't well abstracted.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..