Part Number: AM263P4-Q1
The Hook functions described below seem to be already used within the SDK, but regarding vApplicationStackOverflowHook(), please explain how to replace it with a custom function and use it in the application.
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Part Number: AM263P4-Q1
The Hook functions described below seem to be already used within the SDK, but regarding vApplicationStackOverflowHook(), please explain how to replace it with a custom function and use it in the application.
Hi Imaoka,
Im the following file: mcu_plus_sdk\source\kernel\freertos\portable\TI_ARM_CLANG\ARM_CR5F\port.c, you can implement your own custom function implementation inside vApplicationStackOverflowHook().
Based on your requirement, you can configure FreeRTOS to check for stack overflow at multiple stages (for e.g. at every task switch, or every
Read more here: https://www.freertos.org/Documentation/02-Kernel/02-Kernel-features/09-Memory-management/02-Stack-usage-and-stack-overflow-checking
To control this, set the configCHECK_FOR_STACK_OVERFLOW to an appropriate value.
To use it in application, you will have to re-build the FreeRTOS library. You can run the below command to build the lib. Run these commands from the top level mcu_plus_sdk directory,
gmake -sj -f makefile.am261x freertos_r5f.ti-arm-clang
gmake -sj -f makefile.am261x freertos_r5f.ti-arm-clang PROFILE=debug
Now re-build your application to link the newly build lib. Based on the value of configCHECK_FOR_STACK_OVERFLOW configured, the application will check the stack overflow and use your custom function.
Regards,
Shaunak