I am using STM32CubeMX to config FreeRTOS. I couldn't find where to define configASSERT(). Can anyone help with this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-08-25 6:26 PM
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-08-26 12:40 AM
Hi Crane,
when you generate a project with STM32CubeMX that uses FreeRTOS the definition of the configASSERT() macro is placed in between "USER_CODE" comments in the generated Inc/FreeRTOSConfig.h file:
/* USER CODE BEGIN 1 */
#define configASSERT( x ) if ((x) == 0) {taskDISABLE_INTERRUPTS(); for( ;; );}
/* USER CODE END 1 */
That is a strong hint that this definition is not managed by STM32CubeMX but may and can be changed by the user.
So simply change the definition later in the generated file. It will not be overwritten on later re-generations since it is protected by the "USER_CODE_..." comments.
Regards
Thomas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-08-26 12:40 AM
Hi Crane,
when you generate a project with STM32CubeMX that uses FreeRTOS the definition of the configASSERT() macro is placed in between "USER_CODE" comments in the generated Inc/FreeRTOSConfig.h file:
/* USER CODE BEGIN 1 */
#define configASSERT( x ) if ((x) == 0) {taskDISABLE_INTERRUPTS(); for( ;; );}
/* USER CODE END 1 */
That is a strong hint that this definition is not managed by STM32CubeMX but may and can be changed by the user.
So simply change the definition later in the generated file. It will not be overwritten on later re-generations since it is protected by the "USER_CODE_..." comments.
Regards
Thomas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-08-26 9:09 PM
Got it. Thanks a lot Tthan!
