Problem With FreeRTOS V9.0 and Demo CORTEX_M4F_ATSAM4E_Atmel_Studio

redhunt wrote on Monday, April 24, 2017:


I’m developing with Atmel SAM4E-EK (I bought the EK). When I opened the Demo that include FreeRTOS V9.0 of this Evaluation Kit and I compiled and it runs well.

After I modify ethernet Tasks and runs all ok. But when I add any ASF component From ASF Wizard, like UART (STDIO ASF) or TWI in the time to compile always throw me errors. If i remove the ASF component added it compiles ok again. I test all the things and I searched in google anything that it’s help me but I don´t know what to do. Can anyone test this thing and tell me if it’s runs ok??.

Note: At the moment of add or remove any component must be commented line #include <gmac_raw.h> of the file asf.h or remove ASF component “Raw Ethernet MAC”, because the PHY ethernet MAC is include in ASF Ksz8051mnl component.

The error of Atmel Studio are “unknown type name ‘portBASE_TYPE’” and others but i think all errors come from this error. This type is in “portmacro.h” but the include folder and all references is include in project. The most rare thing is when remove the new ASF component all runs well again.

Thanks for you support.

Best Regards.

rtel wrote on Monday, April 24, 2017:

That error can occur if FreeRTOS header files are included in the wrong
order: FreeRTOS.h must always be included before task.h, queue.h, etc.
and FreeRTOSConfig.h and portmacro.h must NEVER be included manually
(they are included in the correct order within FreeRTOS.h).

FreeRTOS is part of the ASF, but your project already has it included,
so make sure you are not accidentally bringing in a second copy of
FreeRTOS when you add the ASF components.

Are any of the ASF components you are bringing in using FreeRTOS too? I
would suggest bringing in the ASF components one at a time until you
find the one that is causing the problem.

redhunt wrote on Monday, April 24, 2017:

Hi again.

Thanks for your quick response. I only add the ASF STDIO and it fails. I revised all includes and i thinks all is OK. I removed this ASF and compiled ok. I test with ASF USART and it fail in the same point. I will try again, and if I found something I post here. Thanks.

Best Regards.

redhunt wrote on Monday, May 01, 2017:

Hi again

I found the issue few days before, but I didn’t have time to publish the issue. I found that in the moment of compile time the error comes from a file called “serial.h” and the ASF component add other file called “serial.h” for use the UART or USART. The file called “serial.h” located in “FreeRTOSv9.0.0\FreeRTOS\Demo\Common\include” is in conflict with the file added for ASF component “serial.h”. If you rename or remove file “serial.h” included in Common include of FreeRTOS the Software compiles and run OK.

How I don’t use this file I can remove it and all runs ok with UART from ASF component.

Is it the file important for other thing?? or Can I remove safely this file??

Best Regards.

rtel wrote on Monday, May 01, 2017:

It can be removed.