cancel
Showing results for 
Search instead for 
Did you mean: 

How do I learn STM32 programing?

Ken Inoue
Associate III
Posted on March 12, 2017 at 15:15

I'm Japanese student, so I'm poor english.

How do I learn STM32 programing? I want to learn how to use ADC, PWM, 

Interrupt handling etc. Is there document or Video/Web seminar for novice? I want documents and video that is very easy to understand.

I have 

NUCLEO-F334R8, 

Discovery kit with STM32F334C8 and 

NUCLEO-F103RB. I have installed STM32Cube MX and IAR Embedded Workbench and I can run example code. 

#how-do-i-learn-stm32 #how-to-start
17 REPLIES 17
andy b
Senior
Posted on March 16, 2017 at 20:08

Hi

A lot of these answers are really good suggestions.One thing that you shouldn't forget is to get familiar with your IDE stick with what you know.IAR is a great IDE for STM32 especially with the cube.It's easy to shoot code in your board and the debugger is simple to use.I suggest you really play with your IDE .Look at some tutorials to learn how to use it properly if you find you are struggling to do certain things.This will help you a lot when starting to learn how to program your STM32 and when you are troubleshooting your code.

Best of luck to you .Wish you a lot of succes.

-Andy
Posted on March 16, 2017 at 20:57

I read, 'I'm Japanese student', and translated that to little to no money, kinda like me, so I said, free sounds good, especially for learning.

When I know I will make a lot of money, then I will purchase something like 'fill in the blank' a very expensive tool.

The

https://www.iar.com/buy/

does not show a price and that usually means $20,000 per year or more as I read it, which is a bit beyond most students. Fortunately, there are less expensive tools to use as a beginner.

I also read 'How do I learn STM32 programing', and translated that to, it's big, a huge amount to learn, it's overwhelming, where to start, any suggestions, and put up some really small stuff to begin and gain some confidence. I gave specifics, cause I know that's what I would want.

Dave Jones
Associate III
Posted on March 16, 2017 at 23:14

I have a different board, but the way I started was to download the STM32Cube Firmware package for my processor. It's basically a big folder full of examples that are ready to compile and upload to your board. You can try them out and then modify them to learn how they work and how to make changes to them. I find that a good way to explore a new processor.

Alan Chambers
Associate II
Posted on March 17, 2017 at 10:34

グループ�よ���。

I learnt by creating small projects on an STM32F4 Discovery board. I started with an empty main() and

looked for examples in this forum. The examples were all using the Standard Peripheral Library.

If I were doing it now, I'd get a Discovery board (or something similar), install the free edition of IAR's

Embedded Workbench (or Keil or whatever tool you like), and install STM32 CubeMX.

CubeMX will generate a working program straight from the GUI. This code will use the HAL library. Personally,

I regard the HAL as significantly inferior to the SPL, and I think the generated code is scruffy and hard to understand. But

it does work, and is a useful guide.

I advise you to step through the code slowly to learn what it is doing with the hardware registers. At the end of

the day, understanding a particular processor family is about understanding the registers and the core architecture, and

the particular software library that you use is a personal choice.

I would also spend some time reading about the Cortex-M3/M4 architecture. There are some good books on this topic

which are not related to the STM32, but explain a lot of what is going on inside the processor, such as how SVC calls

are used to implement an OS, how interrupts work on this hardware, and so on.
LMI2
Lead
Posted on March 17, 2017 at 17:55

When you look the  code Cube generated, you'll get files for ADC and serial bus and so on, if you enabled them in Cube.  Look closely what files there are and what is in them. Like:                    

HAL_ADC_Start(& hadc1);

                                    while (HAL_OK!=         HAL_ADC_PollForConversion(&hadc1, 1000))

                                    {

                                    }

                    ccc= HAL_ADC_GetValue(&hadc1);

You can then search for those function names with Google. There are a lot of blogs and web sites about programming STM32F devices with CUBE. and you will find examples showing how to use the functions.

Getting ADC and UART to work is not too difficult. Ethernet and USB probably is.

A Discovery board is better in my opinion because it was easy get every CPU pin out off board.

ChrisH
Associate III
Posted on March 19, 2017 at 22:58

I would strongly recommend getting mastering stm32 book mentioned before it's great and allowed me to kickstart into Hal quickly. You gonna be fluent in coding on stm32 in a month.

Thomas Borowczak
ST Employee
Posted on March 20, 2017 at 17:55

On top of all what has been written before, some usefull information can be found in the '

http://www.st.com/content/st_com/en/support/learning/stm32-education.html

' page on st.com :

- online trainings on the most recent STM32 series (STM32F7 and STM32L4)

- links on Massive Online Open Course. Available sessions :

http://www.st.com/content/st_com/en/about/events/events.html/stm32f7-online-course.html

http://www.st.com/content/st_com/en/about/events/events.html/stm32cube-basics-online-course-with-hands-on-exercises-a.html

http://www.st.com/content/st_com/en/about/events/events.html/stm32f0-l0-online-course-with-hands-on-exercises-a-html.html

- a selection of useful videos

- webinars

- a selection of recommanded text books (including Mastering the STM32 Microcontroller by Carmine Noviello)

- the list of live trainings organized by our support team in different cities in the world

- a list of our training partners.

This is just a begining. We continue to enrich this page with more content on how to get started and develop with STM32.

Stay tuned.

Path :

http://www.st.com/content/st_com/en/support/learning/stm32-education.html

Max
ST Employee
Posted on March 24, 2017 at 06:06

You may find usefull documentation in Japanese on the APS web site:

there are CortexM trainings:

https://www.aps-web.jp/academy/cm/

 

https://www.aps-web.jp/academy/m7/

 

and some STM32 reference manual translated into Japanese (column on the right):

https://www.aps-web.jp/magazine/st/v13/

 

regards,

Max