Open caternuson opened 3 years ago
yeah not surprising, its a complex library
Carter was good enough to play with me on this tonight (as was Dan earlier). Goal was to make a zero-solder Head Mouse using just the QTPy and the BNO055 Stemma QT board. We got it working.
I built a custom .UF2 with HID, BusDevice, and Register Frozen in and lots of features disabled. Here's the relevant part of mpconfigboard.mk:
`CIRCUITPY_ANALOGIO = 0
CIRCUITPY_PULSEIO = 0
CIRCUITPY_PWMIO = 0
CIRCUITPY_MATH = 0
#CIRCUITPY_NEOPIXEL_WRITE = 0
CIRCUITPY_ROTARYIO = 0
CIRCUITPY_RTC = 0
CIRCUITPY_SAMD = 0
CIRCUITPY_USB_MIDI = 0
CIRCUITPY_TOUCHIO = 0
CIRCUITPY_TOUCHIO_USE_NATIVE = 0
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_HID
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Register`
With that in place, we still didn't have enough RAM for the library so Carter pulled out the custom Struct classes that were wrapping the values. The BNO055_I2C class (in this hacked version) worked just like the _UART version and read the registered, formatted them and sent them.
It worked well, but still won't fit in the stock .UF2 as built for the QTPy.
For my (short term demo) purposes, this is a fine hack, and I love that I have a head mouse I can show in my presentation tomorrow (with no soldering!).
However, I do have two thoughts:
I'll continue to work with Carter to see where this ends up - just wanted to add to the issue & say thanks. Bill
fork/branch ref FWIW: https://github.com/caternuson/Adafruit_CircuitPython_BNO055/tree/qtpy_hack
nothing fancy. just reverted to basic i2c xfers instead of using register classes.
You also commented out all those constant declarations (which @dhalbert reminded me take a huge amount of memory for what they are). Perhaps those could move into a separate class like HID does.
Just adding that I ran into this issue as well. Seems like the issue could just as well be "board too small for larger libraries".