cancel
Showing results for 
Search instead for 
Did you mean: 

For better learning STM32 programming and debugging

Md Mubdiul Hasan
Associate III

Hi there,

I have been using STM32 nearly 10 years.

I did modification according to company requirements. But it doesn't mean I am very good at C,C++ or else. I understand coding if it'd in C or C++ format. 

 

I understand mathematics, logics and conditioning.

 

Kindly suggest materials/ guidelines/ books/ tutorials that might help me to write coding/ debugging and finding root cause of failure.

Let's say staring with ARM cortex type M0. 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Andrew Neil
Evangelist III

@Md Mubdiul Hasan wrote:

Kindly suggest materials/ guidelines/ books/ tutorials that might help me to write coding/ debugging and finding root cause of failure.


98% of this is not specific to the particular microcontroller - these are general, transferrable skills.

Most of it is down to being able to analyse a problem and define a solution.

 


@Md Mubdiul Hasan wrote:

Kindly send link only for STM32.


You can't be so narrow. You need the general topics like the Cortex-M0 architecture, general electronics, and general C programming.

For understanding the Cortex-M architectures, Joseph Yiu's Definitive Guide books are required reading:

https://www.amazon.co.uk/Books-Joseph-Yiu/s?rh=n%3A266239%2Cp_27%3AJoseph+Yiu

For understanding the STM32, the device Datasheet and Reference Manual are key documents - you will find these and much more on the Product Page for the chip in question.

 

Some general tips on How To Debug:

https://community.st.com/t5/community-guidelines/how-to-write-your-question-to-maximize-your-chances-to-find-a/tac-p/706966/highlight/true#M49

Specifically on debugging Cortex-M Hard Faults:

https://community.st.com/t5/community-guidelines/how-to-write-your-question-to-maximize-your-chances-to-find-a/tac-p/708193/highlight/true#M51

 

Some learning & reference materials for C programming:

https://blog.antronics.co.uk/2011/08/08/so-youre-thinking-of-starting-with-c/

 

Some more learning & reference materials applicable to embedded microcontrollers:

https://www.avrfreaks.net/s/topic/a5C3l000000UYGFEA4/t145493?comment=P-1392529

 

Another important skill is How To Read Compiler Error Messages:

https://community.st.com/t5/stm32cubeide-mcus/type-missing-binary-operator-before-token-quot-quot/m-p/719446/highlight/true#M30606

 

 

View solution in original post

11 REPLIES 11
STTwo-32
ST Employee

Hello @Md Mubdiul Hasan 

For the cortex-M0, i may suggest you the documents available on this link. Also, you can check our progarmming manuals for devices using cortex-M0 et Cotex-M0+ . Also, i may suggest you to contact ARM throw there community or to try there online trainings.

Best Regards.

STTwo-32 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Md Mubdiul Hasan
Associate III

Thank you.

Kindly send link only for STM32.

Hello @Md Mubdiul Hasan ,

You can refer to the STM32 Academy: https://academy.st.com/s/catalog-detail-standard?ltui__urlRecordId=a603W000000XZAHQA4

Or to our articles in this link: https://community.st.com/t5/stm32-mcus/tkb-p/stm32-mcus-knowledge-base

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Can you suggest very good books?

Google it:

https://www.st.com/content/st_com/en/support/learning/stm32-education/text-books.html

https://leanpub.com/mastering-stm32

https://www.elektormagazine.com/news/advanced-programming-stm32-mcus

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Andrew Neil
Evangelist III

@Md Mubdiul Hasan wrote:

Kindly suggest materials/ guidelines/ books/ tutorials that might help me to write coding/ debugging and finding root cause of failure.


98% of this is not specific to the particular microcontroller - these are general, transferrable skills.

Most of it is down to being able to analyse a problem and define a solution.

 


@Md Mubdiul Hasan wrote:

Kindly send link only for STM32.


You can't be so narrow. You need the general topics like the Cortex-M0 architecture, general electronics, and general C programming.

For understanding the Cortex-M architectures, Joseph Yiu's Definitive Guide books are required reading:

https://www.amazon.co.uk/Books-Joseph-Yiu/s?rh=n%3A266239%2Cp_27%3AJoseph+Yiu

For understanding the STM32, the device Datasheet and Reference Manual are key documents - you will find these and much more on the Product Page for the chip in question.

 

Some general tips on How To Debug:

https://community.st.com/t5/community-guidelines/how-to-write-your-question-to-maximize-your-chances-to-find-a/tac-p/706966/highlight/true#M49

Specifically on debugging Cortex-M Hard Faults:

https://community.st.com/t5/community-guidelines/how-to-write-your-question-to-maximize-your-chances-to-find-a/tac-p/708193/highlight/true#M51

 

Some learning & reference materials for C programming:

https://blog.antronics.co.uk/2011/08/08/so-youre-thinking-of-starting-with-c/

 

Some more learning & reference materials applicable to embedded microcontrollers:

https://www.avrfreaks.net/s/topic/a5C3l000000UYGFEA4/t145493?comment=P-1392529

 

Another important skill is How To Read Compiler Error Messages:

https://community.st.com/t5/stm32cubeide-mcus/type-missing-binary-operator-before-token-quot-quot/m-p/719446/highlight/true#M30606

 

 

LCE
Principal

Reading helps, but I recommend doing that in parallel with working / playing with some real programming environment and hardware.

So get a Nucleo board, install STM32CubeIDE - and just do it!


@LCE wrote:

So get a Nucleo board, install STM32CubeIDE - and just do it!


Indeed! 

Don't waste time with a blue/black/whatever pill - get a genuine ST Nucleo, which includes a genuine ST-Link, has a load of ready-to-use examples, and is well-known and well-supported by both ST and this community.

Getting Started steps:

  1. Write some code to blink an LED connected to a pin, using a simple software loop.
  2. Learn how to use your debugger to step through your simple LED code, look at your variables, set breakpoints, etc 
  3. Learn to use the UART to transmit a fixed "Hello, World " string.
    Again, 
    practice using the debugger with it.
  4. Adapt your code to be able to send a variable string.
    This will be invaluable for future work! 
    Keep practicing with that debugger...
  5. Adapt your code to be able to receive on the UART
  6. By now, you should be well prepared not only to write your own code, but also to debug it.

(From an original post here, but the formatting there seems to have got corrupted)

 

PS:

Applying the above to a specific project:

https://community.st.com/t5/stm32-mcus-boards-and-hardware/connection-between-2-stm32-mcu-boards-using-uart-with-only-one/m-p/719885/highlight/true#M21355

 

#BeginnerGettingStarted

Andrew,

Your suggestions looks suitable.

I have few different STM32 board to play with.

Let's try your materials.