Skip to main content
Visitor II
September 13, 2017
Solved

STM32CubeMX FreeRTOS and __weak

  • September 13, 2017
  • 2 replies
  • 1911 views
Posted on September 13, 2017 at 14:49

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 #freertos
    This topic has been closed for replies.
    Best answer by Jeanne Joly
    Posted on February 01, 2018 at 10:17

    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

    2 replies

    Technical Moderator
    September 13, 2017
    Posted on September 13, 2017 at 17:41

    Hi,

    Which tools version are you using ?

    Kind Regards

    Imen

    Visitor II
    September 14, 2017
    Posted on September 14, 2017 at 09:58

    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=false
    Visitor II
    February 1, 2018
    Posted on February 01, 2018 at 10:17

    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

    Visitor II
    February 1, 2018
    Posted on February 01, 2018 at 10:49

    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.