[Newbie question] StdPeriph driver and HAL driver

I have been writing code for stm32 MCUs for almost a 4 months. I have noticed that there are 2 different libraries for stm32: StdPeriph (it has no prefix, like stm32f7xx_gpio.c) and HAL (I mention here packages based on HAL, such as subroutines with BSP prefix).

But now I have got a little question: How do these libraries relate? Are these different approaches? Do StdPeriph and HAL claim the same abstraction level in code ecosystem brought by MCD Team? Experienced people do not trust to HAL library, they prefer StdPeriph library (the one which is without prefix). I find that code of HAL library is perfectly documented and quite clear (learned a couple of C programming tricks while walking through code) and it is possible to perform complex tasks with it in a couple of days instead of months.

The SPL is the older, original library, it is pretty mature and bug free, not requiring a release every few weeks/months.

If the HAL were really a silver bullet I don't think we'd have continuous forum traffic from people with issues with it, the abstraction is rather thick, and there are a lot of interdependency and interrupt/thread safety issues which are ignored.

>>it is possible to perform complex tasks with it in a couple of days instead of months.

It takes me days what other people spend months on, my perspective of time is a bit skewed.

These librairies are not related exept by the fact that they are made by ST.The HAL are not based on st periph library (even tho it would be a great idea).Most programmers who like to implement their own functions will use the periph library since it's only a low layer onto which they build their functions.Whereas HAL library is already an abstraction layer in itself.HAL lib is already made so that the user can change or create functions in premade locations.This enable's your code to already follow standards.HAL is also made to promote code porting between STM32's.HAL is great to make prototye and for debugging since they are complete functions that already have debugging and fail proof systems embedded in them (like asserts).But when it's time to make code for a product HAL can be annoying and are way bigger in code size then st periph librairy.

So to make a prototye , to test MCU functionalities or to make code that doesn't need big optimisation speed-wise nor highly customized functions. HAL is the way to go ,you just have to make sure that your MCU has the storage space for a higher code size.

For applications that have limitted run time and that need to be optimised , like an application that runs on battery power.Or for products that need small code size and/or highly customised code ,ST periph is the one you need.