> Have you looked at the datasheet?
Both datasheet and reference manual. And then rest of the related documentation.
> In other words, having a clue about what STM32MXCube does.
CubeMX is a clicky configurator for Cube (which is the "library"), and that in turn implements a relatively miniscule subset of what the hardware allows - the "most common cases".
I don't think there is any reason to "learn Cube/CubeMX". Learn the mcu.
JW
Hey EEV-folks,
I'm looking into knowledge material for hobbyists to better understand the inner workings of STM32 µCUs. I am trained in C/C++ but nothing specifically regarding embedded programming.
For example : the different elements : clocks and prescalers, timers, registers, (etc.) and how they work with each other. In other words, having a clue about what STM32MXCube does. And other aspects of µCUs.
I'm looking at what ST's website offers in their e-learning section, and refer to their pletnifull different docs.
I also spotted Donal Norris' book "Programming With STM32: Getting Started With the Nucleo Board and C/C++" ISBN: 978-1260031317
Any opinion, advise, pointers?
Thanks for reading!
Hey EEV-folks,
I'm looking into knowledge material for hobbyists to better understand the inner workings of STM32 µCUs. I am trained in C/C++ but nothing specifically regarding embedded programming.
For example : the different elements : clocks and prescalers, timers, registers, (etc.) and how they work with each other. In other words, having a clue about what STM32MXCube does. And other aspects of µCUs.
I'm looking at what ST's website offers in their e-learning section, and refer to their pletnifull different docs.
I also spotted Donal Norris' book "Programming With STM32: Getting Started With the Nucleo Board and C/C++" ISBN: 978-1260031317
Any opinion, advise, pointers?
Thanks for reading!
I too have a lot of experience with C and studied electronics, communications, radio etc etc before embarking upon a career as a programmer, but I had little recent exposure to MCUs.
Here's what I did and what I recommend:
1. Use Visual Studio (not Visual Studio Code) then install VisualGDB, these two together are excellent, certainly for someone just starting out.
2. Install the STM Cube app too.
3. Get some STM32 F4 boards like these:
https://www.amazon.com/gp/product/B01I8XLEM8/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1
4. Get these books (The Norris one is certainly helpful)
https://www.amazon.com/gp/product/1260031314/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1
https://www.amazon.com/gp/product/0997925949/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1
5. Do this basic example from the VisualGDB STM32 tutorials section.
VisualGDB is excellent, you can create from-scratch projects or import existing projects created by Cube.
Here's a tutorial specifically for this board.
A scope and stuff can help too, these gizmos basically consume and produce signals so being able to see them is a huge help.
The device's datasheets are a good reference but unhelpful to someone just starting out, you need to know what questions to ask first and have to start somewhere, that second book is more technical though and will prepare you for eventually studying the datasheets.
If you really want to learn about the working of the peripherals try searching the web for information about this in general, not just the STM32 setups. Like a search for "microcontroller timer peripheral" can lead you to this.
Like others wrote, the reference manual is the place to find information about how to use them and what the register settings mean, but it does not tell much about the inner workings. For this you have to look into digital circuits.
If it is to learn how to use the STM32 peripherals specific, then I suggest to get yourself some hardware like a bluepill (STM32F103) including a ST-link V2 or V3 or a clone and think up of things you like to do with it. It depends on how much money you want to throw at it and how fast you want it. You can search Aliexpress or Amazon to find yourself some interesting boards.
The ST-link will allow programming and debugging, but you need some IDE for it, unless you like command line tools. It is possible to use GDB and openOCD on command line level to do all the needed tasks.
I myself use an old version of Netbeans IDE on Linux, but there are many other IDE's for it.
To go in deep I would say, forget about CubeMX and all other by STM32 supplied tools and their HAL. Go bare metal. It is not hard. For example see some of my work here.
Depending on what OS you are on you can pick your poison, be it Microsoft or some open source setup.
When you have your setup just start programming and see if it works like you expect it to work. Having some tools to measure things can also be handy when working on peripherals. Like an oscilloscope to check if the pins are indeed making the intended PWM signal or that the SPI signals are what you expected.
Hey EEV-folks,
I'm looking into knowledge material for hobbyists to better understand the inner workings of STM32 µCUs. I am trained in C/C++ but nothing specifically regarding embedded programming.
For example : the different elements : clocks and prescalers, timers, registers, (etc.) and how they work with each other. In other words, having a clue about what STM32MXCube does. And other aspects of µCUs.
I'm looking at what ST's website offers in their e-learning section, and refer to their pletnifull different docs.
I also spotted Donal Norris' book "Programming With STM32: Getting Started With the Nucleo Board and C/C++" ISBN: 978-1260031317
Any opinion, advise, pointers?
Thanks for reading!
I too have a lot of experience with C and studied electronics, communications, radio etc etc before embarking upon a career as a programmer, but I had little recent exposure to MCUs.
Here's what I did and what I recommend:
1. Use Visual Studio (not Visual Studio Code) then install VisualGDB, these two together are excellent, certainly for someone just starting out.
2. Install the STM Cube app too.
3. Get some STM32 F4 boards like these:
https://www.amazon.com/gp/product/B01I8XLEM8/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1
4. Get these books (The Norris one is certainly helpful)
https://www.amazon.com/gp/product/1260031314/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1
https://www.amazon.com/gp/product/0997925949/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1
5. Do this basic example from the VisualGDB STM32 tutorials section.
VisualGDB is excellent, you can create from-scratch projects or import existing projects created by Cube.
Here's a tutorial specifically for this board.
A scope and stuff can help too, these gizmos basically consume and produce signals so being able to see them is a huge help.
The device's datasheets are a good reference but unhelpful to someone just starting out, you need to know what questions to ask first and have to start somewhere, that second book is more technical though and will prepare you for eventually studying the datasheets.So more info: I do have a few nucleo boards. I use STMCubeIDE with MX. I have an oscilloscope and a basic logic analyzer. So far I've tried I2C and SPI, for example.
I use STM32Cube IDE for now. I'll have a look at VisualGDB.
I like that Norris' book is written for non-specialist, typically people already familiar with Arduino.
I do refer a lot to datasheets as much as I can, and various docs provided by ST. I sometimes refer to ST's "Community" site.
As a hobbyist, I'm trying to go beyond cargo cult programming by being able to have an (albeit basic) idea of the different peripherals' roles.
> You can't really say "go learn how to configure everything at the register level! Wizards and HALs are cheating!" if they have no idea what a timer is (I mean you can, but then you are just being difficult).
If you don't know what a timer is, then go and learn that. Wizards and HALs won't teach you that. And then come back and configure everything at the register level.
JW