Add option to automatically set a watchpoint at the end of the swapped-in task

This commit is contained in:
Jeroen Domburg
2017-01-09 16:42:45 +08:00
parent 633cd49f88
commit ca57a86f20
4 changed files with 81 additions and 0 deletions

View File

@@ -78,6 +78,7 @@ task.h is included from an application file. */
#include "rom/ets_sys.h"
#include "esp_newlib.h"
#include "esp_panic.h"
/* FreeRTOS includes. */
#include "FreeRTOS.h"
@@ -2809,6 +2810,12 @@ void vTaskSwitchContext( void )
traceTASK_SWITCHED_IN();
#if CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK
//Set watchpoint 1 to watch the last 32 bytes of the stack.
esp_set_watchpoint(1, pxCurrentTCB[xPortGetCoreID()]->pxStack, 32, ESP_WATCHPOINT_STORE);
#endif
}
portEXIT_CRITICAL_NESTED(irqstate);
}