2017-09-13 05:49 AM
When enabling the FreeRTOS idle hook STM32CubeMX generates a function with the following prototype in the freertos.c file:
__weak void vApplicationIdleHook( void )
However __weak isn't defined in any one of the included header files (I'm using GCC with Makefile target) so the file can't be compiled until defining the __weak as __attribute__((weak)) somewhere.
#idle-hook #freertosSolved! Go to Solution.
2018-02-01 01:17 AM
Hi
sweden
,
There is a post where I have just answered for the same topic. Please refer to it (
https://community.st.com/0D50X00009XkfyISAR
) and tell me if you still have issues.BR. Jeanne
2017-09-13 08:41 AM
Hi,
Which tools version are you using ?
Kind Regards
Imen
2017-09-14 02:58 AM
STM32CubeMX v4.1 on Linux, STM32CubeL0 v1.0, STM32L IOC file is attached.
________________ Attachments : freertos-test.ioc.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyRl&d=%2Fa%2F0X0000000b7i%2Ftr_9r_LmjEqa8bXEfgQvMx82hTOzf8zPbiZ.QjfT.qg&asPdf=false2018-02-01 01:17 AM
Hi
sweden
,
There is a post where I have just answered for the same topic. Please refer to it (
https://community.st.com/0D50X00009XkfyISAR
) and tell me if you still have issues.BR. Jeanne
2018-02-01 02:49 AM
Thanks,
Joly.Jeanne
, the problem with __weak seems to be gone: after removing all those duplicate filename definitions (a new bug?) from the Makefile I was able to compile the binary.2024-10-29 03:34 PM
Hi I have the same problem with missing __weak for STM32G071 project.
I looked at your link, but I don't have any custom makefile to modify. I use CUBE IDE to generate the build script precisely to avoid having to maintain one :-).
I use only LL API to write my drivers, so I suspect that may be a possible condition for the problem to appear (no HAL drivers).
When searching for __weak definition there is none in the entire project. So it is not missing an include. Looks like a bug in code generator not checking for its use in app_freertos.c
Fortunately the __weak line is in /* USER CODE BEGIN */ block so I can comment entire function and get rid of the error and make sure that the function is actually correctly defined somewhere. I would actually prefer a compile warning with an explicit message to define these functions. Using __weak may hide the need to handle it. The comments inside them are good.
I use Cube version 15.1 but I recall it was there in several past versions too.