SolidSense AIOT — MCU firmware
Software Flashing and Usage
The AIOT carries an STM32U031C8 microcontroller alongside the i.MX8 SOM. It runs as an I2C slave at address 0x18 and gives the SOM access to the peripherals that are wired to the MCU rather than to the SOM directly.
The SOM issues commands; the MCU executes them and returns a response.
What it does
LED — turn on, turn off, read state
IR presence sensor (STHS34PF80) — presence and motion detection with a configurable threshold, reported through an interrupt line
Accelerometer (ISM330DHCX) — wake-up on motion with a configurable threshold
GNSS (u-blox MIA-M10) — reachable only from the MCU. The firmware passes the receiver's NMEA stream through to the SOM unchanged, so gpsd can consume it directly
Battery charger (BQ25638) — power source, charge state, and an estimated state of charge
Real-time clock — kept from GNSS by the MCU itself, with no involvement from the SOM. Runs from a 32.768 kHz crystal and survives an MCU reset
Interrupts — a single read reports pending MCU, IR and accelerometer events
Firmware and protocol reference
Source, protocol reference and build instructions:
The README in that repository is the authoritative description of the I2C interface — every command, its exact request and response length, the meaning of the status byte, the sensor threshold ranges, the GNSS passthrough, and the current known limitations. It is maintained alongside the firmware, so it always matches the code.
Deliberately not duplicated here: command bytes and payload formats. Read them from the README for the firmware revision you are actually running.
Flashing
The MCU is programmed over SWD through the AIOT's debug header (J5006). Two probes are documented below — an STLINK-V3 driven from the STM32CubeProgrammer GUI, and a SEGGER J-Link driven from the command line. Either one is sufficient; pick whichever you have. Both need a firmware image first.
Getting the firmware image
Build it from source — clone the repository above, import the project into STM32CubeIDE, and build. The .hex is produced in the build output directory.
Programming with STLINK-V3
equipment
USB-C Cable
1

STLINK-V3
1

Micro USB-B Cable
1

ST-LINK V3 SWD/JTAG programming cable (10/20-pin adapter set)
1

The flashing process requires a local computer with the following software installed:
STM32CubeProgrammer:
Preparing the AIOT for flashing

Connect STLINK-V3 (CN5) to the computer via micro USB. Connect the AIOT (J5006) to the STLINK (STDC14) using the ST-LINK V3 SWD/JTAG programming cable. Ensure that the cable is connected to the AIOT in the correct orientation, as shown in the image.

Connect the AIOT to the computer using a USB cable.
Turn ON the AIOT using the designated switch.
Programming
Open STM32CubeProgrammer:

Select Erasing & Programming from the left menu. (1)
Find the appropriate Port and connect. (2)
Load the appropriate HEX file. (3)
Verify the selections according to the image. (4)
Click Start Programming. (5)
After the successful completion message is displayed, you can proceed to the testing process.
Programming with J-Link
equipment
USB-C Cable (optional — see below)
1
SEGGER J-Link (standard ARM 20-pin JTAG connector)
1
USB-B Cable
1
ARM 20-pin to 10-pin JTAG adapter and cable
1
The flashing process requires a local computer with the following software installed:
J-Link Software and Documentation Pack — this provides the JLinkExe command-line tool (JLink.exe on Windows):
Preparing the AIOT for flashing
Connect the J-Link to the computer via USB.
Connect the AIOT (J5006) to the J-Link using the ARM 20-pin to 10-pin JTAG adapter and cable — J5006 is a standard ARM 10-pin debug header, so this is the same adapter set used with the STLINK-V3 above. Ensure that the cable is connected to the AIOT in the correct orientation, as shown in the image.

The J-Link supplies power to the MCU through the debug connector, so the AIOT does not have to be powered over USB-C to be flashed — the probe alone is enough.
Connect the AIOT to the computer using a USB cable and turn it ON using the designated switch only if you also want the rest of the board running, for example to run the quick check over I2C once the firmware is programmed.
Programming
Start J-Link Commander and enter the commands below, substituting the path to your .hex file:
The same commands can be placed in a plain text file (without the J-Link> prompts) and run non-interactively:
A successful run reports Verifying flash ... Done followed by Bank 0 @ 0x08000000: 1 range affected, after which you can proceed to the testing process.
Two messages look like errors but are not:
Bank 0 @ 0x08000000: Skipped. Contents already match— the device already holds this image, so erase, program and verify were skipped. Add theerasecommand shown above to force a rewrite.Communication timed out: ...printed afterqc— emitted while the USB session is being closed, once flashing has already completed. Judge success by the exit status, not by this line.
Quick check from Linux
The MCU should appear at 0x18:
Turn the LED on — a write-only command, and the easiest thing to confirm visually:
Read the charger status — a 3-byte payload, so the response is 5 bytes:
Read exactly 2 + DATA_LEN bytes. The MCU arms each response with an exact length and has nothing to send past it. Asking for more bytes than the response contains leaves the MCU holding SCL low, and the bus stays stuck for roughly ten seconds until the firmware's recovery timer releases it. The per-command lengths are in the README.
Last updated