core icon indicating copy to clipboard operation
core copied to clipboard

crash on jogging esp32, THC

Open rombor73 opened this issue 5 months ago • 5 comments

Hello, having always same issue, esp-idf v4.3.0(2), 4.4.0, 4.4.8, PIO or pure espidf, tried to activate float in ISR, nothing helps, backtrace always pointing to the same: 0x4008316d: stepper_driver_interrupt_handler at ~grbl/stepper.c:523 0x400819e5: stepper_driver_isr at ~ESP32/main/driver.c:3869 0x40084fdd: _xt_medint3 at ~.platformio\packages\[email protected]\components\freertos\port\xtensa/xtensa_vectors.S:1274 0x4000bfed: ?? ??:0 0x4008cdda: vPortExitCritical at ~.platformio\packages\[email protected]\components\freertos\port\xtensa/port.c:473 0x400fca42: esp_intr_alloc_intrstatus at ~.platformio\packages\[email protected]\components\esp_system/intr_alloc.c:600 0x400fb12b: timer_isr_register at ~.platformio\packages\[email protected]\components\driver/timer.c:276 (discriminator 2) 0x400d2e92: driver_setup at ~\ESP32/main/driver.c:3171 0x400d5316: grbl_enter at ~\ESP32/main/grbl/grbllib.c:344 0x400d249f: vGrblTask at ~\ESP32/main/main.c:52 0x4008cb6d: vPortTaskWrapper at ~.platformio\packages\[email protected]\components\freertos\port\xtensa/port.c:168 issue is coming from thc.c, without it all ok, see voltage without problems, strange thing-behavior is not always same, if jog slowly sometimes no crash, what could be an issue? Thanks

rombor73 avatar Jul 23 '25 01:07 rombor73

The ESP32 crashes when encountering floats in ISRs - code has to be changed to integer (or fixed point) math to avoid that. The offending code is in stepperPulseStart() only?

terjeio avatar Jul 23 '25 04:07 terjeio

yes, it is in stepperPulseStart(), it seems like something is overflowing, will try later to change code to fixed point, will update, Thanks

rombor73 avatar Jul 23 '25 05:07 rombor73

tried to rewrite with integer and fixed point, tried to isolate steperPulseStart as critical task, no luck so far, it resets randomly, most time without backtrace, wdt reseting, what can I try else? Thanks

rombor73 avatar Jul 24 '25 15:07 rombor73

Try with commenting out this line - still crashing?

terjeio avatar Jul 27 '25 05:07 terjeio

you are great, thank you very much, it is not crashing anymore, seems like all ok, spent tremendous amount of time on this cruppy ide and chip actually, will public soon THC with ina219 as adc, after field test

rombor73 avatar Jul 30 '25 01:07 rombor73