[ICM45*] Fix processing bad samples and stack overflow panics #101

Closed
opened 2026-04-05 17:51:50 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @jabberrock on 4/18/2025

  1. At startup, we were receiving invalid samples from the IMU and passing it to VQF. This causes huge initial rotations and accelerations that takes time for VQF to eliminate.

    Fix is to check the header to see if the data is present. Also had to add a check for invalid gyro samples even though it is present.

  2. During play, the tracker would rarely go haywire and jump into a random position. I suspect this is caused by a stack overflow, which causes the tracker to panic. Combined with problem (1), whenever the tracker restarts, it would send huge rotations and accelerations to the server. This causes the jump.

    Fix is to make the read_buffer static, so that it's reserved on the BSS segment instead of the stack. I noticed this because I was getting panics when I tried to increase the size of the read buffer, or declared some new stack variables.

After implementing these two fixes, rotation and acceleration are stable at startup, and I am able to make modifications to the icm45base code without randomly encountering panics.

*Originally created by @jabberrock on 4/18/2025* 1. At startup, we were receiving invalid samples from the IMU and passing it to VQF. This causes huge initial rotations and accelerations that takes time for VQF to eliminate. Fix is to check the header to see if the data is present. Also had to add a check for invalid gyro samples even though it is present. 2. During play, the tracker would rarely go haywire and jump into a random position. I suspect this is caused by a stack overflow, which causes the tracker to panic. Combined with problem (1), whenever the tracker restarts, it would send huge rotations and accelerations to the server. This causes the jump. Fix is to make the read_buffer static, so that it's reserved on the BSS segment instead of the stack. I noticed this because I was getting panics when I tried to increase the size of the read buffer, or declared some new stack variables. After implementing these two fixes, rotation and acceleration are stable at startup, and I am able to make modifications to the icm45base code without randomly encountering panics.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/SlimeVR-Tracker-ESP#101