2017-06-25 02:49 PM
I am using STM32CubeMX 4.21.0 for STM32L4. When using FreeRTOS with tickless support, the freertos.c file is generated with functions decleared __weak, but this macro is not defined. I am generating for GCC. I am running on Linux.
__weak void PostSleepProcessing(uint32_t *ulExpectedIdleTime)
{/* place for user code */}I am getting annoyed at having to add
/* USER CODE BEGIN Includes */
&sharpdefine __weak __attribute__((weak))/* USER CODE END Includes */Can you reproduce the problem?
#freertos #stm32cubemx #linux #gcc2017-06-25 06:05 PM
Odd that that is the only one that bothers you [or maybe the first one when compiling?] since the HAL is chock full o' weakly defined functions.
2017-06-25 08:40 PM
Other files include the header that defines the macro. freertos.c does not include the proper header.
2017-06-26 01:45 AM
Hi,
The definition is placed in 'stm32f1xx_hal_def.h' header file. so it would be helpful if you add following line at the top of your freertos.c file:
#include 'stm32l4xx_hal.h'
Bests,
Misagh
2017-06-26 05:45 AM
I know how to work around the problem. This is a cube-generated file and needs to be fixed in the cube.
2018-02-01 01:15 AM
Hi
Riggs.Rob
,I tried to reproduce your issue on top of the latest CubeMX release (cubeMX4.24).
I took a STM32L441CCTx, activated FreeRTOS, generated the code with Makefile under Linux.
FreeRTOS.c does not contain any function with __weak.
And then, I tried to compile the Makefile with make. Some changes need to be done under the Makefile :
After those changes done, you can compile and obtain the binary you need.
I hope it will help you.
BR. Jeanne
2018-04-10 02:04 AM
,
,
I have Cube 4.25 and I generate for a STM32F746G-DISCO using ,STM32Cube_FW_F7_V1.11.0.
Cube is setting defaults for the board.
I still have the issue with __weak not being defined in freertos.c.
Problem was solved by moving ' ♯ include 'stm32f7xx_hal.h' from main.c to main.h.
List of files needed to be removed from C_SOURCES are:
Src/bsp_driver_sd.c \
,
Src/fatfs.c \,
Src/fatfs_platform.c \,
Src/freertos.c \,
Src/main.c \,
Src/sd_diskio.c \,
Src/stm32f7xx_hal_msp.c \,
Src/stm32f7xx_hal_timebase_TIM.c \,
Src/stm32f7xx_it.c \,
Src/usbh_conf.c \,
Src/usb_host.c \,
Src/usbh_platform.c \,
,
Is Cube intended to generate a project that is ready to build and download to target, without functionality of course?