Skip to content

Commit 33a4f02

Browse files
committed
simplelink: ti: Add CC2340R53, Mesh example and BLE FOTA to Demo II
- Add support for TI LP_EM_CC2340R53 board - Update crc-tool requirement to new name - Add support for Mesh example on LP_EM_CC2340R53 - Enable onchip/offchip BLE FOTA on cc2340r5x Signed-off-by: Lars Thalian Morstad <l-morstad@ti.com> Signed-off-by: Cameron Soviero <cam@ti.com> Signed-off-by: Jenny Tong <j-tong@ti.com> Signed-off-by: Ging Gonzalez <g-gonzalez@ti.com>
1 parent 970a7ec commit 33a4f02

34 files changed

+975
-21
lines changed

README.md

Lines changed: 45 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,10 @@ support them in the upstream repositories.
3535
Supported by this release:
3636

3737
- [CC2340R52](https://www.ti.com/product/CC2340R5)
38-
39-
Beta support:
40-
41-
Limited testing was also performed on the `CC2340R53`, a variant of the CC2340R5
42-
with 64kB of SRAM. Please note that some examples that require more RAM should
43-
be run on the CC2340R53. Please see the release notes for more details.
44-
45-
To use this device, change [`cc2340r5.dtsi`](dts/arm/ti/cc2340r5.dtsi)
46-
as follows:
47-
48-
```dts
49-
sram0: memory@20000000 {
50-
reg = <0x20000000 DT_SIZE_K(64)>;
51-
};
52-
```
38+
- [CC2340R53](https://www.ti.com/product/CC2340R5)
39+
- Tested only on the following examples:
40+
- samples/bluetooth/mesh_demo/
41+
- samples/bluetooth/mesh/
5342

5443
Supported by the Zephyr community:
5544

@@ -68,6 +57,7 @@ Supported by the Zephyr community:
6857
Supported by this release:
6958

7059
- [lp_em_cc2340r5](https://www.ti.com/tool/LP-EM-CC2340R5)
60+
- lp_em_cc2340r53
7161

7262
Supported by the Zephyr community:
7363

@@ -94,6 +84,46 @@ the environment and building your first application.
9484
> https://github.com/TexasInstruments/simplelink-zephyr/tags
9585
9686

87+
## BLE FOTA
88+
89+
TI supports BLE FOTA for Bluetooth Peripheral samples. To enable, add the following
90+
configurations to your project's `prj.conf`.
91+
92+
```
93+
# Enable BLE DFU FOTA MCUMGR MCUBOOT
94+
CONFIG_BOOTLOADER_MCUBOOT=y
95+
CONFIG_TI_MCUMGR_BT_OTA_DFU=y
96+
```
97+
98+
The following configurations should also be applied to your project's `prj.conf`
99+
to reduce flash and RAM consumption.
100+
101+
```
102+
CONFIG_LOG=n
103+
CONFIG_BT_RECV_WORKQ_SYS=y
104+
CONFIG_MCUMGR_TRANSPORT_NETBUF_COUNT=2
105+
CONFIG_MCUMGR_TRANSPORT_WORKQUEUE_STACK_SIZE=1100
106+
```
107+
108+
You can then build MCUboot and the Bluetooth Peripheral sample using the following
109+
commands
110+
111+
```
112+
west build -p=always -b lp_em_cc2340r5 -d build_mcuboot_f3 bootloader/mcuboot/boot/zephyr
113+
west build -p=always -b lp_em_cc2340r5 -d build_peripheral_fota_f3 zephyr/samples/bluetooth/peripheral_fota/
114+
```
115+
116+
By default, BLE FOTA uses the internal flash as the secondary slot for MCUboot.
117+
For applications that require more flash, the external flash on the `lp_em_cc2340r5x`
118+
can be used as the secondary slot instead. To enable this, TI provides Snippets
119+
that can be applied at build time to enable offchip BLE FOTA. Use the commands below
120+
as reference
121+
122+
```
123+
west build -p=always -b lp_em_cc2340r5 -d build_mcuboot_offchip_f3 bootloader/mcuboot/boot/zephyr -S ti-spi-nor-secondary-bl
124+
west build -p=always -b lp_em_cc2340r5 -d build_peripheral_offchip_fota_f3 zephyr/samples/bluetooth/peripheral_fota/ -S ti-spi-nor-secondary-app
125+
```
126+
97127
## Tools support
98128

99129
Currently the XDS110 debugger supplied with TI Launchpads is not natively

boards/ti/lp_em_cc2340r5/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2024 Texas Instruments Incorporated
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
rsource "../lpf3_common/Kconfig"

boards/ti/lp_em_cc2340r5/Kconfig.defconfig

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# Copyright (c) 2024 Texas Instruments Incorporated
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
rsource "../lpf3_common/Kconfig.defconfig"
6+
17
if BOARD_LP_EM_CC2340R5
28

39

@@ -9,7 +15,7 @@ config ZEPHYR
915
help
1016
Bluetooth TI Controller on ZEPHYR OS.
1117
default y
12-
18+
1319
config BT_LL_HEAP_SIZE
1420
hex "LL Heap memory pool size (in bytes)"
1521
default 0x1800
@@ -22,6 +28,8 @@ CONFIG_BT_BUF_EVT_RX_SIZE=255
2228
CONFIG_BT_BUF_ACL_RX_SIZE=255
2329
CONFIG_BT_BUF_ACL_TX_SIZE=251
2430
CONFIG_BT_BUF_CMD_TX_SIZE=255
31+
config BT_HCI_ACL_FLOW_CONTROL
32+
default n
2533

2634
endif # BT
2735

boards/ti/lp_em_cc2340r5/lp_em_cc2340r5-pinctrl.dtsi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@
3737
pinmux = <11 DIO11_SPI0_CSN>;
3838
bias-disable;
3939
};
40+
spi0_flash_cs: spi0_flash_cs {
41+
pinmux = <6 DIO6_SPI0_CSN>;
42+
bias-disable;
43+
};
4044

4145
/* ADC0 */
4246
adc0_ch0: adc0_ch0 {

boards/ti/lp_em_cc2340r5/lp_em_cc2340r5.dts

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
zephyr,shell-uart = &uart0;
2828
zephyr,bt_hci = &ti_bt_hci;
2929
zephyr,bt-c2h-uart = &uart0;
30+
zephyr,code-partition = &slot0_partition;
31+
zephyr,uart-mcumgr = &uart0;
3032
};
3133

3234
aliases {
@@ -37,6 +39,8 @@
3739
pwm-led0 = &pwm_green;
3840
pwm-led1 = &pwm_red;
3941
watchdog0 = &wdt0;
42+
mcuboot-led0 = &led1;
43+
mcuboot-button0 = &btn1;
4044
};
4145

4246
leds {
@@ -85,6 +89,28 @@
8589
};
8690
};
8791

92+
/delete-node/ &slot0_partition;
93+
&flash0 {
94+
partitions {
95+
/* 40 KiB (0xa000) for MCUboot */
96+
boot_partition: partition@0 {
97+
label = "mcuboot";
98+
reg = <0x00000000 0x0000a000>;
99+
};
100+
101+
/* 233472 Bytes (0x39000) per slot for application */
102+
slot0_partition: partition@a000 {
103+
label = "image-0";
104+
reg = <0x0000a000 0x00039000>;
105+
};
106+
107+
slot1_partition: partition@43000 {
108+
label = "image-1";
109+
reg = <0x00043000 0x00039000>;
110+
};
111+
};
112+
};
113+
88114
&cpu0 {
89115
clock-frequency = <48000000>;
90116
};
@@ -105,8 +131,22 @@
105131
pinctrl-0 = <&spi0_sck_default
106132
&spi0_mosi_default
107133
&spi0_miso_default
108-
&spi0_cs_default>;
134+
&spi0_flash_cs>;
109135
pinctrl-names = "default";
136+
cs-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
137+
mx25r80: mx25r8035f@0 {
138+
compatible = "jedec,spi-nor";
139+
reg = <0>;
140+
spi-max-frequency = <12000000>;
141+
size = <0x800000>;
142+
jedec-id = [c2 28 14];
143+
sfdp-bfp = [
144+
e5 20 f1 ff ff ff 7f 00 44 eb 08 6b 08 3b 04 bb
145+
ee ff ff ff ff ff 00 ff ff ff 00 ff 0c 20 0f 52
146+
10 d8 00 ff 23 72 f5 00 82 ed 04 b7 44 83 38 44
147+
30 b0 30 b0 f7 c4 d5 5c 00 be 29 ff f0 d0 ff ff
148+
];
149+
};
110150
};
111151

112152
&i2c0 {

boards/ti/lp_em_cc2340r5/lp_em_cc2340r5.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ identifier: lp_em_cc2340r5
22
name: TI SimpleLink CC2340R5 LaunchPad
33
type: mcu
44
arch: arm
5-
ram: 80
5+
ram: 36
66
flash: 512
77
toolchain:
88
- zephyr

boards/ti/lp_em_cc2340r5/lp_em_cc2340r5_defconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@ CONFIG_DYNAMIC_THREAD_STACK_SIZE=1500
2020

2121
CONFIG_PM=n
2222

23+
#CONFIG_BT_RECV_WORKQ_SYS=y
24+
25+
CONFIG_BT_COMPANY_ID=0x000D

boards/ti/lp_em_cc2340r53/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2024 Texas Instruments Incorporated
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
rsource "../lpf3_common/Kconfig"
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Copyright (c) 2024 Texas Instruments Incorporated
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
rsource "../lpf3_common/Kconfig.defconfig"
6+
7+
if BOARD_LP_EM_CC2340R53
8+
9+
10+
if BT
11+
12+
config ZEPHYR
13+
bool "Bluetooth TI Controller on ZEPHYR"
14+
15+
help
16+
Bluetooth TI Controller on ZEPHYR OS.
17+
default y
18+
19+
config BT_LL_HEAP_SIZE
20+
hex "LL Heap memory pool size (in bytes)"
21+
default 0x1800
22+
23+
config BT_HCI_ACL_FLOW_CONTROL
24+
default n
25+
26+
endif # BT
27+
28+
config BT_HCI_ACL_FLOW_CONTROL
29+
default n
30+
31+
if BT_MESH
32+
33+
config BT_TINYCRYPT_ECC
34+
default y
35+
36+
config BT_LONG_WQ
37+
default y
38+
39+
config BT_BUF_EVT_RX_SIZE
40+
default 255
41+
42+
config BT_BUF_ACL_RX_SIZE
43+
default 255
44+
45+
config BT_BUF_ACL_TX_SIZE
46+
default 251
47+
48+
config BT_BUF_CMD_TX_SIZE
49+
default 255
50+
51+
config BT_PERIPHERAL_PREF_TIMEOUT
52+
default 150
53+
54+
endif # BT_MESH
55+
56+
endif # BOARD_LP_EM_CC2340R53
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright (c) 2024 Texas Instruments Incorporated
2+
# Copyright (c) 2024 BayLibre, SAS
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
config BOARD_LP_EM_CC2340R53
7+
select SOC_CC2340R53
8+
9+
config BOARD_USE_LF_XOSC
10+
bool "Use external low-frequency crystal"
11+
default y

boards/ti/lp_em_cc2340r53/board.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Copyright (c) 2024 Texas Instruments Incorporated
2+
# Copyright (c) 2024 BayLibre, SAS
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
board_runner_args(jlink "--device=CC2340R53")
7+
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

boards/ti/lp_em_cc2340r53/board.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
board:
2+
name: lp_em_cc2340r53
3+
vendor: ti
4+
socs:
5+
- name: cc2340r53
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright (c) 2024 Texas Instruments Incorporated
3+
* Copyright (c) 2024 BayLibre, SAS
4+
*
5+
* SPDX-License-Identifier: Apache-2.0
6+
*/
7+
8+
/ {
9+
boosterpack_header: connector {
10+
compatible = "ti,boosterpack-header";
11+
#gpio-cells = <2>;
12+
gpio-map = <3 0 &gpio0 22 0>,
13+
<4 0 &gpio0 20 0>,
14+
<7 0 &gpio0 18 0>,
15+
<8 0 &gpio0 3 0>,
16+
<9 0 &gpio0 24 0>,
17+
<10 0 &gpio0 0 0>,
18+
19+
<12 0 &gpio0 9 0>,
20+
<13 0 &gpio0 10 0>,
21+
<14 0 &gpio0 12 0>,
22+
<15 0 &gpio0 13 0>,
23+
<17 0 &gpio0 19 0>,
24+
<18 0 &gpio0 11 0>,
25+
26+
<23 0 &gpio0 23 0>,
27+
<24 0 &gpio0 25 0>,
28+
<25 0 &gpio0 1 0>,
29+
<26 0 &gpio0 2 0>,
30+
<27 0 &gpio0 5 0>,
31+
<28 0 &gpio0 7 0>,
32+
33+
<36 0 &gpio0 8 0>,
34+
<37 0 &gpio0 21 0>,
35+
<38 0 &gpio0 6 0>,
36+
<39 0 &gpio0 14 0>,
37+
<40 0 &gpio0 15 0>;
38+
};
39+
};
Loading

0 commit comments

Comments
 (0)