arduino / arduino/ArduinoCore-mbed

I2C Interaction in ISR with 33 BLE and Nano Connect

Open
#301 3 comments 2 reactions 0 assignees View on GitHub
documentation
Dominant language
C
Stars
411
Forks
225
PR merge metrics
No merged PRs in 30d

Description

Hey,

I have a problem with my 33 BLE and Nano Connect. I work with a MCP23017 (an I2C Shift Register) and I want to read out the values of its ports inside an ISR after an external interrupt. But both the 33 BLE and Nano Connect crash inside the ISR or get stuck in there. If I set a glonbaflag within the ISR and read out the MCP23017 inside the loop or even a loop2 (with Scheduler.h) it works totally fine. Additionally the read-out of the MCP23017 inside an ISR works as expected with no problems on my 33 IoT. So I guessed this should be a Mbed OS problem.

Other functions that trigger the same problem on Mbed OS devices are Serial.print/println and as I saw in other forum post analogRead as well, but I didn't test that one. My guess is that perhaps I2C and Serial functions rely internally on interrupts themselves and therefore for some reason trigger the same ISR I created instead of the one that they meant to call, so the device gets stuck in an infinite loop. I saw in a different git post that this might be related to the problem that multiple interrupts aren't working properly. Like here:

- https://github.com/arduino/ArduinoCore-nRF528x-mbedos/issues/7
- https://github.com/earlephilhower/arduino-pico/issues/25

But this is just a guess.

Cheers,
Daniel

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the MCP23017 read and Serial.print behavior inside an ISR on the Arduino 33 BLE and Nano Connect, then compare it with the 33 IoT behavior described here. Check the related ArduinoCore-nRF528x-mbedos issue and determine whether the result identifies a fixable interrupt interaction or an ISR usage limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
arduino, c
Domain
embedded-iot, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.