Skip to content

4.1.1 | MicroDose Crash Patch

Latest
Compare
Choose a tag to compare
@connornishijima connornishijima released this 22 Mar 01:52

This patch makes some tweaks for memory safety and how FreeRTOS handles the timing of the LED thread to avoid the random lockups that some folks have reported after having their Sensory Bridge on for long periods! It took a while to diagnose this issue since each time I made I change I had to wait it out to see if a lockup occurred.

- Lixie Labs*

USB Update Process

Visit settings.sensorybridge.rocks and plug in your device if you need to check its current firmware version!

If you've already updated to 3.0.0+, you're in for a treat! This is an update that you can do in under a minute if you're really trying. Download the SB_FIRMWARE_410.BIN below, and do the following:

  • Hold down the MODE button on your Sensory Bridge while plugging it into your PC
  • This starts Update Mode, and your LEDs will trail blue
  • Sensory Bridge is now pretending to be a 2MB flash drive on your PC, just drag the .BIN update into it and your device will do all the work for you!
  • Once complete, unplug your Sensory Bridge
  • Hold down BOTH the MODE and NOISE buttons while plugging the unit back in
  • This step is necessary to clear incompatible configs from the last firmware version
  • After you see the green LED flash at least once, let go of both buttons to finish booting up!

If you haven't gotten firmware >= 3.0.0 on your device yet, you'll have to compile from source this time. It's a bit of extra work, but well-worth the effort and you'll never need to do it again. Keep reading to learn how...


Compiling From Source

You only need to follow this section if you're on a pre-3.0.0 firmware or want to play with the source code as a developer!

To update your Sensory Bridge firmware to 3.0.0 and above from an earlier version, download the "Source code (zip)" at the bottom of this page, extract it, and open the "SENSORY_BRIDGE_FIRMWARE.ino" in Arduino IDE.

If you don't yet have ESP32-S2 in your Arduino Board Definitions, follow the steps on this page:
https://learn.adafruit.com/adafruit-metro-esp32-s2/arduino-ide-setup-2

Install FastLED Dependency

If you don't have it installed in your copy of Arduino yet, you'll need it for Sensory Bridge to compile.

  • Go to Sketch > Include Library > Manage Libraries
  • In the window that appears, search for "FastLED" (by Daniel Garcia)
  • Install the latest version

Install FixedPoints Dependency (New in 4.0.0+)

Same instructions as the FastLED section above, but with the "FixedPoints" library by Pharap!

Board Settings

Finally, make sure that all of your board settings match this image:

FIRMWARE SETTINGS

Your Serial port (i.e. "COM13") will likely differ from mine.

IMPORTANT PLEASE READ

FOR THIS FIRMWARE TO WORK, you need to make sure the following settings are set in Arduino:

Erase All Flash Before Sketch Upload: ENABLED

This will erase your 2.0.0 config.bin and noise_cal.bin files in your Sensory Bridge's storage, because they are incompatible with this version and can cause your device to not boot correctly.

"USB CDC On Boot: Disabled" is quite important, as the 3.0.0+ firmware manages USB itself, differently from the default behavior

Arduino IDE 2.x Fixes

Unfortunately, the new Arduino IDE 2.x has some issues that I'm hoping are fixed in a future update, because they can break this updating process and all of the new features are weighed down by annoying changes from the Legacy IDE. Here's how to fix those:

DISABLE DEFAULT COMPILATION WARNING BEHAVIOR

(This will make the firmware actually usable)

  • In the Arduino 2.x IDE, click "File > Preferences"
  • Set "Compiler Warnings" to "Default"
  • This is because some external dependencies in the code such as FastLED trigger ignorable warnings like unused variables
  • Arduino IDE 2.x treats all warnings as errors by default, breaking thousands of legacy libraries. (WTF)

DISABLE WORD WRAPPING

(This will guarantee code and docs are more readable, it's 2023, 80-column monitors aren't a thing. No IDE needs word wrapping enabled by default, that's dumb.)

  • In the Arduino 2.x IDE, hit F1
  • In the textbox that appears, type "wrap"
  • You'll see a result for "View - Toggle Word Wrap"
  • Click this item
  • Repeat at least once until buggy word-wrapping is actually disabled

Upload

Hit either Ctrl+U or Cmd+U (depending on your OS), and the code will slowly compile and upload to Sensory Bridge. However, you still have one more step after this:

...Re-upload

Unless you know how to modify your ESP32-S2 compilation flags to use -O3 instead of -Os (it's in the ESP32 core's platform.txt), you'll need to jump up to the "USB Update Process" section above and follow that short guide to upload again, this time from the pre-compiled binary. (You're able to do that now because only firmware >= 3.0 supports USB Update Mode)

The version I distribute myself has been compiled with the -O3 flag, leading to a slightly larger, but hugely faster firmware, and the speed difference is quite noticeable. Once that's done, you'll never have to go through this longer version of the process again! Enjoy your updated Sensory Bridge!