mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-31 19:24:33 +02:00
Merge branch 'bugfix/freertos_halt_on_startup' into 'master'
freertos: Remove "stop program on scheduler start when JTAG/OCD is detected" option See merge request !1354
This commit is contained in:
@@ -91,7 +91,7 @@ config FREERTOS_WATCHPOINT_END_OF_STACK
|
||||
This check only triggers if the stack overflow writes within 4 bytes of 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 OCD is attached, esp-idf
|
||||
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.
|
||||
|
||||
config FREERTOS_INTERRUPT_BACKTRACE
|
||||
@@ -146,14 +146,6 @@ config FREERTOS_ASSERT_DISABLE
|
||||
|
||||
endchoice
|
||||
|
||||
config FREERTOS_BREAK_ON_SCHEDULER_START_JTAG
|
||||
bool "Stop program on scheduler start when JTAG/OCD is detected"
|
||||
depends on ESP32_DEBUG_OCDAWARE
|
||||
default n
|
||||
help
|
||||
If JTAG/OCD is connected, stop execution when the scheduler is started and the first
|
||||
task is executed.
|
||||
|
||||
config FREERTOS_IDLE_TASK_STACKSIZE
|
||||
int "Idle Task stack size"
|
||||
range 768 32768
|
||||
|
@@ -126,9 +126,6 @@ typedef unsigned portBASE_TYPE UBaseType_t;
|
||||
#include "sdkconfig.h"
|
||||
#include "esp_attr.h"
|
||||
|
||||
#define portFIRST_TASK_HOOK CONFIG_FREERTOS_BREAK_ON_SCHEDULER_START_JTAG
|
||||
|
||||
|
||||
typedef struct {
|
||||
uint32_t owner;
|
||||
uint32_t count;
|
||||
|
@@ -361,12 +361,6 @@ void vPortCPUReleaseMutex(portMUX_TYPE *mux) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if CONFIG_FREERTOS_BREAK_ON_SCHEDULER_START_JTAG
|
||||
void vPortFirstTaskHook(TaskFunction_t function) {
|
||||
esp_set_breakpoint_if_jtag(function);
|
||||
}
|
||||
#endif
|
||||
|
||||
void vPortSetStackWatchpoint( void* pxStackStart ) {
|
||||
//Set watchpoint 1 to watch the last 32 bytes of the stack.
|
||||
//Unfortunately, the Xtensa watchpoints can't set a watchpoint on a random [base - base+n] region because
|
||||
|
@@ -242,7 +242,7 @@ Command usage examples:
|
||||
|
||||
esp32 apptrace start file://trace.log 0 2048 -1 1 0
|
||||
|
||||
There is an option to configure target to halt after reset on start of scheduler. To do so, go to menuconfig and enable option *Stop program on scheduler start when JTAG/OCD is detected* under *Component config > FreeRTOS*.
|
||||
To configure tracing immediately after reset use the openocd ``reset halt`` command.
|
||||
|
||||
|
||||
.. _app_trace-logging-to-host:
|
||||
|
@@ -33,8 +33,12 @@ When stepping through the code with ``next`` command, GDB is internally setting
|
||||
Support options for OpenOCD at compile time
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The ESP-IDF code has various support options for OpenOCD set at compile time: it can stop execution when the first thread is started and break the system if a panic or unhandled exception is thrown. First option is disabled and second enabled by default and both can be changed using the esp-idf configuration menu. Please see the :ref:`make menuconfig <get-started-configure>` menu for more details.
|
||||
ESP-IDF has some support options for OpenOCD debugging which can be set at compile time:
|
||||
|
||||
* :ref:`CONFIG_ESP32_DEBUG_OCDAWARE` is enabled by default. If a panic or unhandled exception is thrown and a JTAG debugger is connected (ie openocd is running), ESP-IDF will break into the debugger.
|
||||
* :ref:`CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK` (disabled by default) sets watchpoint index 1 (the second of two) at the end of any task stack. This is the most accurate way to debug task stack overflows. Click the link for more details.
|
||||
|
||||
Please see the :ref:`make menuconfig <get-started-configure>` menu for more details on setting compile-time options.
|
||||
|
||||
.. _jtag-debugging-tip-freertos-support:
|
||||
|
||||
|
Reference in New Issue
Block a user