Chapter 2. API Reference
FreeRTOS can check if a stack has overflown its bounds by checking either the value of the stack pointer
or by checking the integrity of canary bytes. (See FREERTOS_CHECK_STACKOVERFLOW for
more information.) These checks only happen on a context switch, and the situation that caused the stack
overflow may already be long gone by then. This option will use the last debug memory watchpoint to
allow breaking into the debugger (or panic’ing) as soon as any of the last 32 bytes on the stack of a
task are overwritten. The side effect is that using gdb, you effectively have one hardware watchpoint less
because the last one is overwritten as soon as a task switch happens.
Another consequence is that due to alignment requirements of the watchpoint, the usable stack size
decreases by up to 60 bytes. This is because the watchpoint region has to be aligned to its size and the
size for the stack watchpoint in IDF is 32 bytes.
This check only triggers if the stack overflow writes within 32 bytes near the end of the stack, rather
than overshooting further, so it is worth combining this approach with one of the other stack overflow
check methods.
When this watchpoint is hit, gdb will stop with a SIGTRAP message. When no JTAG OCD is attached,
esp-idf will panic on an unhandled debug exception.
Default value:
• No (disabled)
CONFIG_FREERTOS_INTERRUPT_BACKTRACE
Enable backtrace from interrupt to task context
Found in: Component config > FreeRTOS
If this option is enabled, interrupt stack frame will be modified to point to the code of the interrupted
task as its return address. This helps the debugger (or the panic handler) show a backtrace from the
interrupt to the task which was interrupted. This also works for nested interrupts: higer level interrupt
stack can be traced back to the lower level interrupt. This option adds 4 instructions to the interrupt
dispatching code.
Default value:
• Yes (enabled)
CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS
Number of thread local storage pointers
Found in: Component config > FreeRTOS
FreeRTOS has the ability to store per-thread pointers in the task control block. This controls the number
of pointers available.
This value must be at least 1. Index 0 is reserved for use by the pthreads API thread-local-storage. Other
indexes can be used for any desired purpose.
Range:
• from 1 to 256
Default value:
• 1
CONFIG_FREERTOS_ASSERT
FreeRTOS assertions
Found in: Component config > FreeRTOS
Failed FreeRTOS configASSERT() assertions can be configured to behave in different ways.
By default these behave the same as the global project assert settings.
Available options:
Espressif Systems 1148
Submit Document Feedback
Release v4.4