xSTATIC_QUEUE had a different meaninf during compilation

Trying to compile FreeRTOS+TCP with IAR EWARM. I get an error
Error[Pe1066]: declaration of struct “xSTATICQUEUE” had a different meaning during compilation of “..MiddlewaresThirdPartyFreeRTOS-PlusSourceFreeRTOS-Plus-TCPportableBufferManagementBufferAllocation2.c” C:UsersStephensKaDocumentsCombined PulsedFirmwarelocaltrunkMiddlewaresThirdPartyFreeRTOSSourceincludeFreeRTOS.h 1046″ struct “xSTATICQUEUE” (declared at line 1046) (from translation unit “..trunkSrcmain.c”) struct “xSTATICQUEUE” (declared at line 1046) (from translation unit “..trunkMiddlewaresThirdPartyFreeRTOS-PlusSourceFreeRTOS-Plus-TCPportableBufferManagementBufferAllocation_2.c”) detected during compilation of secondary translation unit “..trunkSrcmain.c”
However when I search the code for xSTATIC_QUEUE I only find 1 instance of it. Is there any way to fix this error/

xSTATIC_QUEUE had a different meaninf during compilation

xSTATICQUEUE is defined in a header file, so it might be something to do with the order in which header files are being included. BufferAllocation2.c is one of our files, so hopefully the header files are correct. Could you please post the part of your main.c file that includes the header files.

xSTATIC_QUEUE had a different meaninf during compilation

The definition of xSTATIC_QUEUE depends on four defines from FreeRTOSConfig.h. You can test how the preprocessor sees them by issuing temporary warnings from FreeRTOS.h: ~~~

if( configSUPPORTSTATICALLOCATION != 0 )

#warning STATIC_ALLOCATION yes

else

#warning STATIC_ALLOCATION no

endif

if( configSUPPORTDYNAMICALLOCATION != 0 )

#warning DYNAMIC_ALLOCATION yes

else

#warning DYNAMIC_ALLOCATION no

endif

if( configUSEQUEUESETS != 0 )

#warning QUEUE_SETS yes

else

#warning QUEUE_SETS no

endif

if( configUSETRACEFACILITY != 0 )

#warning TRACE_FACILITY yes

else

#warning TRACE_FACILITY no

endif

~~~ You should see the same pattern of yes/no for every module compiled, especially main.c and BufferAllocation_2.c. Make also sure that there is only a single copy of FreeRTOSConfig.h within the entire project.

xSTATIC_QUEUE had a different meaninf during compilation

I can only see one copy of FreeRTOSConfig.h Tracefacility comes up as no for everything except freertos.c, main.c and stm32f4xxit.c

xSTATIC_QUEUE had a different meaninf during compilation

~~~ //main.c

include “main.h”

include “stm32f4xx_hal.h”

include “cmsis_os.h”

~~~ I haven’t added any of my own files, I generated code with STM32CubeMX and then added the FreeRTOS+TCP files to the project – should I be including the FreeRTOS files in main.c?

xSTATIC_QUEUE had a different meaninf during compilation

I found a second FreeRTOSConfig.h in my files that wasn’t included in the project and removed it but thats created linker errors with BufferAllocation_2.c

xSTATIC_QUEUE had a different meaninf during compilation

Trace_facility comes up as no for everything except .. main.c
So when main.c is seeing include/FreeRTOS.h the structure xSTATIC_QUEUE is smaller than it is for other source files. ~~~ typedef struct xSTATICQUEUE { … #if ( configUSETRACEFACILITY == 1 ) UBaseTypet uxDummy8; uint8_t ucDummy9; #endif }; ~~~ And it looks like the compiler is warning about this. Now you should check why main.c and stm32f4xx_it.c do not see that configUSE_TRACE_FACILITY is not defined.