每当我在 freeRTOS 中编译我的项目时,都会收到以下警告。
/port.c: In function 'vPortStartFirstTask': ../../../../third_party/RTOS/FreeRTOS/Source/portable/port.c:194:1: warning: stack usage computation not supported for this target [enabled by default] } ^
这是函数
void vPortStartFirstTask( void )
{
/* The MSP stack is not reset as, unlike on M3/4 parts, there is no vector
table offset register that can be used to locate the initial stack value.
Not all M0 parts have the application vector table at address 0. */
__asm volatile(
" ldr r2, pxCurrentTCBConst2 \n" /* Obtain location of pxCurrentTCB. */
" ldr r3, [r2] \n"
" ldr r0, [r3] \n" /* The first item in pxCurrentTCB is the task top of stack. */
" add r0, #32 \n" /* Discard everything up to r0. */
" msr psp, r0 \n" /* This is now the new top of stack to use in the task. */
" movs r0, #2 \n" /* Switch to the psp stack. */
" msr CONTROL, r0 \n"
" pop {r0-r5} \n" /* Pop the registers that are saved automatically. */
" mov lr, r5 \n" /* lr is now in r5. */
" cpsie i \n" /* The first task has its context and interrupts can be enabled. */
" pop {pc} \n" /* Finally, pop the PC to jump to the user defined task code. */
" \n"
" .align 2 \n"
"pxCurrentTCBConst2: .word pxCurrentTCB "
);
}
请帮助我消除特定警告,任何人都请告诉我为什么会收到此消息。
最佳答案
你得到这个警告是因为你试图用 GCC's stack usage analysis 编译你的程序已打开,但您的平台不支持它。
要消除它,请在不使用 -fstack-usage
编译器开关的情况下编译您的程序 - 这可能是由您的 makefile 或 IDE 添加的,我不确定您是如何构建项目的。
关于c - 在编译 freeRTOS 期间在函数 vPortStartFirstTask 中收到警告,但程序正在运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32880471/