cancel
Showing results for 
Search instead for 
Did you mean: 

I want to learn more about programming ARM microcontrollers

BTurc.2
Senior

Hello everyone, I recently came across a subject at the university in which we programmed a discovery board. Normally what we did was configure the peripherals with the CubeMx, then we added some libraries for sensors to the project, and we programmed what we wanted it to do. The thing is that we always copied things already done in other example projects and modified it.

I what to learn to program the STM32 from scratch and not depend on files already written by other people. I have knowledge of digital electronics, I know how microcontrollers work in general terms. I know how to program in C and I'm looking at some programming books on ARM CortexM microcontrollers.

What books, courses, websites, etc... do you recommend I look at? I would like to not depend on the STM32CubeIDE to be able to program the microcontrollers. I aslo wouldn't like to depend on existing files. I want to programe it from scratch.

Thank you very much in advance!

1 ACCEPTED SOLUTION

Accepted Solutions

>>Assemblers, Compliers, Linkers, and Loaders

Basically one of those college level CS books/classes covering all the mechanics and moving parts. I'm an EE, and I've written assemblers, disassemblers and linkers. I've tinkered with compilers, but I've no particular desire to write one from scratch.

Project files for different IDE vary. These days often XML, and describe meta-data about files, tree, locations of libraries and include files. Allows the tools to enumerate the pieces, track dependencies, drive the tools command lines. Some tools can generate makefiles.

GNU/GCC and MAKE work pretty much universally across MCU's you find the cross-compiler to suit your host and target.

Books and manuals on Eclipse ?

Tutorials on building a project from scratch on an IDE? Those likely exist, videos probably on YouTube depending at what level of detail you seek.

https://www.amazon.com/s?k=Joseph+Yiu+Cortex-M

https://www.st.com/resource/en/programming_manual/pm0214-stm32-cortexm4-mcus-and-mpus-programming-manual-stmicroelectronics.pdf

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..

View solution in original post

6 REPLIES 6

Building on materials already available tends to save a lot of time and scale better.

If you want a 1980's coding experience, perhaps pull the Reference Manual for the STM32 and work through the register definitions of the peripherals.

To learn the cores perhaps some of the original ARM TRM and 32-bit assembler, and then move to the 16-bit Thumb(2).

Joseph Yiu has some good Essential Cortex-M3 (and related) series. ST has their Programming Manual

Perhaps you want the Assembler, Complier, Linker, and Loader angle?

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..

Perhaps you want the Assembler, Complier, Linker, and Loader angle?

I don't want to program the peripherals with the reference manual,I want to understand what project files do, and I think knowing how to make them myself is a good way to undersatnd what they do. Maybe if I understand what the assembler, compiler and linker are, I can roughly understand what they are for. Where can I find out about this??

Thank you so much!

>>Assemblers, Compliers, Linkers, and Loaders

Basically one of those college level CS books/classes covering all the mechanics and moving parts. I'm an EE, and I've written assemblers, disassemblers and linkers. I've tinkered with compilers, but I've no particular desire to write one from scratch.

Project files for different IDE vary. These days often XML, and describe meta-data about files, tree, locations of libraries and include files. Allows the tools to enumerate the pieces, track dependencies, drive the tools command lines. Some tools can generate makefiles.

GNU/GCC and MAKE work pretty much universally across MCU's you find the cross-compiler to suit your host and target.

Books and manuals on Eclipse ?

Tutorials on building a project from scratch on an IDE? Those likely exist, videos probably on YouTube depending at what level of detail you seek.

https://www.amazon.com/s?k=Joseph+Yiu+Cortex-M

https://www.st.com/resource/en/programming_manual/pm0214-stm32-cortexm4-mcus-and-mpus-programming-manual-stmicroelectronics.pdf

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..

If you say perhaps (not sure) - then don't waste your time with assembler, linker and even the compiler. (well all these are terribly interesting topics for someone...) Life is short and there are LOTS and LOTS of more worthy things to learn. You simply don't have time for nuisances. Now the problem with books is that a good useful book is hard to write, it takes effort but becomes obsolete very fast. So IMHO the best modern path to learn microcontrollers with your background (C coding) is to participate in a real team project, working with others and learning from co-workers. Read the ARM Cortex manual, STM32 documentation & learning materials and compiler/linker/etc documentation as needed.

Work with real code. Reading and understanding code written by others is hard, but very useful for your development.

Use the AI.  It can instantly provide insights and code examples. It grows stronger every day.

 

Reading the forum I see that it is very difficult to learn everything from scratch. To improve, I suppose I will do projects with all the tools I have. But at least how the linker or the assembler works, I would like to at least understand what they do!

Pavel A.
Evangelist II