From ca7485cc9a55f3c269d22426e923962ee7f2fb93 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Thu, 5 Oct 2017 16:57:59 +1100 Subject: [PATCH] freertos: Remove "stop program on scheduler start when JTAG/OCD is detected" option No longer used with new dual core target & JTAG instructions. --- components/freertos/Kconfig | 10 +--------- components/freertos/include/freertos/portmacro.h | 3 --- components/freertos/port.c | 6 ------ docs/api-guides/app_trace.rst | 2 +- docs/api-guides/jtag-debugging/tips-and-quirks.rst | 6 +++++- 5 files changed, 7 insertions(+), 20 deletions(-) diff --git a/components/freertos/Kconfig b/components/freertos/Kconfig index d6cec2c5cf..21300bdac2 100644 --- a/components/freertos/Kconfig +++ b/components/freertos/Kconfig @@ -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 diff --git a/components/freertos/include/freertos/portmacro.h b/components/freertos/include/freertos/portmacro.h index fbfe9828f9..d4f96eb1d2 100644 --- a/components/freertos/include/freertos/portmacro.h +++ b/components/freertos/include/freertos/portmacro.h @@ -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; diff --git a/components/freertos/port.c b/components/freertos/port.c index 63aa553718..79e42160b4 100644 --- a/components/freertos/port.c +++ b/components/freertos/port.c @@ -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 diff --git a/docs/api-guides/app_trace.rst b/docs/api-guides/app_trace.rst index 8ef36d73f1..ba80c16f96 100644 --- a/docs/api-guides/app_trace.rst +++ b/docs/api-guides/app_trace.rst @@ -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: diff --git a/docs/api-guides/jtag-debugging/tips-and-quirks.rst b/docs/api-guides/jtag-debugging/tips-and-quirks.rst index 5a7101d043..bc81dbd6f5 100644 --- a/docs/api-guides/jtag-debugging/tips-and-quirks.rst +++ b/docs/api-guides/jtag-debugging/tips-and-quirks.rst @@ -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 ` 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 ` menu for more details on setting compile-time options. .. _jtag-debugging-tip-freertos-support: -- 2.40.0