Getting TG0WDT_SYS_RESET in latest code.
Posted: Thu Sep 14, 2017 5:55 pm
Hi,
I'm getting the following error continuously in the latest esp32 arduino master.
rst:0x7 (TG0WDT_SYS_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO
I've attached the full serial output. The code works if I use and older version: commit hash 856823ef195ef5c28516395356e8a30f8af8e917. I've not tried doing a git bisect to see which patch introduced this. Why is this happening?
The code is approximately following:
I'm getting the following error continuously in the latest esp32 arduino master.
rst:0x7 (TG0WDT_SYS_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO
I've attached the full serial output. The code works if I use and older version: commit hash 856823ef195ef5c28516395356e8a30f8af8e917. I've not tried doing a git bisect to see which patch introduced this. Why is this happening?
The code is approximately following:
Code: Select all
static volatile unsigned long data[1000] = {0};
static volatile uint32_t coreid[1000] = {0};
static volatile long idx = 0;
static volatile long last;
void __zx_isr() {
unsigned long ccount;
__asm__ __volatile__ ( "rsr %0, ccount" : "=a" (ccount) );
if (idx == 1000) {
return;
}
data[idx] = ccount;
coreid[idx] = xPortGetCoreID();
++idx;
}
void test_zerocrossing() {
uint32_t pin = 35;
pinMode(pin, INPUT);
// Setup an interrupt routine.
attachInterrupt(pin, __zx_isr, CHANGE);
Serial.println("Attaching interrupt ...");
while (idx != 1000) {
delay(1000);
}
Serial.println("Reached counter dumping data");
Serial.printf("Cpu freq: %d\n", CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ);
for (int i = 2; i < 1000; ++i) {
Serial.printf("Core: %d, Last: %d, Cur: %d, Diff: %d\n", coreid[i], data[i - 1], data[i], data[i] - data[i - 1]);
}
}
extern "C" void app_main() {
initArduino();
// This code will go away in non test mode.
Serial.begin(115200);
pinMode(2, OUTPUT);
Serial.println("Start test ...");
test_zerocrossing();
Serial.println("Finished test ...");
}