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.

[参考译文] AM263P4-Q1:vApplicationStackOverflowHook ()

Guru**** 2686715 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1590059/am263p4-q1-vapplicationstackoverflowhook

器件型号: AM263P4-Q1

下面介绍的挂钩函数似乎已经在 SDK 中使用vApplicationStackOverflowHook()、但关于、请解释如何用自定义函数替换它并在应用程序中使用它。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    你好、Imaoka、

    Im 以下文件: mcu_plus_sdk\source\kernel\freertos\portable\TI_ARM_CLANG\ARM_CR5F\port.c、您可以在  vApplicationStackOverflowHook () 中实现自己的自定义函数实现。

    根据您的要求、您可以配置 FreeRTOS 以在多个阶段检查堆栈溢出(例如在每个任务切换时或每个阶段检查堆栈溢出)  

    在此处阅读更多信息: https://www.freertos.org/Documentation/02-Kernel/02-Kernel-features/09-Memory-management/02-Stack-usage-and-stack-overflow-checking

    要进行控制、请设置  configCHECK_FOR_STACK_OVERFLOW 驱动至适当的值。

    要在应用中使用它、您必须重新构建 FreeRTOS 库。 您可以运行以下命令来构建库。 可以从顶层 MCU_PLUS_SDK 目录中运行这些命令、  

    gmake -sj -f makefile.am261x freertos_r5f.ti-arm-clang
    gmake -sj -f makefile.am261x freertos_r5f.ti-arm-clang PROFILE=debug

    现在、重新编译应用以链接新构建库。 根据的值  configCHECK_FOR_STACK_OVERFLOW  配置后、应用程序将检查堆栈溢出并使用您的自定义函数。

    此致、
    Shaunak