Skip to content

Commit 5d32b5c

Browse files
nockocarlescufi
authored andcommitted
boards: arm: Adds Sparkfun nRF52832 breakout board support
Signed-off-by: Shawn Nock <shawn@monadnock.ca>
1 parent 2b0821c commit 5d32b5c

File tree

10 files changed

+179
-0
lines changed

10 files changed

+179
-0
lines changed

boards/arm/nrf52_pca10040/nrf52_pca10040.dts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/*
2+
* Copyright (c) 2017 Shawn Nock <shawn@monadnock.ca>
23
* Copyright (c) 2017 Linaro Limited
34
*
45
* SPDX-License-Identifier: Apache-2.0
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Kconfig - Sparkfun nRF52832 breakout board configuration
2+
#
3+
# Copyright (c) 2017 Shawn Nock <shawn@monadnock.ca>
4+
# Copyright (c) 2016 Linaro Limited.
5+
#
6+
# SPDX-License-Identifier: Apache-2.0
7+
8+
9+
config BOARD_NRF52_SPARKFUN
10+
bool "nRF52 SPARKFUN"
11+
depends on SOC_NRF52832_QFAA
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Kconfig - Sparkfun nRF52832 breakout board configuration
2+
#
3+
# Copyright (c) 2017 Shawn Nock <shawn@monadnock.ca>
4+
# Copyright (c) 2016 Nordic Semiconductor ASA
5+
#
6+
# SPDX-License-Identifier: Apache-2.0
7+
8+
if BOARD_NRF52_SPARKFUN
9+
10+
config BOARD
11+
default nrf52_sparkfun
12+
13+
if GPIO_NRF5
14+
15+
config GPIO_NRF5_P0
16+
default y
17+
18+
endif # GPIO_NRF5
19+
20+
if UART_NRF5
21+
22+
config UART_NRF5_GPIO_TX_PIN
23+
default 27
24+
25+
config UART_NRF5_GPIO_RX_PIN
26+
default 26
27+
28+
endif # UART_NRF5
29+
30+
endif # BOARD_NRF52_SPARKFUN
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
set(BOARD_FLASH_RUNNER pyocd.sh)
2+
set(BOARD_DEBUG_RUNNER pyocd.sh)
3+
4+
set(PYOCD_TARGET nrf52)
5+
6+
set_property(GLOBAL APPEND PROPERTY FLASH_SCRIPT_ENV_VARS
7+
PYOCD_TARGET
8+
)

boards/arm/nrf52_sparkfun/board.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Copyright (c) 2017 Shawn Nock <shawn@monadnock.ca>
3+
* Copyright (c) 2016 Linaro Limited.
4+
*
5+
* SPDX-License-Identifier: Apache-2.0
6+
*/
7+
8+
#ifndef __INC_BOARD_H
9+
#define __INC_BOARD_H
10+
11+
#include <soc.h>
12+
13+
/* Onboard LED P0_07 */
14+
#define LED0_GPIO_PIN 7
15+
#define LED0_GPIO_PORT CONFIG_GPIO_NRF5_P0_DEV_NAME
16+
17+
/* Onboard BUTTON P0_06 */
18+
#define SW0_GPIO_PIN 6
19+
#define SW0_GPIO_PORT CONFIG_GPIO_NRF5_P0_DEV_NAME
20+
21+
#endif /* __INC_BOARD_H */
Binary file not shown.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#define CONFIG_NUM_IRQ_PRIO_BITS ARM_V7M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS
2+
#define CONFIG_UART_NRF5_IRQ_PRI NORDIC_NRF_UART_40002000_IRQ_0_PRIORITY
3+
#define CONFIG_UART_NRF5_BAUD_RATE NORDIC_NRF_UART_40002000_CURRENT_SPEED
4+
#define CONFIG_UART_NRF5_NAME NORDIC_NRF_UART_40002000_LABEL
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/*
2+
* Copyright (c) 2017 Shawn Nock <shawn@monadnock.ca>
3+
* Copyright (c) 2017 Linaro Limited
4+
*
5+
* SPDX-License-Identifier: Apache-2.0
6+
*/
7+
8+
/dts-v1/;
9+
#include <nordic/nrf52832.dtsi>
10+
11+
/ {
12+
model = "Sparkfun nRF52832 Breakout";
13+
compatible = "sparkfun,nrf52832", "nordic,nrf52832-qfaa",
14+
"nordic,nrf52832";
15+
16+
chosen {
17+
zephyr,console = &uart0;
18+
zephyr,sram = &sram0;
19+
zephyr,flash = &flash0;
20+
};
21+
};
22+
23+
&uart0 {
24+
compatible = "nordic,nrf-uart";
25+
current-speed = <115200>;
26+
status = "ok";
27+
};
28+
29+
&flash0 {
30+
/*
31+
* If chosen's zephyr,code-partition
32+
* is unset, the image will be linked
33+
* into the entire flash device. If
34+
* it points to an individual
35+
* partition, the code will be linked
36+
* to, and restricted to that
37+
* partition.
38+
*/
39+
partitions {
40+
compatible = "fixed-partitions";
41+
#address-cells = <1>;
42+
#size-cells = <1>;
43+
44+
boot_partition: partition@0 {
45+
label = "mcuboot";
46+
reg = <0x00000000 0xc000>;
47+
};
48+
slot0_partition: partition@c000 {
49+
label = "image-0";
50+
reg = <0x0000c000 0x32000>;
51+
};
52+
slot1_partition: partition@3e000 {
53+
label = "image-1";
54+
reg = <0x0003e000 0x32000>;
55+
};
56+
scratch_partition: partition@70000 {
57+
label = "image-scratch";
58+
reg = <0x00070000 0xa000>;
59+
};
60+
61+
/*
62+
* The flash starting at 0x0007a000 and ending at
63+
* 0x0007ffff (sectors 122-127) is reserved for use
64+
* by the application.
65+
*/
66+
67+
#if defined(CONFIG_FILE_SYSTEM_NFFS)
68+
nffs_partition: partition@7a000 {
69+
label = "nffs";
70+
reg = <0x0007a000 0x00006000>;
71+
};
72+
#endif
73+
};
74+
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
identifier: nrf52_sparkfun
2+
name: Sparkfun nRF52832 breakout
3+
type: mcu
4+
arch: arm
5+
toolchain:
6+
- zephyr
7+
- gccarmemb
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
CONFIG_ARM=y
2+
CONFIG_SOC_FAMILY_NRF5=y
3+
CONFIG_SOC_SERIES_NRF52X=y
4+
CONFIG_SOC_NRF52832_QFAA=y
5+
CONFIG_BOARD_NRF52_SPARKFUN=y
6+
7+
# Enable MPU
8+
CONFIG_ARM_MPU_NRF52X=y
9+
10+
# enable uart driver
11+
CONFIG_SERIAL=y
12+
CONFIG_UART_NRF5=y
13+
14+
# enable console
15+
CONFIG_CONSOLE=y
16+
CONFIG_UART_CONSOLE=y
17+
18+
# bluetooth
19+
CONFIG_BT=y
20+
CONFIG_BT_CTLR=y
21+
22+
# Enable P0_21 as RST
23+
CONFIG_GPIO_AS_PINRESET=y

0 commit comments

Comments
 (0)