Skip to main content
Graduate II
January 17, 2025
Solved

Tips for a beginner in STM32

  • January 17, 2025
  • 2 replies
  • 1861 views

 

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.

    This topic has been closed for replies.
    Best answer by tjaekel

    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.

    2 replies

    tjaekelAnswer
    Visitor II
    January 17, 2025

    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.

    Graduate II
    January 18, 2025

    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.

    Super User
    January 17, 2025
    Graduate II
    January 18, 2025

    I'm already reading it, thanks.

    Visitor II
    January 18, 2025

    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.