cancel
Showing results for 
Search instead for 
Did you mean: 

Standard Periph Library vs HAL

SoHaeng.Lee
Associate II
Posted on January 26, 2016 at 11:29

Hi everybody.

I confuse.

I just begun study STM32 series.

In a month, i studied hard STM32F3, F4 and i used Standard Perish Library.

But, when i used STM32CubeMX, this application creat HAL base projects.

what is better selection?
11 REPLIES 11
Radosław
Senior
Posted on January 26, 2016 at 12:25

The best choise is put away any library.   Use register based programming style.  Library use only for examples or help in some troubles.

AvaTar
Lead
Posted on January 26, 2016 at 12:38

> The best choise is put away any library.   Use register based programming style.

 

Only the best choice for a hacker, doing single-device projects.

If you develop for a device platform with several similar, but different controllers, you want to re-use as much code as possible, to cut costs for development time and testing.

That's what a good library delivers.

The 'old' SPL is stable, but abandoned by ST, and not available for the latest MCUs.

The CubeMX is new, supported, and littered with bugs. And the ''Click and Drag'' approach (IMHO) totally misses ST's most important target audience.

Or, as Murphy's Law states ''A software designed for idiots is only used by idiots''.

Finally, the choice is yours.

Radosław
Senior
Posted on January 26, 2016 at 13:20

> The best choise is put away any library.   Use register based programming style.

Only the best choice for a hacker, doing single-device projects.

You are VARY not true.  Probably you don't now what you say.
AvaTar
Lead
Posted on January 26, 2016 at 13:31

> You are VARY not true.  Probably you don't now what you say.

 

Perhaps true.

But at least a dozen of companies in the embedded business, existing longer than a few month or years, are seeing it my way.

Radosław
Senior
Posted on January 26, 2016 at 14:45

And what? 

I now many companys using STM32but NOT using any library. ST sales department says this same.

AvaTar
Lead
Posted on January 26, 2016 at 15:15

> ST sales department says this same.

 

That says it all.

Posted on January 26, 2016 at 15:22

It doesn't make it very portable, or transferable to others and can take hours to get right and debug. Most of the examples I see, claim to do it for efficiency, but are woefully implemented and poorly commented.

If it works for you, great, but it is not how I'd recommend doing it.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Radosław
Senior
Posted on January 26, 2016 at 15:43

> It doesn't make it very portable, or transferable to others and can take hours to get right and debug.

1. Good register based code is much more portable than any library HAL or espessialy SPL.

2. Is much more debuguble.You directly see what must be in register.

3 Many people cry when they want to port aplication prom L1 (SPL) to L0 (SPL never exist). In reg based coding this wil take port this will take only few days.

4. How many aplication starts be development before any library be develop. (I'm one of very good exaples of it).

5. How many mistakes have SPL or HAL. ( quick look up of this forum 1 of 4 topic are bug report).

6. Effeciency

7. Better knowleage of architekture of periferals and core.

8. What if after few years HAL will be ambadonned?

....

This is my opinion
Posted on January 26, 2016 at 16:26

> It doesn't make it very portable, or transferable to others

SPL does not do much in way of portability either; the compatible peripherals do, but then it really does not matter whether you use SPL or not.

> and can take hours to get right and debug.

Eh?

> Most of the examples I see, claim to do it for efficiency, but are woefully implemented and poorly commented.

Omitting your examples, most SPL-based (or any other library-based) examples I see are woefully implemented and poorly commented.

> If it works for you, great, but it is not how I'd recommend doing it.

+1 (i.e. if ''libraries'' work for you, great, but it is not how I'd recommend doing it 😉 )

JW