Author Topic: Any good learning resources for STM32?  (Read 1804 times)

0 Members and 1 Guest are viewing this topic.

Offline Emil

  • Regular Contributor
  • *
  • Posts: 149
  • Country: no
    • ZeptoBit
Any good learning resources for STM32?
« on: December 22, 2015, 10:16:40 am »
I'm looking for a good resource for learning to use the STM32F0x series.

There is the datasheet, programming manual and reference manual, but they are more useful as references than as a way to learn the basics. There's a lot of forum posts, blog posts and code examples around, but picking up knowledge from such fragmentet sources is a confusing way to get started.

Are there any good books, comprehensive tutorials, online courses etc.?
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: Any good learning resources for STM32?
« Reply #1 on: December 22, 2015, 10:54:35 am »
It really depends on what you are trying to learn and how you intend to use the chips (and how comfortable you are with coding a mcu).

Generally speaking, the datasheet (reference manual in this case) is really the only good way (and in my view the best way) to learn about a chip. Yes, the learning curve is quite steep but after awhile you get your way around it.

Most of those chips are not meant to be coded in assembly. So unless you are doing something extraordinary, reading the ARM instruction book (and the "definitive guides" from Yiu) is of no practical value to a practitioner - I have all of them and I rarely read them.

Most of those chips are programmed through libraries, mostly with OEM libraries and sometimes with proprietary firm-specific libraries. Generally speaking, there is no good resource for those libraries - you pretty much have to reverse engineer the code by cross-referencing the code to the datasheet(=reference manual here). The level of difficulties here depends greatly on the quality of the libraries you use and examples provided by the library vendors. Unfortunately, ST isn't well known for providing quality libraries, to put it mildly if you stick with the OEM library (=standard peripheral library. The Cube is far worse and in my view should be avoided at all cost).

So the best advice I can give you is to read the datasheet/reference manual as many times as you can, and then practice coding as much as you can.
================================
https://dannyelectronics.wordpress.com/
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 2607
  • Country: us
Re: Any good learning resources for STM32?
« Reply #2 on: December 22, 2015, 05:51:02 pm »
The datasheet ("reference manual") isn't too bad, especially with several different libraries to compare it to (by looking at the source code.)
An additional problem with the libraries is that they aren't documented well enough to EXPLAIN the hardware, and they're not abstract enough to permit you to get by without understanding the hardware.  The 32f0xx chips should be relatively simple compared to the bigger chips, I think.
 

Online blueskull

  • Supporter
  • ****
  • Posts: 9947
  • Country: cn
  • Power Electronics Guy
Re: Any good learning resources for STM32?
« Reply #3 on: December 22, 2015, 06:00:42 pm »
There are always 2 ways to do this, either from reference manual to library, or from library to reference manual.
If you want to learn how exactly the underlying hardware works, definitely read DS and RF thoroughly, at least the part you are interested in.
If you just want to get the jobs done, then read documentation on library is enough. When in doubt, refer to RM.

Usually you can expect a big brand have good documentation on both their library and RM (This does not happen every time).

Side story:
I'm working on ADSP-BF706 right now, and it is horrible. Library comes mostly undocumented (have Doxygen crap, no details), and both SWRM and HWRM comes broken.
They do provide errata sheets, but for god's sake, why do not compile them into new version of RM? At least compile the errata in a separate PDF, not the damn online only HTML.
And in some cases, libraries does not work on custom boards. You need to either modify them (thankfully they provide source code), or copy their reference design exactly.
SIGSEGV is inevitable if you try to talk more than you know. If I say gibberish, keep in mind that my license plate is SIGSEGV.
 

Offline Brutte

  • Frequent Contributor
  • **
  • Posts: 504
Re: Any good learning resources for STM32?
« Reply #4 on: December 22, 2015, 07:35:26 pm »
I'm looking for a good resource for learning to use the STM32F0x series.
There is the datasheet, programming manual and reference manual, (..)
Are there any good books, comprehensive tutorials, online courses etc.?
I'd start from listing of thorough understanding of ANSI C (and friends), then comes tweaking of the toolchain (that is: compiler, linker, librarian, simulator, debugger) and accompanying environment (at least: make, version control and unit testing suite). After that there is the underlying Cortex M core (M0 in your case) and finally the peripherals on top.

If your question is about the peripherals then bare metal Standard Peripheral Libraries (SPL) from STM are quite easy to understand and well documented, each peripheral comes with number of dumb 101 examples.

However, Cortex-M are designed to operate with OS (to reduce development cost) so bare metal SPL clearly stands in contradiction with that. You can Hello World or blink a LED with SPL but forget about running multiple threads on one uC with SPL - no concurrency, no reentrancy, no resource protection.
So STM released the Cube version of peripheral libraries that do support OS environment (with protection) and although you can theoretically use Cube for bare metal and ignore the OS mechanisms involved, that is not what it was designed for. Using Cube requires deeper understanding of what is going on than dumb SPL because it involves a lot of OS-necessary code (that can be ignored or even commented-out for bare metal stuff).

If you are already proficient in underlying vendor-independent stuff then I'd suggest the SPL and examples there as next.

EDIT: The new OS-aware peripheral library from STM Cube is called "HAL Library", which stands for: Hardware Abstraction Layer.
Whatever.
« Last Edit: December 23, 2015, 04:09:03 am by Brutte »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf