Closed alextsam closed 4 years ago
Does any code after the attachInterupt
execute?
Yes, this issue came up in a larger application that had a bunch of other things happening after the attachInterrupt() and everything else is fine (the code in the ISR as well). I made the sketch posted above to help with replicating the issue. You can just copy-paste it and swap the lines to make it work as I mention in the original post.
Thanks a lot, this helped me a lot, i had the same issue and couldn't find any error in my code. When i made an empty test sketch, all my code worked, but in my main sketch BLE never showed up, everything else works great. After moving my BLE-Init before the first interrupt, everything works.
+1 it does not like blePeriph.begin();
at all.
Fixed via @nobodyguy's PR https://github.com/sandeepmistry/arduino-nRF5/pull/422.
Hi,
I was not sure whether to post this here or to the NRF5 Arduino Core repo, but I decided to do it here as this is the part that gets impacted. The issue is that the stack doesn't seem to work when there is a gpio interrupt attached before the beacon begin(). When I say "doesn't seem to work" I mean that there are no advertisements (tested with eddystone URL). To make things weirder, everything is fine if the attachInterrupt() is moved after the beacon begin(). Example sketch:
So, with this sketch, nothing seems to come out of the beacon. If you just move the attachInterrupt() line to be under eddystoneBeacon.begin() then everything is fine. Different kinds of interrupt (eg FALLING) didn't make any difference.
While trying to find what the issue is, I found that just enabling the interrupts (NVIC_EnableIRQ(GPIOTE_IRQn)) before eddystoneBeacon.begin() is what "breaks" it.
Even though, as I said, I have a workaround for my application, I would love to get this fixed properly for everyone. Any ideas? Thanks.
Alex