Bug? Endless reboot cycle in exampe sketch

Most stuff is working but one of the examples from the IDE’s File–>Examples fails to even load and run on my ESP32 WROOM “Devkit V1”

I think this is the first ESP32, certainly not an S3

The example sketch is “Position/angle motion control example” It runs on other processors (Arduino UNO, RP2040) and other examples do run on my ESP32.

After loading, I look at “Serial Monitor” and see this following cycling endlessly.

rst:0x8 (TG1WDT_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, clock div:2
load:0x3fff0030,len:1344
load:0x40078000,len:13808
load:0x40080400,len:3608
entry 0x400805f0
ets Jun 8 2016 00:22:57

rst:0x8 (TG1WDT_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, clock div:2
load:0x3fff0030,len:1344
load:0x40078000,len:13808
load:0x40080400,len:3608
entry 0x400805f0
ets Jun 8 2016 00:22:57

rst:0x8 (TG1WDT_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, clock div:2

Hmmm… hard to say of course what’s wrong from this. I assume there is a bug in the sketch with relation to the new library or framework versions.

Could you enable debugging to see if SimpleFOC prints anything before crashing out?

I’ll do that. But I already tried placing "Sirial.begin();Serial.print(“setup starts”) as the first line in Setup{} .

I have the same problem, trying to run the standard SimpleFOC/Stepper/L298N example on a Wemos D1 R32. The code works perfectly on a STM32 Nucleo64 board and barely on an Arduino Uno (because the Uno is too slow, as we know).

Don’t know how to fix it, but the watchdog timer reset happens in driver.init(). General ESP32 advice on this kind of reset suggests that the SimpleFOC library tries to set up interrupts in a way that isn’t allowed.

Thanks,

C.

Hey @Christoph_Koch,

Could you share the code/link to the code?
Also could you please show the output of the program in the serial terminal?
It would help a lot with debugging.

Thanks, Antun

Hey, I’ve seen this before when using SimpleFOC and FreeRTOS. A solution can be to replace the delays in the motor init with calls to vTaskDelay…

I found the problem. I was actually using a GPIO pin I was not allowed to use. Now that I am using GPIO pins according to the board’s pinout diagram, the problem is solved. Apologies for taking your time, Antun.

1 Like

Hmmm sorry, I misread your post, and thought it was timing out in the motor.initFOC().

Which ESP32 are you using?

Are you certain the pins you’re trying to use aren’t ones reserved for flash memory?

Runger, our posts crossed. Yes, I was using reserved pins. The board is the WEMOS D1 R32 with MCU ESP32-WROOM XX5R69. Thanks for your help! The problem is resolved.

1 Like