A DIY, IMU-based skateboard activity tracker. The idea is to come up with algorithms to track activity during skateboarding sessions.
A companion mobile app could be used to get useful insights into the session.
The current revision is D
. It uses:
- STM32WB55 (hal) as a Cortex-M4F + Bluetooth (BLE) microcontroller
- BNO08x (driver) as an all-in-one IMU with an accelerometer, gyroscope and magnetometer together with a built-in sensor fusion algorithm
- AXP173 (driver) as a Li-Po battery charging, power-path and gas gauge controller
- Type-C USB Port for charging & optional USB data/DFU
- SOICbite programming port suitable for fast and convenient programming & debugging of the device firmware with a standard SOIC-8 clip
A link to Upverter Design rev. D for schematic and PCB layout.
Firmware is written in Rust, currently it's very minimal and can't do much. It can be found in firmware directory.
It's built with RTIC, embassy
and uses probe-run
for board flashing and debugging via RTT logging.
Here are some stuff that should be done or improved, in no particular order.
- Validate and fix IMU axes and quaternion data
- Use interrupts for communication with PMIC and IMU
- Poll IMU via interrupt
- Use interrupt for PMIC status updates (charging, button, etc.)
-
async/.await
for interrupts
- Use async I/O for I2C comm with PMIC & IMU
-
async
DMA I2C
-
- Bluetooth features
- Integrate BLE support from stm32wb55 crate
-
async/.await
BLE - BLE
- Stream quaternions via GATT service with one characteristic
- Stream accelerometer and gyroscope data
- Battery level service
- Fix race condition against PMIC (access PMIC exclusively from one task?)
- Fix being locked on BLE mutex if there's no motion data events (IMU disabled)
- Device Info Service
- Cleanup
static mut
andunsafe
code- Use async mutex for resources shared between tasks
- PMIC
- Implement battery gas gauge via built-in coulomb counters
- Flash RGB LED instead of simple on/off
- Simple flash
- Red light on HardFault
- PWM effects
- Optimize power consumption and use low-power modes
- Fix debugging/RTT in sleep mode
- LPTIM-based delays instead of dumb loops
- Enter Low-Power mode in async executor loop
- Detect when device is IDLE and scale down the IMU frequency
- Asynchronously wait for the PMIC to appear on I2C bus on the very first start (battery just plugged)
- Async I2C retry
- Wait for
PWROK
interrupt
- Non-Volatile Logging
- Persist panic messages
- Persist
defmt
logs (powered bydefmt-persist
) - A simple way to download and read logs & postmortems (done with
probe-rs
+defmt-print
)