欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

STM32 + stmcubemx + freertos 低功耗异常问题

程序员文章站 2022-07-02 11:01:53
...

STM32 + stmcubemx + freertos 低功耗异常问题

最近开发一款产品出现以下问题, stmL151低功耗芯片,进入低功耗退出后一段时间出现系统异常,进入vListInsert->
for( pxIterator = ( ListItem_t * ) &( pxList->xListEnd ); pxIterator->pxNext->xItemValue <= xValueOfInsertion; pxIterator = pxIterator->pxNext ) /*lint !e826 !e740 The mini list structure is used as the list end to save RAM.  This is checked and valid. */

现象:到此死循环。

系统提示信息

  1. Stack overflow -
    see http://www.freertos.org/Stacks-and-stack-overflow-checking.html
    2) Incorrect interrupt priority assignment, especially on Cortex-M
    parts where numerically high priority values denote low actual
    interrupt priorities, which can seem counter intuitive. See
    http://www.freertos.org/RTOS-Cortex-M3-M4.html and the definition
    of configMAX_SYSCALL_INTERRUPT_PRIORITY on
    http://www.freertos.org/a00110.html
    3) Calling an API function from within a critical section or when
    the scheduler is suspended, or calling an API function that does
    not end in “FromISR” from an interrupt.
    4) Using a queue or semaphore before it has been initialised or
    before the scheduler has been started (are interrupts firing
    before vTaskStartScheduler() has been called?).

经过很长一段时间的问题定位,排除栈溢出等问题,最后解决, 问题根因:
SystemClock_Config();
SystemClock_Config->HAL_RCC_ClockConfig->HAL_InitTick->HAL_NVIC_SetPriority
uint32_t uwTickPrio = (1UL << __NVIC_PRIO_BITS); /* Invalid priority */
系统配置时钟接口配置时钟的分频系数的同时复位了systick定时器的优先级,从而导致了系统调度出现异常。
总结:
1、当发现所有的怀疑都排除后,问题依旧没有找到根因时,可以考虑了排查下你所依据的是否真正无问题。