Increase MAX_PACKET_SIZE from 128 to 300 for BNO085 SPI #1

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

Originally created by @halfsohappy on 3/25/2026

Summary

  • BNO085 can return packets up to 270 bytes during sensor hub initialisation
  • MAX_PACKET_SIZE 128 sized shtpData[] at only 128 bytes, so the SPI receive loop wrote up to 270 bytes into it
  • This corrupted the adjacent heap and triggered multi_heap_poisoning asserts on ESP32-S3 at boot (CORRUPT HEAP panic at 0x3fcb1dbc)
  • Increase to 300 (safely above the 270-byte maximum) so the buffer is never overflowed

Test plan

  • Flash ab7 board (ESP32-S3, BNO085 on SPI) and confirm no CORRUPT HEAP panic at boot
  • Verify BNO085 quaternion data flows normally after init

🤖 Generated with Claude Code

*Originally created by @halfsohappy on 3/25/2026* ## Summary - BNO085 can return packets up to 270 bytes during sensor hub initialisation - `MAX_PACKET_SIZE 128` sized `shtpData[]` at only 128 bytes, so the SPI receive loop wrote up to 270 bytes into it - This corrupted the adjacent heap and triggered `multi_heap_poisoning` asserts on ESP32-S3 at boot (`CORRUPT HEAP` panic at `0x3fcb1dbc`) - Increase to 300 (safely above the 270-byte maximum) so the buffer is never overflowed ## Test plan - [ ] Flash ab7 board (ESP32-S3, BNO085 on SPI) and confirm no `CORRUPT HEAP` panic at boot - [ ] Verify BNO085 quaternion data flows normally after init 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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#1