Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updateInertialGestures() causes ESP32 crash if the gyrobuffers are empty #3

Open
aburt2 opened this issue Jul 19, 2023 · 6 comments
Open

Comments

@aburt2
Copy link
Contributor

aburt2 commented Jul 19, 2023

I was testing with making a better sensor manager for the T-Stick (one that won't try to read from sensors that haven't responded) and while testing I've noticed that if you haven't set any gyroscope values using setGyroscopeValues and call the updateInertialGestures() method it causes the ESP32 to crash with the following error message.

@edumeneses is it possible to have the function either print out a warning when the gyroBuffers are empty or initialise puara-gestures with zeros in the gyroBuffers

Tested on Tinypico with T-stick firmware (commenting out lines 420 - 426)

Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.

Core  1 register dump:
PC      : 0x400d5d15  PS      : 0x00060830  A0      : 0x800d5f95  A1      : 0x3ffb2130  
A2      : 0x3ffc4d10  A3      : 0x3ffc4d88  A4      : 0x3ffc4d78  A5      : 0x00000000
A6      : 0x00000000  A7      : 0x3ffc4d20  A8      : 0x800d5d15  A9      : 0x3ffb2100
A10     : 0x82797940  A11     : 0x3ffb21a0  A12     : 0x3ffb21b0  A13     : 0x3ffb20b0
A14     : 0x00000001  A15     : 0x3ffb0320  SAR     : 0x0000001c  EXCCAUSE: 0x0000001c
EXCVADDR: 0x82797940  LBEG    : 0x4008c6cd  LEND    : 0x4008c6dd  LCOUNT  : 0xfffffffd  


Backtrace: 0x400d5d12:0x3ffb2130 0x400d5f92:0x3ffb21e0 0x400d3570:0x3ffb2200 0x400f767d:0x3ffb2290

  #0  0x400d5d12:0x3ffb2130 in PuaraGestures::updateJabShake() at .pio/libdeps/tinypico/puara-gestures/puara_gestures.cpp:24
  #1  0x400d5f92:0x3ffb21e0 in PuaraGestures::updateInertialGestures() at .pio/libdeps/tinypico/puara-gestures/puara_gestures.cpp:12
  #2  0x400d3570:0x3ffb2200 in loop() at src/main.cpp:436
  #3  0x400f767d:0x3ffb2290 in loopTask(void*) at C:/Users/user/.platformio/packages/framework-arduinoespressif32/cores/esp32/main.cpp:50
@edumeneses
Copy link
Member

Sure thing! We can talk more about that IRL today, but I plan to revisit the puara-gestures library next week. I plan to initialize the class with default internal variables (0.0 for the sensor data holders and gyroBuffers), and implement a check on updateJabShake() / updateOrientation()

Also, there's some code cleaning to do.

We can push a quick fix today afternoon.

@edumeneses
Copy link
Member

@aburt2 , I believe this is already fixed. Please let me know if not.

I'll leave this open for now.

@aburt2
Copy link
Contributor Author

aburt2 commented Oct 30, 2023

Okay @edumeneses , I'll test this tomorrow

@aburt2
Copy link
Contributor Author

aburt2 commented Oct 31, 2023

@edumeneses it is Still an issue with the latest T-Stick firmware

@edumeneses
Copy link
Member

Thanks for taking the time to check. I'll add it to the lists to review in the code.

I started touching on that earlier this week.

@edumeneses
Copy link
Member

One year later, and we are advancing on the refactoring (in the development branch). I will leave this issue open but it should be fixed upon the next release. This is to be tested and the issued close by then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants