Skip to content

Commit ba70ccc

Browse files
committed
Add RedBear Blend 2 variant
1 parent 5103552 commit ba70ccc

File tree

6 files changed

+220
-2
lines changed

6 files changed

+220
-2
lines changed

.travis.yml

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

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Does not require a custom bootloader on the device.
1313
* [Nordic Semiconductor nRF52 DK](https://www.nordicsemi.com/eng/Products/Bluetooth-Smart-Bluetooth-low-energy/nRF52-DK)
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)
16+
* [RedBear Blend 2](https://github.com/redbear/nRF5x#blend-2)
1617

1718
### nRF51
1819
* [Plain nRF51 MCU](https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF51822)
@@ -59,7 +60,7 @@ No additional setup required.
5960
4. Select ```Options -> List All Devices```
6061
5. Select ```J-Link (Interface 2)``` from the device dropdown
6162
6. Click ```Replace Driver```
62-
63+
6364
__NOTE__: To roll back to the original driver go to: Device Manager -> Open Device -> Update Driver
6465

6566
### Flashing a SoftDevice

boards.txt

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,44 @@ OSHChip.menu.softdevice.s130.build.extra_flags=-DNRF51 -DS130 -DNRF51_S130
401401
OSHChip.menu.softdevice.s130.build.ldscript=armgcc_s130_nrf51822_xxac.ld
402402

403403

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+
404442
BLENano.name=RedBearLab BLE Nano
405443

406444
BLENano.upload.tool=sandeepmistry:openocd
@@ -539,7 +577,7 @@ ng_beacon.build.board=NG_BEACON
539577
ng_beacon.build.core=nRF5
540578
ng_beacon.build.variant=ng-beacon
541579
ng_beacon.build.variant_system_lib=
542-
ng_beacon.build.extra_flags=-DNRF51
580+
ng_beacon.build.extra_flags=-DNRF51
543581
ng_beacon.build.float_flags=
544582
ng_beacon.build.ldscript=nrf51_xxaa.ld
545583
ng_beacon.build.lfclk_flags=-DUSE_LFRC
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_Blend2/variant.cpp

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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+
// D0 - D7
24+
11,
25+
12,
26+
13,
27+
14,
28+
15,
29+
16,
30+
17,
31+
18,
32+
33+
// D8 - D13
34+
19,
35+
20,
36+
22,
37+
23,
38+
24,
39+
25,
40+
41+
// A0 - A5
42+
3,
43+
4,
44+
28,
45+
29,
46+
30,
47+
31,
48+
49+
// SDA, SCL
50+
26,
51+
27,
52+
53+
// RX, TX
54+
8,
55+
6,
56+
57+
// AREF
58+
2
59+
};

variants/RedBear_Blend2/variant.h

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
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_BLEND2_
18+
#define _VARIANT_REDBEAR_BLEND2_
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 (25u)
36+
#define NUM_DIGITAL_PINS (20u)
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 (14)
47+
#define PIN_A1 (15)
48+
#define PIN_A2 (16)
49+
#define PIN_A3 (17)
50+
#define PIN_A4 (18)
51+
#define PIN_A5 (19)
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+
// Other pins
62+
#define PIN_AREF (24)
63+
static const uint8_t AREF = PIN_AREF;
64+
65+
/*
66+
* Serial interfaces
67+
*/
68+
// Serial
69+
#define PIN_SERIAL_RX (22)
70+
#define PIN_SERIAL_TX (23)
71+
72+
/*
73+
* SPI Interfaces
74+
*/
75+
#define SPI_INTERFACES_COUNT 1
76+
77+
#define PIN_SPI_MISO (12)
78+
#define PIN_SPI_MOSI (11)
79+
#define PIN_SPI_SCK (13)
80+
81+
static const uint8_t SS = 10 ;
82+
static const uint8_t MOSI = PIN_SPI_MOSI ;
83+
static const uint8_t MISO = PIN_SPI_MISO ;
84+
static const uint8_t SCK = PIN_SPI_SCK ;
85+
86+
/*
87+
* Wire Interfaces
88+
*/
89+
#define WIRE_INTERFACES_COUNT 1
90+
91+
#define PIN_WIRE_SDA (20u)
92+
#define PIN_WIRE_SCL (21u)
93+
94+
#ifdef __cplusplus
95+
}
96+
#endif
97+
98+
/*----------------------------------------------------------------------------
99+
* Arduino objects - C++ only
100+
*----------------------------------------------------------------------------*/
101+
102+
#endif

0 commit comments

Comments
 (0)