Intermittent issues with i2c interface and interrupt line on microbit v2.21
- Dominant language
- C
- Stars
- 2.8k
- Forks
- 1.1k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 1
Description
### Configuration
Operating System: MacOS 14.3.1 (although also seen on windows and linux)
Device: Microbit v2.21 (nrf52833)
Device DETAILS.TXT
```
# DAPLink Firmware - see https://daplink.io
Build ID: v0258-beta3-g0004198b (gcc)
Unique ID: 9906360200052820ed5513866061c627000000006e052820
HIC ID: 6e052820
Auto Reset: 1
Automation allowed: 0
Overflow detection: 0
Incompatible image detection: 1
Page erasing: 0
Daplink Mode: Interface
Interface Version: 0258
Bootloader Version: 0257
Git SHA: 0004198b3ad9b0938a1039e28405b759fea78c11
Local Mods: 0
USB Interfaces: MSD, CDC, HID, WebUSB
Bootloader CRC: 0x725bea7d
Interface CRC: 0x38953278
Remount count: 0
URL: https://microbit.org/device/?id=9906&v=0258
```
### Steps to reproduce
1. Flash a user program on the microbit v2 that utilizes the combined interrupt over i2c (p0_25) for dataready on the lsm303agr (accelerometer)
3. Run said program from the host connected over USB
4. Disconnect the device from the USB and then plug it back in
### Results
Intermittently getting unending busy being returned (0x39)
Intermittently I am getting addressnack back from the i2c interface with the user program unable to get interrupts
Upon disconnecting and reconnecting I consistently run into the above issue
### Expected results
Expected the interrupt line to be released so interrupts from the lsm303agr are able to occur
Expected microbit to be able to run user software even when unplugging and plugging it back in
### Additional Notes
Adding a sleep and a dummy read on the i2c interface has seemed to help a decent bit, but it does not help with the unplugging and plugging back in scenario.
Rust program I have been using for testing these scenarios
https://github.com/relia1/state_machine
Contributor guide
Research direction
Start by reproducing the issue with the linked Rust test program and the micro:bit v2.21, focusing on the I2C interface, combined interrupt on p0_25, and LSM303AGR. Verify behavior across USB disconnect and reconnect, then confirm that busy/address-NACK errors no longer prevent the interrupt line and user software from operating.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, rust
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100