Build Error for FreeRTOS demo in CCS 7.3, compiler TI 16.9.6.LTS - sprintf() - MSP430X - Launchpad MSP430FR5969
Hi FreeRTOS experts,
I am running Win7 (64-bit) with CCS 7.3, compiler TI 16.9.6.LTS. For my TI Launchpad MSP430FR5969 I downloaded the CCS/IAR version of the FreeRTOS (v.9.0.0) demo and imported it as described on the project page: http://www.freertos.org/MSP430FR5969_Free_RTOS_Demo.html.
However, when building the project I encounter 5 error messages for task.c related to conversions and modifiers, namely:
2631 Conversion u not allowed in printf_support=minimal mode tasks.c /RTOSDemo/FreeRTOS_Source line 4018, 4114, 4130 C/C++ Problem
2632 Modifiers are not allowed in printf_support=minimal mode tasks.c /RTOSDemo/FreeRTOS_Source line 4114, 4130 C/C++ Problem.
Affected lines in task.c are 4018, 4114, 4130.
I tried to run it with different TI compiler versions: problem still persists. The GCC compiler results in over 100 errors.
I tried also full printf() support with no change.
Any help would be appreciated. Thank you!
P.S.: Changing #define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY 1 (or 0) did not affect the issue since it relates to task.c.
Looks like an incompatibility with the compiler’s standard C library.
You could change the definition of portLU_PRINTF_SPECIFIER_REQUIRED to
see if that helps (it switches the format specifiers as they are non
standard), or include the small printf-stdarg.c file in your build
(there are lots of copies in the FreeRTOS download), or edit the source
code so it works with your printf version, or, if you are not using the
vTaskGetRunTimeStats() function - simply set
configUSE_STATS_FORMATTING_FUNCTIONS to 0 in FreeRTOSConfig.h. The
function in question is just a ‘helper’ function, not part of the
FreeRTOS kernel.
set configUSE_STATS_FORMATTING_FUNCTIONS to 0 in FreeRTOSConfig.h
This step works well for the blinky demo and the code compiles. For the detailed demo it does not since appears to be called vTaskGetRunTimeStats(). For now I can get started without this function.
Nevertheless, I tried to follow your other two routes. I was unable to make them work.
When including printf-stdarg.c in main.c CSS returns errors as printf() is redefined. What is necessary to remove the clash?
Where can I define portLU_PRINTF_SPECIFIER_REQUIRED appropriately? Is it a simple boolean (0,1) or is a function required? I can only find a reference in a if statement of tasks.c. When placed as #define portLU_PRINTF_SPECIFIER_REQUIRED 1 (or 0) in main.c it does not compile when vTaskGetRunTimeStats() is called.
is redefined. What is necessary to remove the clash?
Remove the other definition.
/ Where can I define portLU_PRINTF_SPECIFIER_REQUIRED appropriately?
FreeRTOSConfig.h would probably work.
Is
it a simple boolean (0,1) or is a function required?
Have a look at how it is used in the code, you referenced the line
number in your first post.
I can only find a
reference in a if statement of tasks.c. When placed as #define
portLU_PRINTF_SPECIFIER_REQUIRED 1 (or 0) in main.c
That is because it is a pre-processor macro that must be defined in a
header file that is included in tasks.c. As before per last reply, your
first post highlighted the lines of code that use the macro, so you can
see how it is used.