IMU & Motion
STMicroelectronics LIS2MDL in the datasheet corpus
3-axis ±50 gauss digital magnetometer with hard-iron offset registers and temperature sensor.
VendorSTMicroelectronicsIMU & Motion
InterfaceI2C / SPII2C 0x1E (fixed); 3-wire SPI
Record StatusCatalog profileDatasheet / behavioral twin
Driver oracle & capability record
Tracked on micro:bit v2 Zephyr builds in the CircuitTwin confidence registry and indexed in the datasheet corpus.
| Driver reference | Zephyr lis2mdl / ST lis2mdl-pid |
|---|---|
| Evidence standing | provisional (register and bus behavior derived from vendor datasheet or driver oracle; not yet hardware-unit verified on two physical samples). |
| Published record | Generate or inspect locally via ct twin generate (see /docs/twin-generation). |
Key registers & reset values
| Address / Field | Register | Reset / Expected | Purpose |
|---|---|---|---|
0x4F | WHO_AM_I | 0x40 | Fixed ST LIS2MDL chip ID |
0x60 | CFG_REG_A | 0x03 (Idle) | Temp comp, ODR (10..100 Hz) and mode bits |
0x62 | CFG_REG_C | 0x00 | Block data update (BDU) and DRDY interrupt routing |
0x68-0x6D | OUTX_L..OUTZ_H | 16-bit LE | Magnetic axis output words (1.5 mG/LSB) |
Attach with ct CLI
Shell - run firmware with LIS2MDL
# Run compiled firmware with LIS2MDL attached on microbit-v2
ct run --json --board microbit-v2 --device lis2mdl build/app.elf
# Run fault-injection suite and emit JUnit XML
ct test run --json --junit results/lis2mdl.xml tests/lis2mdl-fault.suite.yamlFault-injection test snippet (suite.yaml)
tests/lis2mdl-fault.suite.yaml
version: 1
board: microbit-v2
firmware: build/app.elf
tests:
- name: lis2mdl-i2c-nack-recovery
faults:
- at_ms: 30
bus: I2C1
kind: nack
address: 0x1E
count: 2
- at_ms: 140
part: lis2mdl
kind: register_override
register: 0x4F
value: 0xFF
expect:
console_contains: "DRIVER_FAULT_HANDLED"
exit_code: 0