Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newer Adafruit BSPs cause Arduino LMIC to hang during init #203

Closed
terrillmoore opened this issue Jan 8, 2020 · 3 comments
Closed

Newer Adafruit BSPs cause Arduino LMIC to hang during init #203

terrillmoore opened this issue Jan 8, 2020 · 3 comments

Comments

@terrillmoore
Copy link

I wanted to raise this issue, although I do not have much time in the next few weeks to investigate in depth (including no time to bisect-test).

Recent Adafruit SAMD BSPs are not compatible with the MCCI Catena Arduino-LMIC sample applications -- see mcci-catena/arduino-lmic#521.

Things work well with MCCI's BSP for the Feather M0, which is a fork of the Adafruit BSP from early 2018 -- last Adafruit commit is 69071fd. This still worked well when @brentru added the tutorial scripts in October 2018.

Symptom: os_init() (the first LMIC API) never returns. There is a config table, lmic_pinmap, which is used by os_init() to set up hardware. It seems likely that some LMIC assumption about pre-conditions is no longer valid -- or maybe never was, but didn't cause problems until now.

Posting here for reference. The workaround is to use MCCI's fork of the BSP, which also adds the LoRaWAN region selection parameters to the UI.

@ladyada
Copy link
Member

ladyada commented Jan 8, 2020

git cloning' the bsp into 'hardware' will let you go from commit to commit till you find the one that 'broke' it!

@terrillmoore
Copy link
Author

Alas,,.... the tinyusb subrepo complicates this. As does the changing of bossac versions. It looks very difficult to get all the tools right across the "adafruit"/"arduino"/"tools" boundary -- the known good checkout builds, but only after I remove tinyusb (git submodule breakage); then the IDE hangs while trying to download, probably because of Bossac 1.7.0 bitrot). This looks like a problem that has to be debugged. Maybe someone from the LMIC community will have time to dig into it.

@terrillmoore
Copy link
Author

Turns out that I was in too much of a hurry, and didn't revert to exactly the fork point of our BSP. I assumed that our code didn't have a patch to make it LMIC friendly. It does. The LMIC disables interrupts during initialization and then waits for some time to pass; this is profoundly non-portable. It apparently works fine on AVRs, but not on stock M0 ports. The fix, of course, is "don't do that" in the LMIC. I think I now know enough about the code to fix that properly. Closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants