mcci-catena / arduino-lmic

LoraWAN-MAC-in-C library, adapted to run under the Arduino environment
https://forum.mcci.io/c/device-software/arduino-lmic/
MIT License
633 stars 209 forks source link

Library does not recognize the Adafruit Feather M0 board correctly. #317

Closed chipmc closed 5 years ago

chipmc commented 5 years ago

On compile and when running the compliance script, I get the following message: "board not known to library; add pinmap or update getconfig_thisboard.cpp".

If I change the board to the MCI Catena 4410, the compliance script compiles and runs without this error.

paulalting commented 5 years ago

A quick and maybe dirty fix I did is as follows, which allows you to then define the board in the user config file named 'lmic_project_config.h' which resides in folder 'project_config'

In file 'src/arduino_lmic_hal_boards.h' add #include at line 22 after initial #include. #include "lmic/lmic_config_preconditions.h"

Terry, does the standard Arduino IDE define this board name by default or does it need to be set by user as the Eclipse IDE does not make such a definition as ARDUINO_SAMD_FEATHER_M0 ?

terrillmoore commented 5 years ago

Try the feather m0 express as your target. I just checked boards.txt from the latest Adafruit BSP and they define as follows:

Feather M0 -D ARDUINO_SAMD_ZERO -D ADAFRUIT_FEATHER_M0

Feather M0 Express -D ARDUINO_SAMD_ZERO -D ARDUINO_SAMD_FEATHER_M0 ....

Evidently I was looking at the wrong line in the BSP, or I used the Feather M0 Express, or something. I'll update our #ifdefs to accommodate. Or you can patch the #ifdef to look for ADAFRUIT_FEATHER_M0.

chipmc commented 5 years ago

Selecting the Adafruit M0 Feather Express fixes the issue with board not being recognized. Thank you.

terrillmoore commented 5 years ago

Good. I'll fix this in the next day or two. And maybe add a CI test.

paulalting commented 5 years ago

Yes, same here, if I select the Feather M0 Express in the project properties in Eclipse IDE and remove the dirty fix I had above, all compiles nicely now.

terrillmoore commented 5 years ago

Turns out this is an LMIC bug, not a LoRaWAN bug. Moved accordingly.