cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L4 Standard Peripheral Libraries

Kaza K
Associate II
Posted on November 08, 2017 at 09:37

Hello, 

  1. Are the Standard Peripheral Libraries available for L4 series?

  2. If not, maybe it is possible to use StdPeriph from e.g. F4? Register addresses are the same or not?

  3. Maybe there is some way to extract it from HAL lbr?

Best regards,

Kaza

#std-peripheral-lib #stm32-l4
8 REPLIES 8
Andrew Neil
Evangelist
Posted on November 08, 2017 at 10:00

ST has deprecated the old Standard Peripheral Libraries for some years now.

Googling 'STM32L4 Standard Peripheral Libraries' gives:

http://www.st.com/en/embedded-software/stm32-standard-peripheral-libraries.html?querycriteria=productId=LN1939

The later libraries tended to be called, 'DSP & ...' - so

Googling '

STM32L4 DSP and Standard Peripheral Library' gives:

https://electronics.stackexchange.com/questions/312184/where-can-i-found-stm32l4-dsp-and-standard-peripherals-library

So it looks like you're out of luck.

But why not use the HAL LL (Low-Layer) functions:

http://www.st.com/content/ccc/resource/technical/document/user_manual/63/a8/8f/e3/ca/a1/4c/84/DM00173pdf/files/DM00173pdf/jcr:content/translations/en.DM00173pdf

See:

https://community.st.com/thread/32362#comment-97413

Posted on November 08, 2017 at 10:13

Hi Andy,

But why not use the HAL LL (Low-Layer) functions:

Because it's superfluous.

You asked... 😉

But seriously, we don't know Kaza's motive. He might want to port older non-L4-SPL code; he might want to see a set of examples; or he might follow best practice whatever that means. LL won't help with the first two; using it for the last one is just question of personal preferences.

JW

Posted on November 08, 2017 at 10:22

Thank you for your answers. 

I want to use std lbr for few reasons:

- had a lot of problems with HAL lbr (especially with malfunctioning SPI; someone also noticed it and posted here scr from oscilloscope where clk stops ticking to fast) - finally did it with std lbr and worked well

- definitely I've got better control over my HW

- finally, I need to convert project from F1 to L4 which is written using std lbr - I wanted to do it in the easiest way...

Ps. I've extracted from HAL lbr the startup and stm32l4xx.h, so although I've got startup and registers with addresses. Better this than nothing....

Kaza

Posted on November 08, 2017 at 12:04

So have you looked at the LL functions?

They are a fairly recent addition to the HAL, and work at a similar level of abstraction to the old StdPeriph.

David SIORPAES
ST Employee
Posted on November 08, 2017 at 13:22

You may want to give a try to 

http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-configurators-and-code-generators/spl2ll-converter.html

 which helps in migrating from SPL based projects to LL.
Posted on November 08, 2017 at 13:23

Yes, I've looked at them. Very important information is that:

'The low-ayer APIs are designed to be used in standalone mode or combined with the HAL.''The low-layer APIs can be used without calling the HAL driver services.'

However, a bit of code will have to be rewritten 😉

I will check that lbr /in the field/ when I solder all components. 

If I encounter some problems with that LL functions I will let here know.

Best regards,

KK

Posted on November 08, 2017 at 13:28

It looks very interesting and if it work, it will save me a lot of time. I will definitely check it. Thank you!

Posted on November 08, 2017 at 13:46

Well, whatever you do - a bit of code is going to have to be re-written!

I wasn't previously aware of the SPL-to-LL converter (suggested by

siorpaes.david

‌ below) - looks like that is the way to go!