Skip to content

Utilizing SimpleFOCDebug::enable(&Serial); during CalibratedSensor.calibrate() crashes ESP32-S3 #74

@SabrCat

Description

@SabrCat

Trying to run the calibration routine of a CalibratedSensor while

SimpleFOCDebug::enable(&Serial);

is set will crash a ESP32-S3. If

motor.useMonitoring(Serial);

is used instead, debug printing works as expected with no crashes.
Precise module used is a ESP32-S3-WROOM1-N16R8 mounted on a clone of the ESP32-S3-C1 dev board.

I believe this should be addressed to @MarethyuPrefect

Terminal Output during the occuring Bootloop:

Rebooting...
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x18 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40378d22
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce2820,len:0x116c
load:0x403c8700,len:0xc2c
load:0x403cb700,len:0x3108
entry 0x403c88b8
ESP32-DRV: Configuring 3PWM in group: 0 on timer: 0
ESP32-DRV: Configuring 2 operators.
ESP32-DRV: Configuring 3 comparators.
ESP32-DRV: Configuring 3 generators.
ESP32-DRV: Configuring center-aligned pwm.
ESP32-DRV: Enabling timer: 0
ESP32-DRV: MCPWM configured!
MOT: Init
MOT: Enable driver.
Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.

Core  1 register dump:
PC      : 0x42008d3d  PS      : 0x00060330  A0      : 0x82008d84  A1      : 0x3fcebeb0
A2      : 0x00000000  A3      : 0x3c040cdc  A4      : 0x00000000  A5      : 0x41100000
A6      : 0x00000000  A7      : 0x00000000  A8      : 0x82008d3d  A9      : 0x3fcebea0
A10     : 0x0000001c  A11     : 0x3c040cf8  A12     : 0x000000ff  A13     : 0x0000ff00
A14     : 0x00ff0000  A15     : 0xff000000  SAR     : 0x00000017  EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000000  LBEG    : 0x400556d5  LEND    : 0x400556e5  LCOUNT  : 0xfffffff8


Backtrace: 0x42008d3a:0x3fcebeb0 0x42008d81:0x3fcebed0 0x42007b43:0x3fcebef0 0x42008339:0x3fcebf60 0x4200dfb1:0x3fcebf80 0x4037d045:0x3fcebfa0
  #0  0x42008d3a in Print::write(char const*) at C:/Users/HB Stratos/.platformio/packages/framework-arduinoespressif32/cores/esp32/Print.h:62
  #1  0x42008d81 in Print::print(char const*) at C:/Users/HB Stratos/.platformio/packages/framework-arduinoespressif32/cores/esp32/Print.cpp:95
      (inlined by) Print::println(char const*) at C:/Users/HB Stratos/.platformio/packages/framework-arduinoespressif32/cores/esp32/Print.cpp:180
  #2  0x42007b43 in CalibratedSensor::calibrate(FOCMotor&, int) at .pio/libdeps/openloop_test/SimpleFOCDrivers/src/encoders/calibrated/CalibratedSensor.cpp:103
  #3  0x42008339 in setup() at src/utils/openloop_test.cpp:183
  #4  0x4200dfb1 in loopTask(void*) at C:/Users/HB Stratos/.platformio/packages/framework-arduinoespressif32/cores/esp32/main.cpp:67





ELF file SHA256: 255705994

Rebooting...
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x18 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40378d22
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce2820,len:0x116c
load:0x403c8700,len:0xc2c
load:0x403cb700,len:0x3108
entry 0x403c88b8

code: openloop_test.cpp.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions