2015-11-27 06:42 PM
Using STM32Cube_FW_F4_V1.9.0 and setup a project with CubeMX 4.11 and using Freertos.
I usually build with -Wundef. When compiling cmsis_os.c, I earn a:
core_cmFunc.h:501:12: warning: ''__CORTEX_M'' is not defined
http://www.openstm32.org/-Wundef
This is, because `#include ''core_cmFunc.h''` obvouisly needs a e.g. `#include …` before so that the preprocessor symbol `__CORTEX_M` became defined. This appears for every source which tries to include cmsis_os.h (e.g. the cubemx generated freertos.c).
2015-01-01 09:40 AM
2015-01-02 07:52 AM
I'd checked the suggestion of thomas.004 ''changing the #include order'', but in my project this approach won't fix the warning because my FreeRTOSConfig.h has no `#include ''stm32...h''`.
I further confirm, that this issue still exist in F4 V1.10.0. Could this please fixed by ST Cube Hal developers in future releases?2015-11-30 01:33 AM
__CORTEX_M
is defined in core_cm4.h
maybe a solution is to swap the following includes in cmsis_os.h
//#include ''core_cmFunc.h''
#include
''FreeRTOS.h''
#include
''core_cmFunc.h''
FreeRTOS.h includes
FreeRTOSConfig.h << stm32f4xx_hal_conf.h << stm32f4xx_hal_XXX.h
<< stm32f4xx_hal_def.h << stm32f4xx.h << stm32f4??xx
<< core_cm4.h
2015-12-13 10:57 AM
Could this checked / confirmed / fixed by ST please?
2016-01-18 01:13 AM
For me, I had to add the following include in cmsis_os.h:
#include ''stm32f4xx.h''
before
#include ''core_cmFunc.h''
How ever it gets overwritten on every re-generation from ST32CubeMX.
To solve this temporarily, you can edit the template used by STM32CubeMX in
cmsis_os.h in
<PATH TO YOUR STM32CUBEMX-REPOSITORY>\STM32Cube_FW_F4_V1.0\Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS\