I have been trying to create an atmel project that uses FreeRTOS on an ATmega328 but I cannot seem to get it to work. I have read several article on how to do this, especially this and this one (which is in french but google translate should do the trick). Basically, what I did was to:

  1. Download the FreeRTOS source code
  2. Create a new Atmel Studio (C executable) targeting the atmega328
  3. Add the FreeRTOS source code to the project (respecting the folder structure as suggested in the tutorials)
  4. Then compile it. However, I get this error "FreeRTOS.h: No such file or directory" I have made sure to add all the source file in my compiler's directories (again as suggested by the tutorials) but I always get the same nasty error. Heck, I have even downloaded the attached templates (from the tutorial sites) but I get the same compile error. Does anyone knows how to solve this? PS-
  5. I am using Atmel studio 6.2 sp2 on windows 8. My compile is the default avr gcc.
  6. My directory list looks like thisenter image description here
  7. My defined symbols looks like as follows enter image description here
  8. The completed Atmel Studio 6.2 solution is shared to google drive if someone would like to take a look at it Google drive link of the complete solution
  • \$\begingroup\$ Are you sure that you have bothe header files : FreeRTOSConfig.h and FreeRTOS.h in the headers directory that you added ? \$\endgroup\$ Sep 9, 2015 at 21:10
  • \$\begingroup\$ Yes! I have all files in place. Nothing is missing \$\endgroup\$ Sep 9, 2015 at 23:16

2 Answers 2


This usually happens if you omit this step from the instructions:

And in Directories you will need to include all directories containing .h files in your project(I only managed to get working only with absolute paths). Add GCC_MEGA_AVR in Defined Symbols to tell core that we are going to use GCC for AVR microcontroller.

If you think you did that, show us a screenshot of your Directories Settings.

  • \$\begingroup\$ I have made the requested changes. I added all directories and added the GCC_MEGA_AVR in Defined Symbols. Yet no changes. Here is the final Atmel Studio Solution File drive.google.com/file/d/0B2M1Y-8quLmkSk5CZTh4UkNyOWc/… \$\endgroup\$ Sep 10, 2015 at 6:17
  • \$\begingroup\$ So, now you have "normal" errors. The first is that F_CPU is not defined. Define it with your clock frequency (you may just replace F_CPU with your actual clock frequency). The second error is that a few functions are defined multiple times - This is because you have imported both ATMega323 and ATMega328 includes (port.h, portmacro.h). Remove the ATMega323 files. The third error you made was that you included three different versions of heap_x.c. Remove _2 and _3 files, just leave heap_1 existent. From then on, your project compiles fine. \$\endgroup\$
    – Tom L.
    Sep 10, 2015 at 7:42
  • \$\begingroup\$ I would guess that it compiles. That doesn't mean it works ;-) \$\endgroup\$
    – Tom L.
    Sep 10, 2015 at 8:33
  • \$\begingroup\$ Well! At least I can start testing if it works. I will update my question if it doesn't. But either way, thanks a lot! \$\endgroup\$ Sep 10, 2015 at 8:35

I think I remember having a similar issue in the past...

If you're sure you have everything setup properly, try this: Right-click on the *.h files needed in the project explorer inside the IDE and select properties. You get a little properties window that has a "Build Action" section that is probably set to "none". Click on the drop-down box to change it to "compile". Then rebuild the project.

Hope that solves your problem!

~I'm going to leave this here because it could be useful to someone

  • \$\begingroup\$ Yes. They are all marked as with a 'compile' option \$\endgroup\$ Sep 9, 2015 at 23:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.