Difficulty in starting work
The book and git don't have a proper tutorial to start with and the content is very confusing.
Please help me to upload the code in the right way
Regards
book and git don't have a proper tutorial to start with and the content is very confusing.
help me to upload the code in the right way
Thanks for your query @sami1369. Let's start with some basics. You can obtain the code by simply clicking on the green "Code" button and downloading the ZIP archive. See the picture below.

Once you have downloaded the project, we can build one of the samples or the reference application. i can help you along those lines.
What Operating System are you using?
Hi Christopher,
I searched for your email, but unfortunately, I was not successful. I had to send a message here to you.
My hardware is Arduino UNO, and I don't know what I should do to compile and upload it on the board?
Kind regards, Saeid
On Sat, 16 Jul 2022 at 16:07, Christopher Kormanyos < @.***> wrote:
Once you have downloaded the project, we can build one of the samples or the reference application. i can help you along those lines.
What Operating System are you using?
— Reply to this email directly, view it on GitHub https://github.com/ckormanyos/real-time-cpp/issues/270#issuecomment-1186160678, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHJCHM2HF7YQVA53SFNHSG3VUKNG7ANCNFSM53V7SZMQ . You are receiving this because you were mentioned.Message ID: @.***>
Once you have downloaded the project, we can build one of the samples or the reference application. I can help you along those lines.
What Operating System are you using?
Yes, I downloaded it and put it in a folder where Mingw-w64 is there
I downloaded it and put it in a folder where Mingw-w64 is there
OK. Good.
There are several ways to build and use the companion code. Builds are supported on LINUX, Windows, using GNUmake or CMake. But you are right, the build possibilities can, in fact, be confusing when starting.
A lot of folks have used LINUX systems. Others use Windows. A build system specifically targeting MinGW is not explicitly supported but probably would work with a bit of effort.
It can be easiest to first build for the Windows/LINUX host (in a command shell). As a second step, you can go for an embedded target build.
Of the following choices, how would you like to start?
- Build in MICROCHIP's ATMEL Studio.
- Build on LINUX with GNUmake.
- Build on LINUX with CMake.
- Build on Windows in Microsoft Visual Studio (using specially ported compilers here).
- Standalone build on the Windows command line.
Believe it or not, choice 5 can be extremely straightforward, requiring no added installations, just getting the toolchain, unpacking, moving it and executing the build command line. These exact instructions are shown here. But instead of building with MSBuild (as shown on line 589), a simple command line could be used.
Please don't hesitate to ask questions here as you proceed. It's good to have this as a reference thread in the issues.
Believe it or not, choice 5 can be extremely straightforward
If you diecde to go this way, that can be simple. When you've unpacked the toolchains, I can provide you with help regarding setting up the command line to build for Windows host.
I downloaded it twice, but the file has a problem and cannot be unpacked. Since it has a large volume, let me download and unpack it again; maybe the problem will be solved.
After After downloading a few times I get error when I want to unzip it:
can you give me another link to download?
I just downloaded the real-time-cpp-toolchains repository as a ZIP archive from GitHub and unpacked it with 7-zip. For me it works fine.
I'm not sure what your favorite unpacker is, but I've had good results with 7-zip.
It might not be a great idea to store such large archives at GitHub, but it is at the moment working and there is not at the present time an alternative storage location for these particular builds of the toolchains.
Thanks, I downloaded 7-zip.
I could unzip toolchains
What is the next step?
Thank
On Wed, 20 Jul 2022 at 18:22, Christopher Kormanyos < @.***> wrote:
I just downloaded the real-time-cpp-toolchains repository as a ZIP archive from GitHub and unpacked it with 7-zip. For me it works fine.
I'm not sure what your favorite unpacker is, but I've had good results with 7-zip.
It might not be a great idea to store such large archives at GitHub, but it is at the moment working and there is not at the present time an alternative storage location for these particular builds of the toolchains.
— Reply to this email directly, view it on GitHub https://github.com/ckormanyos/real-time-cpp/issues/270#issuecomment-1190315968, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHJCHMYERAMCSF4YZGNGGLLVVAAC3ANCNFSM53V7SZMQ . You are receiving this because you were mentioned.Message ID: @.***>
In your case, I recommend to build for the Windows host on the command line as a first step.
The later steps get you building for the embedded AVR controller. But taking an intermediate step to build for a PC will hopefully boost your confidence and provide a much better feeling for how the build system and toolchains all fit together.
So you need to move a directory, unpack a self extracting ZIP and issue a command line. Let's get started.
You should set up a topology like this (where you simply have the unpacked repositories real-time-cpp (master) and real-time-cpp-toolchains (master). See the image below.

Now you need to do a few manual steps.
- Move the tools: For this please move the directory
real-time-cpp-toolchains-master/ref_app/toolstoreal-time-cpp-master/ref_app/tools. See picture below. - Now we unpack the compiler for x86_64. Navigate to the directory
real-time-cpp-master/ref_app/tools/Util/msys64/usr/local. - Now locate the archive called
gcc-11.2.0-x86_64-w64-mingw32.exe. - Simply double click on that archive file to unpack the
gcc-11.2.0-x86_64-w64-mingw32toolchain. Say yes to unpack the toolchain.
Now we will build for Windows host.
- Open a command shell located in the directory
real-time-cpp-master/ref_app. - Execute the command
.\target\build\build.bat x86_64-w64-mingw32 rebuild. - The build begins.
- Find the executable file
real-time-cpp-master/ref_app/bin/ref_app.exeand run it. You should see the simulated PC LED blinking.
I found an actual bug in the toolchain. So when building, just click OK on any DLL windows that pop up. I will correct this bug soon.


As a second step, if you like this kind of build, we should get you set up with Visual Studio Community 2022, where you can enjoy the comfort of this build in that GUI.
Cc: @sami1369
~~Hi! I'm having some troubles in setting everything up in a Unix environment. I'm pretty new to it all, but I think I installed GCC correctly using homebrew. I have my Nucleo stm32f446 which I'd like to use but I've been getting some error messages. When following along, I'm stuck here:
After entering ./target/build/build.sh stm32f446 rebuild
i get the error
Are you familiar with what this would mean? Thanks for any help!~~
Issues with setting target build in MacOS. Created its own issue thread here
Are you familiar with what this would mean?
Hi Jeff (@jvco98), I'll take a bit more time for this later. Could you please create another issue for this independent point? I would like to also take this opportunity to sue up some more target builds on MacOS in the Ci setup as we progress.
2. .\target\build\build.bat x86_64-w64-mingw32 rebuild
Hi again, Apologies for the late reply, things were a bit crazy around here these days...

My system cant build the command because above error
cant build the command because above error
OK. It looks mostly there. The build command is successfully finding GNUmake version 4.2.1. Good job @sami1369.
The next issue is that the make system (within the calls executed in GNUmake) is not finding the x86_64 compiler.
You also need to unpack the compiler, which has been cloned as a self-exctracting zip archive.
Did you remember unpack the mingw x86_64 compiler?
Do you mean this?

Do you mean this?
Yes. My apologies, but the Windows build is actually one of the more complicated ones.
That actually looks good. I'm somewhat surprised the compiler can't be found. Have you tried to run the build again?
You can also try to manually run the command shown in the failed run above that prints the GCC compiler version.
That should at least tell us if the compiler is present and running without using any batch or shell complications.
Try something like (within the ref_app directory, ...) execute something like:
tools\Util\msys64\usr\local\gcc-11.2.0-x86_64-w64-mingw32\bin\g++ -v
Is there a different way to compile?
Is there a different way to compile?
There several ways to compile on Windows, LINUX and MacOS for each supported target.
Each method is described briefly in the documentation at the GitHub page for real-time-cpp, starting around here.
We use GNUmake, CMake, ATMEL Studio, Visual Studio, Bash or CMD line depending on the situation.
My first compilation for standalone AVR years ago used ATMEL Studio available now from MICROCHIP. ATMEL Studio is supported in this repository for the reference application.
Some developers use ARDUINO development environment to learn. This is different from the standalone approach used in this repository, but a great way to familiarize yourself with the AVR world.
The Arduino development environment is an appropriate choice for me because I tackle with every day. I can use Arduino UNO or ESP32. do you have any examples related to the book? It will be very helpful to me.
I can even work with stm32F1xxx series if you have any suggestions. Even though Arduino is more accessible to me.
Now, It is only important for me to be able to continue your book with exercise.
Hi @sami1369 I think you are actually rather close to building the reference application either for AVR or for an ARM based core.
Please note that all the book's example projects are actually tested for and developed for an AVR controller, often times using self-made boards in a DIY fashion.
I would like to know how far you got when building the reference application. Where did things stop working?
If you would like to simply install MICROCHIP's ATMEL Studio (available from internet), it can be very straightforward to build the reference application and all the book's examples. Also each target/example is built in the Continuous Integration script.
If you could select one method, I'm pretty sure you are not that far from getting the reference application built and running on a board.
In your opinion, how far did you get and what seems to be failing or breaking down for your build(s)?
Hi Christopher, I want to practice while reading the book and I think that Atmel Studio is suitable so that I can compile the book's examples and upload them on AVR boards like Arduino UNO that use an ATmega328. Could you please let me know if this is your suggestion?
and can I use book libraries in Atmel Studio?
On Tue, 23 Aug 2022 at 10:53, Christopher Kormanyos < @.***> wrote:
Hi @sami1369 https://github.com/sami1369 I think you are actually rather close to building the reference application either for AVR or for an ARM based core.
Please note that all the book's example projects are actually tested for and developed for an AVR controller, often times using self-made boards in a DIY fashion.
I would like to know how far you got when building the reference application. Where did things stop working?
If you would like to simply install MICROCHIP's ATMEL Studio (available from internet), it can be very straightforward to build the reference application and all the book's examples. Also each target/example is built in the Continuous Integration script.
If you could select one method, I'm pretty sure you are not that far from getting the reference application built and running on a board.
In your opinion, how far did you get and what seems to be failing or breaking down for your build(s)?
— Reply to this email directly, view it on GitHub https://github.com/ckormanyos/real-time-cpp/issues/270#issuecomment-1223604609, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHJCHM2MIGFMVRXUIWCORH3V2RU6DANCNFSM53V7SZMQ . You are receiving this because you were mentioned.Message ID: @.***>
... please let me know if this is your suggestion?
and can I use book libraries in Atmel Studio?
Yes @sami1369. This is my suggestion based on our discussion up to this point. This is a very simple and good way to use the book's examples on the Windows platform.
Both the reference application as well as each example project (from the book's chapters) have project workspaces for MICROCHIP's ATMEL Studio.
So if you install ATMEL Studio, you can open any of the *.atsln files and build the corresponding project.
For example, if you would like to build the reference application (ref_app), you will find ref_app.atsln located here.
Each example has its corresponding *.atsln file located within its example root folder.
Hi @sami1369, a bit more added informatioon in this post...
If you decide to use ATMEL Studio, you should not need any other libraries for these projects other than those that are installed during the standard installation of ATMEL Studio.
The first couple of projects can use the ARDUINO board directly. Later chapters in the book need additional components. Chapter4's examples, for instance, uses additional LEDs that need to be provided. I decided to make a custom board, as shown here. Other examples use even more customization.
Hi Christopher,
I use this link to run book examples by the link attached. https://www.instructables.com/How-to-Load-Programs-to-an-Arduino-UNO-From-Atmel-/
Thank you
On Wed, 24 Aug 2022 at 10:47, Christopher Kormanyos < @.***> wrote:
If you decide to use ATMEL Studio, you should not need any other libraries for these projects other than those that are installed during the standard installation of ATMEL Studio.
The first couple of projects can use the ARDUINO board directly. Later chapters in the book need additional components. Chapter4's examples, for instance, uses additional LEDs that need to be provided.
— Reply to this email directly, view it on GitHub https://github.com/ckormanyos/real-time-cpp/issues/270#issuecomment-1225248287, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHJCHMZMZWLJHLCYZUQT4OTV2W467ANCNFSM53V7SZMQ . You are receiving this because you were mentioned.Message ID: @.***>
I use this link to run book examples by the link attached.
Thank you for providing this informative link.
Does this mean that you can now use ATMEL Studio to build and successfully flash some of the examples into your ARDUINO device?
Or do you need more assistance?
Yes, it works.
I tested some examples
On Wed, Aug 31, 2022, 5:09 PM Christopher Kormanyos < @.***> wrote:
I use this link to run book examples by the link attached.
Thank you for providing this informative link.
Does this mean that you can now use ATMEL Studio to build and successfully flash some of the examples into your ARDUINO device?
— Reply to this email directly, view it on GitHub https://github.com/ckormanyos/real-time-cpp/issues/270#issuecomment-1232884457, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHJCHM7YGBRQ6C5FUT7FLH3V35HANANCNFSM53V7SZMQ . You are receiving this because you were mentioned.Message ID: @.***>