FreeRTOS on Windows with Eclipse
A quick how-to on setting up and running the FreeRTOS Windows Simulator with Eclipse IDE.
There’s a FreeRTOS port for almost every embedded device these days. I’ve use it on so many boards: The TI CC3220, Particle Electron, STM Nucleo, ESP and the Avnet MINIZED. But I’ve found that developing directly on the boards can get a little tedious. I want to be faster at producing application code and tests and I want to make porting applications to different boards easier. I’m aiming to achieve this using the FreeRTOS Windows simulator. But this story is not about why I’m setting up the FreeRTOS simulator, it’s just a tutorial that will hopefully help out someone else in setting up the FreeRTOS simulator for Windows.
Don’t download the .exe
Firstly, download FreeRTOS. I had a little struggle here. The link on the download page navigates directly to sourceforge and automatically begins download of the FreeRTOS .exe but Windows kicked in and stopped the download after finding a virus. I have no idea if it really contains a virus but I proceeded to download FreeRTOS.zip instead and 50mB later FreeRTOS was downloaded.
Choose your cpp IDE
For me this was Eclipse IDE for C/C++ Developers. Start the download.
Compiler Time
Eclipse needs a GCC compiler to build and run and the FreeRTOS demos run as makefiles. For this I chose MinGW.
After downloading and running the installer the MinGW Installation Manager pops up. I chose the Basic Setup and skipped both the ada and fortran compilers.
It was slightly unintuitive. You need to click the grey boxes to select the packages then select the installation menu and hit apply.
After the installation is complete remember to set your Windows environment Path variable to the directory of both MinGW and MSys binary’s. For me these were “C:\MinGW\bin” and “C:\MinGW\msys\1.0\bin”. Easy.
Check the install by opening the CMD prompt and running both mingw and make. You should see both successfully fail.
Away we go
Open Eclipse and choose File -> Open Projects from File System. Navigate to your FreeRTOS install directory and select the WIN32-MingW folder.
The project should open and index correctly as the internal source references the path relative to PROJECT_LOC.
Build and run the project. If MinGW has been installed correctly you’ll see the Binaries appear.
Now all that’s left is to run program. For good measure navigate to main_full.c and place a breakpoint on the delay around line 273. Hit debug and shortly after Eclipse will switch into debug mode.
Hopefully I didn’t miss anything and your setup went smoothly. Happy Programming.