stm32f103 using cpp11 and freertos by cubemx in keil
I’m using stm32f103c8t6 ,the editor is keil mdk.i must using c++11,so i change the misc controls to –cpp11 from c99 in keil . Then i add the freertos by STM32CubeMX, the freertos version is V9.0. F1 version is 1.6.0
when i complie it push error:
../Middlewares/ThirdParty/FreeRTOS/Source/portable/MemMang/heap4.c(235): error: #513: a value of type “void *” cannot be assigned to an entity of type “BlockLink_t *”
../Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.c(317): error: #513: a value of type “void *” cannot be assigned to an entity of type “BlockLink_t *”
../Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.c(392): error: #513: a value of type “void *” cannot be assigned to an entity of type “A_BLOCK_LINK *”
../Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.c(400): error: #513: a value of type “void *” cannot be assigned to an entity of type “BlockLink_t *”
../Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.c(406): error: #513: a value of type “void *” cannot be assigned to an entity of type “BlockLink_t *”
../Middlewares/Third_Party/FreeRTOS/Source/tasks.c(2806): error: #513: a value of type “void *” cannot be assigned to an entity of type “TCB_t *”
../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.c(934): error: #513: a value of type “void *” cannot be assigned to an entity of type “osPoolId”
../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.c(943): error: #513: a value of type “void *” cannot be assigned to an entity of type “std::uint8_t *”
../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.c(1223): error: #513: a value of type “void *” cannot be assigned to an entity of type “os_mailQ_cb *”
The I force the type,until the editor can’t push the error messige like this:.
before :pxNewBlockLink = ( void * ) ( ( ( uint8t * ) pxBlock ) + xWantedSize );
change:pxNewBlockLink = ( void * ) ( ( ( ***BlockLinkt*** * ) pxBlock ) + xWantedSize );
But i find a prolem when mcu running .it stop in PendSv
PendSVHandler PROC
EXPORT PendSVHandler [WEAK]
B .
ENDP
it means the editor does not recognized the Macro definition in FreertosConfig.h.
#define vPortSVCHandler SVCHandler
stm32f103 using cpp11 and freertos by cubemx in keil
The FreeRTOS code in the SVN repository (not official release yet) has
replaced all void* handles with type safe handles (this could not be
done when it was first attempted due to bugs in GCC, but that seems to
be resolved now). That change may make C++ happier. However I would
recommend building the .c files as C, and only .cpp files as C++. Is
that an option in the compiler?
stm32f103 using cpp11 and freertos by cubemx in keil
thanks I will try to find this option.
i have a question ,why the same source code of freertos ,the stm32f4 can complie without no error in cpp11? Is that the different of CORTEX-M4 and CORTEX-M3?
stm32f103 using cpp11 and freertos by cubemx in keil
I think you are stating that an older version delivered by the cube
software compiles fine, but the latest version from the FreeRTOS
download does not. If so, I don’t know the answer, but as some of your
errors were in heap4.c and I don’t think that file has changed in a
long time, I suggest you do a diff between the working and not working
heap4.c files and report back with your findings so we can see what the
issue might be.