cancel
Showing results for 
Search instead for 
Did you mean: 

Tips for a beginner in STM32

carlosdelfino
Associate III

 

I'm taking my first steps as an embedded engineer, especially in STM32. I've been looking for a specialization that will give me more experience, in addition to the 35 years I have in IT (Client/Server) and about 10 in embedded systems.

I'm currently taking some quick courses to make it easier to get started, and I intend to get to STM32H7. I saw that there's a study path on the ST website.

Am I on the right track? I'd like to have tips from professionals with more experience in STM32.

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
tjaekel
Lead

Sure, use any STM32 board and get familiar with "embedded SW (FW) programming".
An STM32H7 is fine as well.

It just becomes a bit more tricky when it comes to MCUs with TrustZone and security (e.g. STM32N6).

You have to set some goals (for projects), e.g.:

  • toggle an LED ("Hello World")
  • to deal with peripherals, e.g. SPI, I2C - how to configure, how to wire HW, ...
  • to deal with RTOS (FreeRTOS or Azure RTOS) - a project using RTOS threads...
  • use USB (USR USB), e.g. for VCP (virtual USB UART) - here it becomes challenging to use the right drivers and SW stacks
  • get familiar with IDE: how to debug?, how to use macros, libraries, to set optimization, ...
  • get familiar with FPU (HW Floating Point Unit): how to enable, how to use (e.g. when using "float")
  • get familiar with all the HAL and other Libraries provided, e.g. for Sensors, AI, ...

Not rocket science - just to be aware of much more HW related things... like:

  • how to enable clock and power in an MCU
  • how to configure peripheral devices, pin configuration, ALT modes
  • how to debug code, esp. able to look into registers, check peripheral device registers...
  • able to compare and understand datasheet and reference manuals
  • able to read board schematics (e.g. to figure out which MCU I/O pin is used for what)

Have great fun with "embedded systems" programming... (most of all Linux and server knowledge you can forget, you have to learn how to deal with "tiny" things like MCU chips, HAL drivers, HW limitations, ...).

Good luck.

View solution in original post

6 REPLIES 6
tjaekel
Lead

Sure, use any STM32 board and get familiar with "embedded SW (FW) programming".
An STM32H7 is fine as well.

It just becomes a bit more tricky when it comes to MCUs with TrustZone and security (e.g. STM32N6).

You have to set some goals (for projects), e.g.:

  • toggle an LED ("Hello World")
  • to deal with peripherals, e.g. SPI, I2C - how to configure, how to wire HW, ...
  • to deal with RTOS (FreeRTOS or Azure RTOS) - a project using RTOS threads...
  • use USB (USR USB), e.g. for VCP (virtual USB UART) - here it becomes challenging to use the right drivers and SW stacks
  • get familiar with IDE: how to debug?, how to use macros, libraries, to set optimization, ...
  • get familiar with FPU (HW Floating Point Unit): how to enable, how to use (e.g. when using "float")
  • get familiar with all the HAL and other Libraries provided, e.g. for Sensors, AI, ...

Not rocket science - just to be aware of much more HW related things... like:

  • how to enable clock and power in an MCU
  • how to configure peripheral devices, pin configuration, ALT modes
  • how to debug code, esp. able to look into registers, check peripheral device registers...
  • able to compare and understand datasheet and reference manuals
  • able to read board schematics (e.g. to figure out which MCU I/O pin is used for what)

Have great fun with "embedded systems" programming... (most of all Linux and server knowledge you can forget, you have to learn how to deal with "tiny" things like MCU chips, HAL drivers, HW limitations, ...).

Good luck.

Thanks tjaekel  for the Roadmap, it's very informative and motivating.

I'm already familiar with Eclipse, I've used it with Java, PHP and HTML, and now I'm using it with the STM32.

Debugging is a bit different, but I'm familiar with it and willing to do it.

I still have doubts about Cortex-M issues, right now with DMA, I need to learn how to deal with AD capture and DMA for an academic project. I'm also having trouble with nested uses like Repetitive Timers and I2C, but that's on another platform that uses Cortex-M0+. On the STM32 I tried using the serial port and haven't had any success yet. I tried following some tips from the forums but I got more confused, hahaha, but with persistence I know I'll find the solution.

If you need help...   tj@tjaekel.com

"Cortex-M issues" - I think you struggle with some MCU peripherals (not with the processor, Cortex-M, itself).
The peripherals in an MCU are "additions" to a Cortex-M core. So, you have to study the datasheet and esp. the reference manual. It is not related to ARM Cortex spec. (just the instruction part, INT handling, Core MCU registers...).

Good luck.
Yes, it can be tricky to bring up peripherals. Also DMA engines in MCU are vendor specific (and not related to Cortex-M processor core). And DMA engines can differ from MCU chip to another, even on STM MCUs/boards.

Just provide more info what your current issues are.
A UART is pretty straight forward, but when it comes to "UART via USB" (VCP, ACP) - this is can tricky because now a huge USB stack (LIB) involved.

Which MCU (board) do you use?

CM0, CM0+, CM4, CM7 are different in the instruction set - but this should be "hidden" for you as a FW programmer. But the MCU chips where these cores are use can differ a lot: You cannot mix experience and code:

You have to go always with the correct HAL drivers (LIBs) for your board, use the associated datasheets and reference manuals. And never assume you can reuse code from one board another, even high level code like in main(). Some chips have completely different ways to configure clocks and power, what to enable and how...

Good luck.

E-mail noted, let's interact here if it's okay for me to post my questions, they will be very basic at first,

Yes, I understand the difference between the core (Cortex-M) and the MCU itself, I'm going to open a new post with a new question that came up, a difficulty with the RP2040 and I would like to know how to solve it on the STM32.

Today I found a tutorial here in the community on how to use Serial via USB and it was much easier than I imagined, I was making a mistake in the function declaration, I needed to define a macro beforehand with the name of the function that would deliver the characters to USART.

I'm using the Nucleo-F411RE and the Nucleo-F429ZI, and I'm going to buy a Nucleo-F756ZG soon.

One document I miss is one that talks in detail about the SDK, the C functions that exist and that can be used. Maybe during the STM32H7 trail that I intend to do I will find this document, but I am already starting to miss this information.