2020-12-01 01:40 PM
Hello @ALABB , @Khouloud ZEMMELI
I am requesting an enhancement in file FreeRTOSConfig.h. I observe STM32CubeMX adds the file to any STM32H7 project that uses FreeRTOS version 10.2.1 (with CMSIS version 2).
And in the template file:
During code execution, if
configASSERT(0)
gets executed, the code execution will stop, and without a debugger it is impossible to know why code got stuck.
I therefore request to please update the ST provided Header file, and add a weak function to the statement, which can later be coded by the user.
Is it possible to change the below line of code:
#defineconfigASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); }
to:
#define configASSERT( x ) if ((x) == 0) {taskDISABLE_INTERRUPTS(); rvUserAssertInformFunction(__FILE__, __LINE__); for( ;; );}
and add:
__weak void rvUserAssertInformFunction(char * pF, unsigned long ln)
{
pF = pF;
ln = ln;
}
Please share your views.
I have already reported my concern to the STM32CubeH7 community, bit it seems they are not the ones who need to make change to the code.
https://github.com/STMicroelectronics/STM32CubeH7/issues/96
Please help.
Thanks,
Rajeev
Solved! Go to Solution.
2020-12-18 02:05 AM
Hi @Rajeev Arora ,
After discussed with team, as the user section was made for allowing such flexibility, so you need to add or change it by hand.
As a workaround you can change the USER SECTION as follows :
/* USER CODE BEGIN 1 */
#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__)
extern void rvUserAssertInformFunction(char * pF, unsigned long ln);
#endif
#define configASSERT( x ) if ((x) == 0) {taskDISABLE_INTERRUPTS(); rvUserAssertInformFunction(__FILE__, __LINE__); for( ;; );}
/* USER CODE END 1 */
And define the function rvUserAssertInformFunction elsewhere is his application:
- In a USER SECTION of main.c / freertos.c / elsewhere
When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.
Thanks, Khouloud
2020-12-02 12:55 AM
Hi @Rajeev Arora
Your proposal will be discussed internally with the team, I will keep you informed of any decision regarding your request.
Thanks for your feedback, Khouloud
2020-12-18 02:05 AM
Hi @Rajeev Arora ,
After discussed with team, as the user section was made for allowing such flexibility, so you need to add or change it by hand.
As a workaround you can change the USER SECTION as follows :
/* USER CODE BEGIN 1 */
#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__)
extern void rvUserAssertInformFunction(char * pF, unsigned long ln);
#endif
#define configASSERT( x ) if ((x) == 0) {taskDISABLE_INTERRUPTS(); rvUserAssertInformFunction(__FILE__, __LINE__); for( ;; );}
/* USER CODE END 1 */
And define the function rvUserAssertInformFunction elsewhere is his application:
- In a USER SECTION of main.c / freertos.c / elsewhere
When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.
Thanks, Khouloud