diff --git a/README.md b/README.md index 525020d..55b78da 100644 --- a/README.md +++ b/README.md @@ -178,8 +178,8 @@ An external display can be optionally connected. For details and wiring instruct | NodeMCU V2 (aka v1.0) | ESP8266 | yes | yes | yes | no | nodemcuv2 | | Raspberry Pi Pico | RP2040 | yes | yes | yes | no | pico | | Arduino Pro Mini (ATmega328 8mHz) | ATmega328 | yes | yes | no | no | pro8mhzatmega328 | +| SAMD21 M0-Mini | SAMD21 | yes | yes | no | no | samd21_m0_mini | | Teensy LC | MKL26Z64VFT4 | yes | yes | yes | no | teensylc | -| Arduino Zero (USB) | SAMD21 | yes | yes | yes | no | zerousb | _\*7_: These boards have onboard USB but by default do not support firmware upload over USB or serial over USB. For upload use a STLink programmer or USB to serial adapter. diff --git a/platformio.ini b/platformio.ini index 8584f66..8c01008 100644 --- a/platformio.ini +++ b/platformio.ini @@ -63,8 +63,8 @@ default_envs = ; nodemcuv2 ; NodeMCU V2 ; pico ; Raspberry Pi Pico ; pro8mhzatmega328 ; Arduino Pro Mini 3.3V 8Mhz + ; samd21_m0_mini ; SAMD21 M0-Mini ; teensylc ; Teensy LC - ; zerousb ; Arduino Zero (USB) ; ------------------------------------------------------------------------------ @@ -755,6 +755,27 @@ build_flags = ; -D USE_LED ; NOT SUPPORTED ; -D USE_DISPLAY ; Requires external I2C OLED display + +[env:samd21_m0_mini] +; SAMD21 M0-Mini (SAMD21) +; The SPI pins are available on the ICSP connector pins on top of the PCB +; No display +platform = atmelsam +board = zeroUSB +framework = arduino +monitor_speed = ${common.monitor_speed} +lib_deps = + ${common.lib_deps} + ${mcci_lmic.lib_deps} +build_flags = + ${common.build_flags} + ${mcci_lmic.build_flags} + -D BSFILE=\"boards/bsf_samd21_m0_mini.h\" + -D MONITOR_SPEED=${common.monitor_speed} + -D USE_SERIAL + ; -D USE_LED ; NOT SUPPORTED + ; -D USE_DISPLAY ; Requires external I2C OLED display + [env:teensylc] ; Teensy LC (NXP MKL26Z64VFT4) @@ -776,25 +797,4 @@ build_flags = ; -D USE_DISPLAY ; Requires external I2C OLED display -[env:zerousb] -; Arduino Zero USB (SAMD21) -; The SPI pins are available on the ICSP connector pins on top of the PCB -; No display -platform = atmelsam -board = zeroUSB -framework = arduino -monitor_speed = ${common.monitor_speed} -lib_deps = - ${common.lib_deps} - ${mcci_lmic.lib_deps} -build_flags = - ${common.build_flags} - ${mcci_lmic.build_flags} - -D BSFILE=\"boards/bsf_zerousb.h\" - -D MONITOR_SPEED=${common.monitor_speed} - -D USE_SERIAL - -D USE_LED - ; -D USE_DISPLAY ; Requires external I2C OLED display - - ; end of file \ No newline at end of file diff --git a/src/boards/bsf_zerousb.h b/src/boards/bsf_samd21_m0_mini.h similarity index 85% rename from src/boards/bsf_zerousb.h rename to src/boards/bsf_samd21_m0_mini.h index 4a6e7cf..e21f225 100644 --- a/src/boards/bsf_zerousb.h +++ b/src/boards/bsf_samd21_m0_mini.h @@ -1,9 +1,9 @@ /******************************************************************************* * - * File: bsf_zerousb.h + * File: bsf_samd21_m0_mini.h * - * Function: Board Support File for Arduino Zero (USB Native port) - * and SAMD21 M0-Mini, with external SPI LoRa module. + * Function: Board Support File for SAMD21 M0-Mini + * with external SPI LoRa module. * * Copyright: Copyright (c) 2021 Leonel Lopes Parente * @@ -14,6 +14,10 @@ * Description: This board has onboard USB (provided by the MCU). * It supports automatic firmware upload and serial over USB. * No onboard display. Optionally an external display con be connected. + * + * On some boards a user LED is present while on + * others it PA17 / 13 which is shared which is also used for SPI SCK. + * Therefore onboard LED is not supported by LMIC-node. * * The SPI pins are located on the top side of the PCB as part of * the ICSP connector. It is strange that this board has an ICSP @@ -30,7 +34,7 @@ * * Leds GPIO * ---- ---- - * LED <――――――――――> PA17 / 13 (LED_BUILTIN, PIN_LED, PIN_LED_13) + * LED - (LED_BUILTIN, PIN_LED, PIN_LED_13) * LED2 <――――――――――> PB03 / 25 (RX, PIN_LED2, PIN_LED_RXL) * LED3 <――――――――――> PA27 / 26 (TX, PIN_LED3, PIN_LED_TXL) * @@ -53,7 +57,7 @@ * Docs: https://docs.platformio.org/en/latest/boards/atmelsam/zeroUSB.html * * Identifiers: LMIC-node - * board: zerousb + * board: samd21_m0_mini * PlatformIO * board: zeroUSB * platform: atmelsam @@ -65,12 +69,12 @@ #pragma once -#ifndef BSF_ZEROUSB_H_ -#define BSF_ZEROUSB_H_ +#ifndef BSF_SAMD21_M0_MINI_ +#define BSF_SAMD21_M0_MINI_ #include "LMIC-node.h" -#define DEVICEID_DEFAULT "zero-usb" // Default deviceid value +#define DEVICEID_DEFAULT "samd21-m0-mini" // Default deviceid value // Wait for Serial // Can be useful for boards with MCU with integrated USB support. @@ -100,8 +104,9 @@ const lmic_pinmap lmic_pins = { #endif #ifdef USE_LED - EasyLed led(LED_BUILTIN, EasyLed::ActiveLevel::High); -#endif + #error Invalid option: USE_LED. Onboard LED is not supported. + // EasyLed led(, EasyLed::ActiveLevel::Low); +Endif #ifdef USE_DISPLAY // Create U8x8 instance for SSD1306 OLED display (no reset) using hardware I2C. @@ -134,4 +139,4 @@ bool boardInit(InitType initType) } -#endif // BSF_ZEROUSB_H_ \ No newline at end of file +#endif // BSF_SAMD21_M0_MINI_ \ No newline at end of file