diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index 9efea657..c2d34852 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -14,6 +14,7 @@ jobs: variant: - nRF52DK - BluzDK + - BLYST_NANO_DK - RedBearLab_nRF51822:version=1_0 - BBCmicrobit - BBCmicrobitV2 diff --git a/README.md b/README.md index 0595d25f..45b285e4 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,7 @@ Become a sponsor and get your logo on our README on Github with a link to your s * [hackaBLE](https://github.com/electronut/ElectronutLabs-hackaBLE) * [hackaBLE_v2](https://github.com/electronut/ElectronutLabs-hackaBLE) * [DWM1001-DEV](https://www.decawave.com/product/dwm1001-development-board/) + * [BLYST_NANO_DK](https://www.crowdsupply.com/i-syst/blyst-nano) ### nRF51 * [Plain nRF51 MCU](https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF51822) diff --git a/boards.txt b/boards.txt index dbd04419..6e8ebd98 100644 --- a/boards.txt +++ b/boards.txt @@ -390,6 +390,46 @@ STCT_nRF52_minidev.menu.softdevice.s132.upload.maximum_size=409600 STCT_nRF52_minidev.menu.softdevice.s132.build.extra_flags=-DNRF52 -DS132 -DNRF51_S132 STCT_nRF52_minidev.menu.softdevice.s132.build.ldscript=armgcc_s132_nrf52832_xxaa.ld +BLYST_NANO_DK.name=DevKit board for BLYST-NANO (IMM-NRF52832-NANO) + +############################### +BLYST_NANO_DK.vid.0=0x1fc9 +#BLYST_NANO_DK.pid.0=0x80d1 +############################### + +BLYST_NANO_DK.upload.tool=sandeepmistry:openocd +BLYST_NANO_DK.upload.protocol=cmsis-dap +BLYST_NANO_DK.upload.target=nrf52 +BLYST_NANO_DK.upload.maximum_size=524288 +BLYST_NANO_DK.upload.setup_command=transport select swd; +BLYST_NANO_DK.upload.use_1200bps_touch=false +BLYST_NANO_DK.upload.wait_for_upload_port=false +BLYST_NANO_DK.upload.native_usb=false + +BLYST_NANO_DK.bootloader.tool=sandeepmistry:openocd + +BLYST_NANO_DK.build.mcu=cortex-m4 +BLYST_NANO_DK.build.f_cpu=64000000 +BLYST_NANO_DK.build.board=IDK_BLYST_NANO +BLYST_NANO_DK.build.core=nRF5 +BLYST_NANO_DK.build.variant=BLYST_NANO_DK +BLYST_NANO_DK.build.variant_system_lib= +BLYST_NANO_DK.build.extra_flags=-DNRF52 +BLYST_NANO_DK.build.float_flags=-mfloat-abi=hard -mfpu=fpv4-sp-d16 +BLYST_NANO_DK.build.ldscript=nrf52_xxaa.ld + +BLYST_NANO_DK.build.lfclk_flags=-DUSE_LFXO + +BLYST_NANO_DK.menu.softdevice.none=None +BLYST_NANO_DK.menu.softdevice.none.softdevice=none +BLYST_NANO_DK.menu.softdevice.none.softdeviceversion= + +BLYST_NANO_DK.menu.softdevice.s132=S132 +BLYST_NANO_DK.menu.softdevice.s132.softdevice=s132 +BLYST_NANO_DK.menu.softdevice.s132.softdeviceversion=2.0.1 +BLYST_NANO_DK.menu.softdevice.s132.upload.maximum_size=409600 +BLYST_NANO_DK.menu.softdevice.s132.build.extra_flags=-DNRF52 -DS132 -DNRF51_S132 +BLYST_NANO_DK.menu.softdevice.s132.build.ldscript=armgcc_s132_nrf52832_xxaa.ld # nRF51 variants ################### diff --git a/docs/package_nRF5_boards_index.json b/docs/package_nRF5_boards_index.json index dc400b62..864ac867 100644 --- a/docs/package_nRF5_boards_index.json +++ b/docs/package_nRF5_boards_index.json @@ -310,7 +310,7 @@ }, "url": "https://github.com/sandeepmistry/arduino-nRF5/archive/0.7.0.tar.gz", "archiveFileName": "arduino-nRF52-0.7.0.tar.gz", - "checksum": "MD5:7316605161783e2b944e08fc44c7b6f8", + "checksum": "MD5:004cc94689af048eaa85eacab99c2b5e", "size": "1487463", "boards": [ {"name": "BBC micro:bit"}, @@ -356,16 +356,17 @@ { "name": "Nordic Semiconductor nRF5 Boards", "architecture": "nRF5", - "version": "0.8.0", + "version": "0.11.0", "category": "Contributed", "help": { - "online": "https://github.com/sandeepmistry/arduino-nRF5/issues" + "online": "https://github.com/DINDIN2007/arduino-nRF5/issues" }, - "url": "https://github.com/sandeepmistry/arduino-nRF5/archive/0.8.0.tar.gz", - "archiveFileName": "arduino-nRF52-0.8.0.tar.gz", - "checksum": "MD5:84da4097f5518bcaa0752ff31927504f", - "size": "1488561", + "url": "https://github.com/DINDIN2007/arduino-nRF5/archive/0.11.0.tar.gz", + "archiveFileName": "arduino-nRF52-0.11.0.tar.gz", + "checksum": "MD5:14713e60a793a8cc82b601ae94421daf", + "size": "1490629", "boards": [ + {"name": "BLYST_NANO_DK"}, {"name": "BBC micro:bit"}, {"name": "BBC micro:bit v2"}, {"name": "Bluz DK"}, diff --git a/programmers.txt b/programmers.txt index 9d48bdc9..a924d9d4 100644 --- a/programmers.txt +++ b/programmers.txt @@ -14,9 +14,10 @@ stlink.program.setup_command=transport select hla_swd; set WORKAREASIZE 0x4000; cmsisdap.name=CMSIS-DAP cmsisdap.communication=USB -cmsisdap.protocol=cmsis-dap -cmsisdap.program.protocol=cmsis-dap +cmsisdap.protocol= +cmsisdap.program.protocol= cmsisdap.program.tool=openocd +cmsisdap.program.interface=cmsis-dap cmsisdap.program.setup_command=; blackmagicprobe.name=Black Magic Probe (GDB) diff --git a/variants/BLYST_NANO_DK/pins_arduino.h b/variants/BLYST_NANO_DK/pins_arduino.h new file mode 100644 index 00000000..3ef4d4a9 --- /dev/null +++ b/variants/BLYST_NANO_DK/pins_arduino.h @@ -0,0 +1,17 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +// API compatibility +#include "variant.h" diff --git a/variants/BLYST_NANO_DK/variant.cpp b/variants/BLYST_NANO_DK/variant.cpp new file mode 100644 index 00000000..535f2594 --- /dev/null +++ b/variants/BLYST_NANO_DK/variant.cpp @@ -0,0 +1,74 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + Copyright (c) 2016 Sandeep Mistry All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "variant.h" + +const uint32_t g_ADigitalPinMap[] = { + // ANALOG + 3, // AIN1 + 4, // AIN2 + 5, // AIN3 + 28, // AIN4 + 29, // AIN5 + 31, // AIN7 + + // DIGITAL (D0 - D1) + 2, // S1 //6 + 13, // S2 //7 + + // DIGITAL (D2 - D5) + 30, // LED1 //8 + 28, // LED2_Red //9 + 29, // LED2_Green //10 + 27, // LED2_ Blue /11 + + // DIGITAL (D6 - D9) + 7, // UART TX //12 + 8, // UART RX //13 + 11, // UART CTS //14 + 12, // UART RTS //15 + + // DIGITAL (D10 - D11)) + 9, // NFC1 //16 + 10, // NFC2 //17 + + // DIGITAL (D12 - D13) + 14, // I2C SDA //18 + 15, // I2C SCL //19 + + // DIGITAL (D14 - D19) + 16, // GPIO //20 + 17, // GPIO //21 + 18, // GPIO //22 + 19, // GPIO //23 + 20, // GPIO //24 + 22, // GPIO //25 + + // DIGITAL (D20 - D23) + 23, // SPI CS/SS //26 + 24, // SPI SCK //27 + 25, // SPI MISO //28 + 26, // SPI MOSI //29 + + // DIGITAL (D23) + 27, // GPIO //30 + + // RESET + 21, //31 +}; diff --git a/variants/BLYST_NANO_DK/variant.h b/variants/BLYST_NANO_DK/variant.h new file mode 100644 index 00000000..27e0a48f --- /dev/null +++ b/variants/BLYST_NANO_DK/variant.h @@ -0,0 +1,135 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + Copyright (c) 2016 Sandeep Mistry All right reserved. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _VARIANT_NRF52_DK_ +#define _VARIANT_NRF52_DK_ + +/** Master clock frequency */ +#define VARIANT_MCK (64000000ul) + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "WVariant.h" + +#ifdef __cplusplus +extern "C" +{ +#endif // __cplusplus + +// Number of pins defined in PinDescription array +#define PINS_COUNT (31u) +#define NUM_DIGITAL_PINS (24u) +#define NUM_ANALOG_INPUTS (7u) +#define NUM_ANALOG_OUTPUTS (0u) + +/* + * Analog pins + */ +#define PIN_A0 (0) // AIN1 (P0.03) +#define PIN_A1 (1u) // AIN2 (P0.04) +#define PIN_A2 (2u) // AIN3 (P0.05) +#define PIN_A3 (3u) // AIN4 (P0.28) +#define PIN_A4 (4u) // AIN5 (P0.29) +#define PIN_A5 (5u) // AIN7 (P0.31) + +static const uint8_t A0 = PIN_A0 ; // AIN1 +static const uint8_t A1 = PIN_A1 ; // AIN2 +static const uint8_t A2 = PIN_A2 ; // AIN4 +static const uint8_t A3 = PIN_A3 ; // AIN5 +static const uint8_t A4 = PIN_A4 ; // AIN6 +static const uint8_t A5 = PIN_A5 ; // AIN7 +#define ADC_RESOLUTION 14 + + +// Buttons +#define PIN_BUTTON1 (6u) +#define PIN_BUTTON2 (7u) + +#define PIN_S1 PIN_BUTTON1 +#define PIN_S2 PIN_BUTTON2 + + +// LEDs +#define PIN_LED1 (8u) +#define PIN_LED2 (9u) +#define PIN_LED3 (10u) +#define PIN_LED4 (11u) + +#define LED1 PIN_LED1 +#define LED2_R PIN_LED2 +#define LED2_G PIN_LED3 +#define LED2_B PIN_LED4 + + +/* + * Serial interfaces + */ +// Serial +#define PIN_SERIAL_TX (12u) +#define PIN_SERIAL_RX (13u) +#define PIN_SERIAL_CTS (14u) +#define PIN_SERIAL_RTS (15u) + + +/* + * Two Wire (I2C) Interfaces + */ +#define WIRE_INTERFACES_COUNT 1 + +#define PIN_WIRE_SDA (18u) +#define PIN_WIRE_SCL (19u) + +static const uint8_t SDA = PIN_WIRE_SDA; +static const uint8_t SCL = PIN_WIRE_SCL; + + +/* + * SPI Interfaces + */ +#define SPI_INTERFACES_COUNT 1 + +#define PIN_SPI_SS (26u) +#define PIN_SPI_SCK (27u) +#define PIN_SPI_MISO (28u) +#define PIN_SPI_MOSI (29u) + +static const uint8_t SS = PIN_SPI_SS; // was cs before ?? +static const uint8_t MOSI = PIN_SPI_MOSI; +static const uint8_t MISO = PIN_SPI_MISO; +static const uint8_t SCK = PIN_SPI_SCK; + + +// NFC antenna pins +#define PIN_NFC1 (16u) +#define PIN_NFC2 (17u) + + +/* + * Reset Button at P0.21 + */ +#define RESET_PIN (31u) + +#ifdef __cplusplus +} +#endif + +/*---------------------------------------------------------------------------- + * Arduino objects - C++ only + *----------------------------------------------------------------------------*/ + +#endif