2022-01-24 10:30 AM
Hi all,
I'm an experienced C++ programmer who happen to start learning embedded programming, with a little stuff, like STM32F411RE Nucleo-64 (the board I'm working on mainly) and a blue-pill alongside breadboard and a bunch of wires. I haven't done much in embedded programming since it's hard when you get started alone at home without any instructor.
As an example, using an STM32 C++ project on the STM32CudeIDE, I can blink the LED of the board (when it's connected to my Windows machine) using this code-snipped in the main.cpp file:
HAL_GPIO_TogglePin (GPIOA, GPIO_PIN_5);
HAL_Delay (3000);
It's also possible for me to write a few simple functions in that file to, say, generate prime numbers and so forth. Ergo, it should now be evident that my experience is precious little.
Even though I'm really interested in embedded programming unfortunately whatever series/tutorials I've found on the Web have either been using more embedded stuff that I lack now, or working on complicated projects that are beyond my knowledge.
I also have found two books:
1) https://www.amazon.co.uk/Programming-STM32-Getting-Started-Nucleo-ebook/dp/B07B6TY9Z9
but not sure to read them or not.
My purpose is to continue learning embedded programming using C++ and the embedded stuff I'm having now (mentioned above) and make progress, if possible. But unfortunately I don't know how to do that!
What're your pieces of advice for me, please?
Thanks so much for your time and help.
2022-01-24 11:35 AM
Most information online is in C, not C++, but there is not much embedded specific information you need if you are already familiar with C++.
I would avoid dynamic memory allocation on embedded systems, but that is an opinion not a requirement.
2022-01-24 11:45 AM
I try well to keep myself from what is not appropriate to be done using C++ in embedded (line dynamic memory allocation). So considering my background and experience, what do you suggest to me to make progress learning embedded programming better using my board.
For instance, a tutorial embracing a number of related projects, a series, or even a book.
2022-01-24 12:03 PM
2022-01-24 12:49 PM
It's almost impossible to learn those specific topics of embedded programming without a tutor/tutorial for one who has no experience in this case, and the outcome will be quite possibly in vain. That's why I'm sure without a good reference to tell how to lean and do stuff step-by-step, the outcome will be in vain.
For programming it was much more straightforward: Chose C++ as the language, VS as the IDE, and a book of Stroustrup as a reference and made progress quite well little by little.
For embedded programming, too, a course, series, tutorial, reference, book, and so forth is undoubtedly necessary apart from the language and board. I'm sure every embedded programmer has learnt the skill through one of these ways or something alike.
But thank you for your time and remarks.
2022-01-24 02:28 PM
Building an embedded project is not like learning a language like C++. Language is self-sufficient in itself.
For an embedded project you must know the platform you are using intimately. Therefore :
Prepare to spend several months to master all of this.
I started with: https://leanpub.com/mastering-stm32?utm_campaign=mastering-stm32&utm_medium=embed&utm_source=embedder
The part concerning Eclipse is no longer relevant since ST bought TrueSTUDIO and provided STM32CubeIDE. But the rest is easy to read and very informative.
2022-01-27 11:04 AM
Thanks for your good answer.
If I want to firstly go forward with one of those links, as a beginner of embedded programming, which one do you suggest, please?
2022-01-28 06:06 AM
IMO the 1st thing to do is master the tools.
Install IDE
Study a simple example: LED blink as usual
Build your 1st project to blink a LED
The rest is knowledge accumulation and experimentation.
This does not mean that it is enough to write a "good" application. Then the same rigor of design and production is necessary whatever the field: embedded or not.
2022-01-28 09:56 AM
I see.
I'm also not sure if you've read my first post here or not, but just to re-mention, I've installed STM32CubeIDE, STM32CubeMX plus STM32CubeProgrammer. As well as, I've written a simple C++ project to blink the LED of my STM32NucleoF411RE board when it's connected to my Windows machine. Moreover, I'm able to write a typical piece of code in C++ to output a result, just like console applications, and observe that output on the IDE too. I've done these based on self-education and must make progress this way yet.
1) So what I need first is a second project. What do you suggest that I work on as the second project/example/exercise to be a little more advanced than what I did via my board, please?
2) Do you also agree that I start reading the book you started with?
I like to learn stuff and carry them out practically at the same time to acquire the knowledge appropriately.