Skip to content

Commit a57810d

Browse files
jadonkcfriedt
authored andcommitted
boards: arm: add BeagleConnect Freedom
Add support for BeagleConnect Freedom, a TI CC1352P7 based development board with enclosure and antenna featuring BLE and SubGHz wireless, 2x mikroBUS sockets, external flash, light, temperature/humidity sensors, USB-to-UART bridge, buzzer and battery charger. See https://beagleconnect.org for details. Previous closed pull requests: * #38718 * #36703 Cc: Chris Friedt <[email protected]> Signed-off-by: Jason Kridner <[email protected]> Signed-off-by: Vaishnav Achath <[email protected]> Signed-off-by: Erik Larson <[email protected]> Signed-off-by: Yadnik Bendale <[email protected]> Signed-off-by: Baozhu Zuo <[email protected]>
1 parent f36be35 commit a57810d

14 files changed

+652
-1
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
zephyr_library()
4+
zephyr_library_sources(
5+
board_antenna.c
6+
)
7+
8+
zephyr_library_compile_definitions("DeviceFamily_CC13X2X7")
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# BeagleConnect Freedom board configuration
2+
3+
# Copyright (c) 2020 Erik Larson
4+
# Copyright (c) 2021 Jason Kridner, BeagleBoard.org Foundation
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
config BOARD_BEAGLECONNECT_FREEDOM
8+
bool "BeagleConnect Freedom"
9+
depends on SOC_CC1352P7
10+
11+
if BOARD_BEAGLECONNECT_FREEDOM
12+
13+
config BOARD_ANTENNA_INIT_PRIO
14+
int "Board antenna switch initialization priority"
15+
default 70
16+
help
17+
Set the priority for board init, must be greater than
18+
KERNEL_INIT_PRIORITY_DEVICE but smaller than
19+
IEEE802154_CC13XX_CC26XX_SUB_GHZ_INIT_PRIO.
20+
21+
endif # BOARD_BEAGLECONNECT_FREEDOM
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# BeagleConnect Freedom board configuration
2+
3+
# Copyright (c) 2020 Erik Larson
4+
# Copyright (c) 2020 Jason Kridner, BeagleBoard.org Foundation
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
if BOARD_BEAGLECONNECT_FREEDOM
8+
9+
config BOARD
10+
default "beagleconnect_freedom"
11+
12+
endif # BOARD_BEAGLECONNECT_FREEDOM
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
/* SPDX-License-Identifier: Apache-2.0
2+
*
3+
* Copyright (c) 2022 Vaishnav Achath
4+
*
5+
*/
6+
7+
#include <zephyr/dt-bindings/pinctrl/cc13xx_cc26xx-pinctrl.h>
8+
9+
&pinctrl {
10+
/* UART0 */
11+
uart0_tx_default: uart0_tx_default {
12+
pinmux = <13 IOC_PORT_MCU_UART0_TX>;
13+
bias-disable;
14+
};
15+
uart0_rx_default: uart0_rx_default {
16+
pinmux = <12 IOC_PORT_MCU_UART0_RX>;
17+
bias-disable;
18+
input-enable;
19+
};
20+
21+
/* UART1 */
22+
uart1_tx_default: uart1_tx_default {
23+
pinmux = <22 IOC_PORT_MCU_UART1_TX>;
24+
bias-disable;
25+
};
26+
uart1_rx_default: uart1_rx_default {
27+
pinmux = <21 IOC_PORT_MCU_UART1_RX>;
28+
bias-disable;
29+
input-enable;
30+
};
31+
32+
/* I2C0 */
33+
i2c0_scl_default: i2c0_scl_default {
34+
pinmux = <25 IOC_PORT_MCU_I2C_MSSCL>;
35+
bias-pull-up;
36+
drive-open-drain;
37+
input-enable;
38+
};
39+
i2c0_sda_default: i2c0_sda_default {
40+
pinmux = <26 IOC_PORT_MCU_I2C_MSSDA>;
41+
bias-pull-up;
42+
drive-open-drain;
43+
input-enable;
44+
};
45+
i2c0_scl_sleep: i2c0_scl_sleep {
46+
pinmux = <25 IOC_PORT_GPIO>;
47+
bias-disable;
48+
};
49+
i2c0_sda_sleep: i2c0_sda_sleep {
50+
pinmux = <26 IOC_PORT_GPIO>;
51+
bias-disable;
52+
};
53+
54+
/* SPI0 */
55+
spi0_sck_default: spi0_sck_default {
56+
pinmux = <10 IOC_PORT_MCU_SSI0_CLK>;
57+
bias-disable;
58+
};
59+
spi0_mosi_default: spi0_mosi_default {
60+
pinmux = <9 IOC_PORT_MCU_SSI0_TX>;
61+
bias-disable;
62+
};
63+
spi0_miso_default: spi0_miso_default {
64+
pinmux = <11 IOC_PORT_MCU_SSI0_RX>;
65+
bias-disable;
66+
input-enable;
67+
};
68+
spi0_cs0_default: spi0_cs0_default {
69+
pinmux = <8 IOC_PORT_GPIO>;
70+
bias-disable;
71+
};
72+
spi0_cs1_default: spi0_cs1_default {
73+
pinmux = <28 IOC_PORT_GPIO>;
74+
bias-disable;
75+
};
76+
spi0_cs2_default: spi0_cs2_default {
77+
pinmux = <27 IOC_PORT_GPIO>;
78+
bias-disable;
79+
};
80+
81+
/* On-board antenna pinmux states */
82+
board_ant_tx_pa_off: board_ant_tx_pa_off {
83+
pinmux = <29 IOC_PORT_GPIO>;
84+
};
85+
board_ant_tx_pa_on: board_ant_tx_pa_on {
86+
pinmux = <29 IOC_PORT_RFC_GPO3>;
87+
};
88+
board_ant_subg_off: board_ant_subg_off {
89+
pinmux = <30 IOC_PORT_GPIO>;
90+
};
91+
board_ant_subg_on: board_ant_subg_on {
92+
pinmux = <30 IOC_PORT_RFC_GPO0>;
93+
};
94+
};
Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
/*
2+
* Copyright (c) 2020 Erik Larson
3+
* Copyright (c) 2020-2022 Jason Kridner, BeagleBoard.org Foundation
4+
*
5+
* SPDX-License-Identifier: Apache-2.0
6+
*/
7+
8+
/dts-v1/;
9+
10+
#include <ti/cc1352r7.dtsi>
11+
#include "beagleconnect_freedom-pinctrl.dtsi"
12+
13+
#define BTN_GPIO_FLAGS (GPIO_ACTIVE_LOW | GPIO_PULL_UP)
14+
15+
/ {
16+
model = "BeagleConnect Freedom";
17+
compatible = "beagle,beagleconnect-freedom";
18+
19+
aliases {
20+
led0 = &led0;
21+
sw0 = &button0;
22+
mcuboot-button0 = &button0;
23+
sensor0 = &light;
24+
sensor1 = &humidity;
25+
spi-flash0 = &spi_flash0;
26+
};
27+
28+
chosen {
29+
zephyr,sram = &sram0;
30+
zephyr,console = &uart0;
31+
zephyr,shell-uart = &uart0;
32+
zephyr,flash = &flash0;
33+
zephyr,ieee802154 = &ieee802154g;
34+
zephyr,code-partition = &slot0_partition;
35+
};
36+
37+
gpio_keys {
38+
compatible = "gpio-keys";
39+
button0: button_0 {
40+
gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
41+
};
42+
};
43+
44+
leds: leds {
45+
compatible = "gpio-leds";
46+
led0: led_0 {
47+
gpios = <&gpio0 18 GPIO_ACTIVE_HIGH>; // 2.4GHz TX/RX
48+
};
49+
50+
/* U.FL connector switch */
51+
rf_sw: rf_sw {
52+
gpios =
53+
<&gpio0 29 GPIO_ACTIVE_HIGH>, // SubG TX +20dB
54+
<&gpio0 30 GPIO_ACTIVE_HIGH>; // SubG TX/RX 0dB
55+
};
56+
};
57+
58+
sens_i2c: sensor-switch {
59+
status = "okay";
60+
compatible = "ti,ts5a2066";
61+
#address-cells = <1>;
62+
#size-cells = <0>;
63+
controller = <&i2c0>;
64+
gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>;
65+
66+
light: opt3001-light@44 {
67+
status = "okay";
68+
compatible = "ti,opt3001";
69+
reg = <0x44>;
70+
};
71+
72+
humidity: hdc2010-humidity@41 {
73+
status = "okay";
74+
compatible = "ti,hdc2010";
75+
reg = <0x41>;
76+
};
77+
};
78+
79+
power-states {
80+
idle: idle {
81+
compatible = "zephyr,power-state";
82+
power-state-name = "suspend-to-idle";
83+
min-residency-us = <1000>;
84+
};
85+
86+
standby: standby {
87+
compatible = "zephyr,power-state";
88+
power-state-name = "standby";
89+
min-residency-us = <5000>;
90+
exit-latency-us = <240>;
91+
};
92+
};
93+
};
94+
95+
&flash0 {
96+
partitions {
97+
compatible = "fixed-partitions";
98+
#address-cells = <1>;
99+
#size-cells = <1>;
100+
101+
/* Allocate 128 KiB for mcuboot */
102+
boot_partition: partition@0 {
103+
label = "mcuboot";
104+
reg = <0x00000000 0x00020000>;
105+
};
106+
107+
/* Allocate 568 KiB for application (avoid touching CCFG) */
108+
slot0_partition: partition@20000 {
109+
label = "image-0";
110+
reg = <0x00020000 0x0008e000>;
111+
};
112+
};
113+
};
114+
115+
&cpu0 {
116+
clock-frequency = <48000000>;
117+
cpu-power-states = <&idle &standby>;
118+
};
119+
120+
&trng {
121+
status = "okay";
122+
};
123+
124+
&gpio0 {
125+
status = "okay";
126+
};
127+
128+
/* Side away from battery connector (with MSP430) */
129+
&uart0 {
130+
status = "okay";
131+
current-speed = <115200>;
132+
pinctrl-0 = <&uart0_rx_default &uart0_tx_default>;
133+
pinctrl-names = "default";
134+
};
135+
136+
/* Side with battery connector (with CC1352 and not MSP430) */
137+
&uart1 {
138+
status = "okay";
139+
current-speed = <115200>;
140+
pinctrl-0 = <&uart1_rx_default &uart1_tx_default>;
141+
pinctrl-names = "default";
142+
};
143+
144+
&i2c0 {
145+
status = "okay";
146+
clock-frequency = <I2C_BITRATE_FAST>;
147+
pinctrl-0 = <&i2c0_scl_default &i2c0_sda_default>;
148+
pinctrl-1 = <&i2c0_scl_sleep &i2c0_sda_sleep>;
149+
pinctrl-names = "default", "sleep";
150+
151+
mcu: msp430-usbbridge@4 {
152+
compatible = "beagle,usbbridge";
153+
reg = <0x4>;
154+
};
155+
};
156+
157+
&spi0 {
158+
status = "okay";
159+
pinctrl-0 = <&spi0_sck_default &spi0_mosi_default
160+
&spi0_miso_default &spi0_cs0_default
161+
&spi0_cs1_default &spi0_cs2_default>;
162+
pinctrl-names = "default";
163+
cs-gpios = <&gpio0 8 GPIO_ACTIVE_LOW>, // SPI flash
164+
<&gpio0 28 GPIO_ACTIVE_LOW>, // mikroBUS port 1
165+
<&gpio0 27 GPIO_ACTIVE_LOW>; // mikroBUS port 2
166+
167+
spi_flash0: gd25q16c@0 {
168+
compatible = "jedec,spi-nor";
169+
reg = <0>;
170+
spi-max-frequency = <2000000>;
171+
size = <0x200000>;
172+
//has-be32k;
173+
has-dpd;
174+
t-enter-dpd = <20000>;
175+
t-exit-dpd = <100000>;
176+
jedec-id = [c8 40 15];
177+
178+
partitions {
179+
compatible = "fixed-partitions";
180+
#address-cells = <1>;
181+
#size-cells = <1>;
182+
183+
/* Allocate 568 KiB for application */
184+
slot1_partition: partition@0 {
185+
label = "image-1";
186+
reg = <0x00000000 0x0008e000>;
187+
};
188+
189+
/* Allocate 128 KiB scratch for image swap */
190+
scratch_partition: partition@8e000 {
191+
label = "image-scratch";
192+
reg = <0x0008e000 0x00020000>;
193+
};
194+
195+
/* Allocate 1 MiB storage partition */
196+
storage_partition: partition@ae000 {
197+
label = "storage";
198+
reg = <0x000ae000 DT_SIZE_K(1024)>;
199+
};
200+
};
201+
};
202+
};
203+
204+
&rtc {
205+
status = "okay";
206+
};
207+
208+
&ieee802154 {
209+
status = "okay";
210+
};
211+
212+
&ieee802154g {
213+
status = "okay";
214+
};
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
identifier: beagleconnect_freedom
2+
name: BeagleConnect Freedom
3+
type: mcu
4+
arch: arm
5+
ram: 144
6+
flash: 704
7+
toolchain:
8+
- zephyr
9+
- gnuarmemb
10+
- xtools
11+
supported:
12+
- gpio
13+
- i2c
14+
- spi
15+
- uart
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#
2+
# Copyright (c) 2020 Erik Larson
3+
# Copyright (c) 2020 Jason Kridner, BeagleBoard.org Foundation
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
#
7+
8+
CONFIG_SOC_SERIES_CC13X2X7_CC26X2X7=y
9+
CONFIG_SOC_CC1352P7=y
10+
CONFIG_BOARD_BEAGLECONNECT_FREEDOM=y
11+
CONFIG_BUILD_OUTPUT_HEX=y
12+
# custom callback for the antenna switch
13+
CONFIG_CC13X2_CC26X2_HAS_CUSTOM_RF_HWATTRS=y
14+
CONFIG_CC13X2_CC26X2_BOOTLOADER_ENABLE=y
15+
CONFIG_CC13X2_CC26X2_BOOTLOADER_BACKDOOR_ENABLE=y
16+
CONFIG_CC13X2_CC26X2_BOOTLOADER_BACKDOOR_PIN=15
17+
# Enable MPU and hardware stack protection
18+
CONFIG_ARM_MPU=y
19+
CONFIG_HW_STACK_PROTECTION=y

boards/arm/beagle_bcf/board.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright (c) 2020 Erik Larson
2+
# Copyright (c) 2022 Jason Kridner, BeagleBoard.org Foundation
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
# Download cc2538-bsl.py from https://git.beagleboard.org/beagleconnect/zephyr/cc2538-bsl/-/tags/2.1-bcf
7+
8+
board_set_flasher_ifnset(misc-flasher)
9+
board_finalize_runner_args(misc-flasher $ENV{ZEPHYR_BASE}/boards/arm/beagle_bcf/cc2538-bsl.py -w)

0 commit comments

Comments
 (0)