Skip to content

Commit 8e6949d

Browse files
authored
Merge pull request sandeepmistry#95 from sandeepmistry/redbear-nano2
Add RedBear BLE Nano 2 variant
2 parents 66db5a4 + 00c126e commit 8e6949d

File tree

6 files changed

+237
-38
lines changed

6 files changed

+237
-38
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ script:
3131
- buildExampleSketch sandeepmistry:nRF5:PCA1000X:board_variant=nrf6310 01.Basics Blink
3232
- buildExampleSketch sandeepmistry:nRF5:nRF51Dongle:version=1_1_0 01.Basics Blink
3333
- buildExampleSketch sandeepmistry:nRF5:Blend2 01.Basics Blink
34+
- buildExampleSketch sandeepmistry:nRF5:BLENano2 01.Basics Blink

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Does not require a custom bootloader on the device.
1414
* For boards prior to ```2016.9``` (see sticker), the lastest JLink bootloader is required to upload sketches. To upgrade, press the boot/reset button while powering on the board and copy over the latest [bootloader](https://www.nordicsemi.com/eng/nordic/Products/nRF52-DK/nRF5x-OB-JLink-IF/52275).
1515
* [Shenzhen Taida Century Technology nRF52 low cost development board](https://www.aliexpress.com/item/NRF52832-high-cost-development-board-gold-core-board/32725601299.html)
1616
* [RedBear Blend 2](https://github.com/redbear/nRF5x#blend-2)
17+
* [RedBear Nano 2](https://github.com/redbear/nRF5x#ble-nano-2)
1718

1819
### nRF51
1920
* [Plain nRF51 MCU](https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF51822)

boards.txt

Lines changed: 76 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,82 @@ Generic_nRF52832.menu.lfclk.lfsynt=Synthesized
6060
Generic_nRF52832.menu.lfclk.lfsynt.build.lfclk_flags=-DUSE_LFSYNT
6161

6262

63+
Blend2.name=RedBear Blend 2
64+
65+
Blend2.vid.0=0x0204
66+
Blend2.pid.0=0x0d28
67+
68+
Blend2.upload.tool=sandeepmistry:openocd
69+
Blend2.upload.protocol=
70+
Blend2.upload.interface=cmsis-dap
71+
Blend2.upload.target=nrf52
72+
Blend2.upload.maximum_size=524288
73+
Blend2.upload.setup_command=transport select swd;
74+
Blend2.upload.use_1200bps_touch=false
75+
Blend2.upload.wait_for_upload_port=false
76+
Blend2.upload.native_usb=false
77+
78+
Blend2.bootloader.tool=sandeepmistry:openocd
79+
80+
Blend2.build.mcu=cortex-m4
81+
Blend2.build.f_cpu=16000000
82+
Blend2.build.board=RB_BLEND_2
83+
Blend2.build.core=nRF5
84+
Blend2.build.variant=RedBear_Blend2
85+
Blend2.build.variant_system_lib=
86+
Blend2.build.extra_flags=-DNRF52
87+
Blend2.build.float_flags=-mfloat-abi=hard -mfpu=fpv4-sp-d16
88+
Blend2.build.ldscript=nrf52_xxaa.ld
89+
90+
Blend2.menu.softdevice.none=None
91+
Blend2.menu.softdevice.none.softdevice=none
92+
93+
Blend2.menu.softdevice.s132=S132
94+
Blend2.menu.softdevice.s132.softdevice=s132
95+
Blend2.menu.softdevice.s132.softdeviceversion=2.0.1
96+
Blend2.menu.softdevice.s132.upload.maximum_size=409600
97+
Blend2.menu.softdevice.s132.build.extra_flags=-DNRF52 -DS132 -DNRF51_S132
98+
Blend2.menu.softdevice.s132.build.ldscript=armgcc_s132_nrf52832_xxaa.ld
99+
100+
101+
BLENano2.name=RedBear BLE Nano 2
102+
103+
BLENano2.vid.0=0x0204
104+
BLENano2.pid.0=0x0d28
105+
106+
BLENano2.upload.tool=sandeepmistry:openocd
107+
BLENano2.upload.protocol=
108+
BLENano2.upload.interface=cmsis-dap
109+
BLENano2.upload.target=nrf52
110+
BLENano2.upload.maximum_size=524288
111+
BLENano2.upload.setup_command=transport select swd;
112+
BLENano2.upload.use_1200bps_touch=false
113+
BLENano2.upload.wait_for_upload_port=false
114+
BLENano2.upload.native_usb=false
115+
116+
BLENano2.bootloader.tool=sandeepmistry:openocd
117+
118+
BLENano2.build.mcu=cortex-m4
119+
BLENano2.build.f_cpu=16000000
120+
BLENano2.build.board=RB_BLE_NANO_2
121+
BLENano2.build.core=nRF5
122+
BLENano2.build.variant=RedBear_BLENano2
123+
BLENano2.build.variant_system_lib=
124+
BLENano2.build.extra_flags=-DNRF52
125+
BLENano2.build.float_flags=-mfloat-abi=hard -mfpu=fpv4-sp-d16
126+
BLENano2.build.ldscript=nrf52_xxaa.ld
127+
128+
BLENano2.menu.softdevice.none=None
129+
BLENano2.menu.softdevice.none.softdevice=none
130+
131+
BLENano2.menu.softdevice.s132=S132
132+
BLENano2.menu.softdevice.s132.softdevice=s132
133+
BLENano2.menu.softdevice.s132.softdeviceversion=2.0.1
134+
BLENano2.menu.softdevice.s132.upload.maximum_size=409600
135+
BLENano2.menu.softdevice.s132.build.extra_flags=-DNRF52 -DS132 -DNRF51_S132
136+
BLENano2.menu.softdevice.s132.build.ldscript=armgcc_s132_nrf52832_xxaa.ld
137+
138+
63139
nRF52DK.name=Nordic Semiconductor nRF52 DK
64140

65141
nRF52DK.vid.0=0x1366
@@ -401,44 +477,6 @@ OSHChip.menu.softdevice.s130.build.extra_flags=-DNRF51 -DS130 -DNRF51_S130
401477
OSHChip.menu.softdevice.s130.build.ldscript=armgcc_s130_nrf51822_xxac.ld
402478

403479

404-
Blend2.name=RedBear Blend 2
405-
406-
Blend2.vid.0=0x0204
407-
Blend2.pid.0=0x0d28
408-
409-
Blend2.upload.tool=sandeepmistry:openocd
410-
Blend2.upload.protocol=
411-
Blend2.upload.interface=cmsis-dap
412-
Blend2.upload.target=nrf52
413-
Blend2.upload.maximum_size=524288
414-
Blend2.upload.setup_command=transport select swd;
415-
Blend2.upload.use_1200bps_touch=false
416-
Blend2.upload.wait_for_upload_port=false
417-
Blend2.upload.native_usb=false
418-
419-
Blend2.bootloader.tool=sandeepmistry:openocd
420-
421-
Blend2.build.mcu=cortex-m4
422-
Blend2.build.f_cpu=16000000
423-
Blend2.build.board=RB_BLEND_2
424-
Blend2.build.core=nRF5
425-
Blend2.build.variant=RedBear_Blend2
426-
Blend2.build.variant_system_lib=
427-
Blend2.build.extra_flags=-DNRF52
428-
Blend2.build.float_flags=-mfloat-abi=hard -mfpu=fpv4-sp-d16
429-
Blend2.build.ldscript=nrf52_xxaa.ld
430-
431-
Blend2.menu.softdevice.none=None
432-
Blend2.menu.softdevice.none.softdevice=none
433-
434-
Blend2.menu.softdevice.s132=S132
435-
Blend2.menu.softdevice.s132.softdevice=s132
436-
Blend2.menu.softdevice.s132.softdeviceversion=2.0.1
437-
Blend2.menu.softdevice.s132.upload.maximum_size=409600
438-
Blend2.menu.softdevice.s132.build.extra_flags=-DNRF52 -DS132 -DNRF51_S132
439-
Blend2.menu.softdevice.s132.build.ldscript=armgcc_s132_nrf52832_xxaa.ld
440-
441-
442480
BLENano.name=RedBearLab BLE Nano
443481

444482
BLENano.upload.tool=sandeepmistry:openocd
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
3+
This library is free software; you can redistribute it and/or
4+
modify it under the terms of the GNU Lesser General Public
5+
License as published by the Free Software Foundation; either
6+
version 2.1 of the License, or (at your option) any later version.
7+
This library is distributed in the hope that it will be useful,
8+
but WITHOUT ANY WARRANTY; without even the implied warranty of
9+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10+
See the GNU Lesser General Public License for more details.
11+
You should have received a copy of the GNU Lesser General Public
12+
License along with this library; if not, write to the Free Software
13+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
14+
*/
15+
16+
// API compatibility
17+
#include "variant.h"

variants/RedBear_BLENano2/variant.cpp

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
3+
Copyright (c) 2016 Sandeep Mistry All right reserved.
4+
5+
This library is free software; you can redistribute it and/or
6+
modify it under the terms of the GNU Lesser General Public
7+
License as published by the Free Software Foundation; either
8+
version 2.1 of the License, or (at your option) any later version.
9+
10+
This library is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13+
See the GNU Lesser General Public License for more details.
14+
15+
You should have received a copy of the GNU Lesser General Public
16+
License along with this library; if not, write to the Free Software
17+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18+
*/
19+
20+
#include "variant.h"
21+
22+
const uint32_t g_ADigitalPinMap[] = {
23+
// A0/D0 - A5/D5
24+
30,
25+
29,
26+
28,
27+
2,
28+
5,
29+
4,
30+
31+
// D6 - D10
32+
3,
33+
6,
34+
7,
35+
8,
36+
21,
37+
38+
// D11 - D12
39+
(uint32_t)-1,
40+
(uint32_t)-1,
41+
42+
// D13
43+
11
44+
};

variants/RedBear_BLENano2/variant.h

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
/*
2+
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
3+
Copyright (c) 2016 Sandeep Mistry All right reserved.
4+
This library is free software; you can redistribute it and/or
5+
modify it under the terms of the GNU Lesser General Public
6+
License as published by the Free Software Foundation; either
7+
version 2.1 of the License, or (at your option) any later version.
8+
This library is distributed in the hope that it will be useful,
9+
but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11+
See the GNU Lesser General Public License for more details.
12+
You should have received a copy of the GNU Lesser General Public
13+
License along with this library; if not, write to the Free Software
14+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
15+
*/
16+
17+
#ifndef _VARIANT_REDBEAR_BLE_NANO2_
18+
#define _VARIANT_REDBEAR_BLE_NANO2_
19+
20+
/** Master clock frequency */
21+
#define VARIANT_MCK (64000000ul)
22+
23+
/*----------------------------------------------------------------------------
24+
* Headers
25+
*----------------------------------------------------------------------------*/
26+
27+
#include "WVariant.h"
28+
29+
#ifdef __cplusplus
30+
extern "C"
31+
{
32+
#endif // __cplusplus
33+
34+
// Number of pins defined in PinDescription array
35+
#define PINS_COUNT (14u)
36+
#define NUM_DIGITAL_PINS (14u)
37+
#define NUM_ANALOG_INPUTS (6u)
38+
#define NUM_ANALOG_OUTPUTS (0u)
39+
40+
// LEDs
41+
#define LED_BUILTIN 13
42+
43+
/*
44+
* Analog pins
45+
*/
46+
#define PIN_A0 (0)
47+
#define PIN_A1 (1)
48+
#define PIN_A2 (2)
49+
#define PIN_A3 (3)
50+
#define PIN_A4 (4)
51+
#define PIN_A5 (5)
52+
53+
static const uint8_t A0 = PIN_A0 ;
54+
static const uint8_t A1 = PIN_A1 ;
55+
static const uint8_t A2 = PIN_A2 ;
56+
static const uint8_t A3 = PIN_A3 ;
57+
static const uint8_t A4 = PIN_A4 ;
58+
static const uint8_t A5 = PIN_A5 ;
59+
#define ADC_RESOLUTION 14
60+
61+
/*
62+
* Serial interfaces
63+
*/
64+
// Serial
65+
#define PIN_SERIAL_RX (0)
66+
#define PIN_SERIAL_TX (1)
67+
68+
/*
69+
* SPI Interfaces
70+
*/
71+
#define SPI_INTERFACES_COUNT 1
72+
73+
#define PIN_SPI_MISO (8)
74+
#define PIN_SPI_MOSI (7)
75+
#define PIN_SPI_SCK (9)
76+
77+
static const uint8_t SS = 6 ;
78+
static const uint8_t MOSI = PIN_SPI_MOSI ;
79+
static const uint8_t MISO = PIN_SPI_MISO ;
80+
static const uint8_t SCK = PIN_SPI_SCK ;
81+
82+
/*
83+
* Wire Interfaces
84+
*/
85+
#define WIRE_INTERFACES_COUNT 1
86+
87+
#define PIN_WIRE_SDA (2u)
88+
#define PIN_WIRE_SCL (3u)
89+
90+
#ifdef __cplusplus
91+
}
92+
#endif
93+
94+
/*----------------------------------------------------------------------------
95+
* Arduino objects - C++ only
96+
*----------------------------------------------------------------------------*/
97+
98+
#endif

0 commit comments

Comments
 (0)