Skip to content

Commit 54dec4e

Browse files
sylvioalvesnordicjm
authored andcommitted
boards: xtensa: m5stack_core2: Convert to v2
Converts the board to hwmv2 Signed-off-by: Sylvio Alves <[email protected]>
1 parent ddcbde2 commit 54dec4e

17 files changed

+131
-23
lines changed

boards/m5stack/m5stack_core2/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_M5STACK_CORE2
5+
select SOC_ESP32_PROCPU if BOARD_M5STACK_CORE2_ESP32_PROCPU
6+
select SOC_ESP32_APPCPU if BOARD_M5STACK_CORE2_ESP32_APPCPU

boards/boards_legacy/xtensa/m5stack_core2/Kconfig.defconfig renamed to boards/m5stack/m5stack_core2/Kconfig.defconfig

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,7 @@
33
# Copyright (c) 2023 Martin Kiepfer <[email protected]>
44
# SPDX-License-Identifier: Apache-2.0
55

6-
if BOARD_M5STACK_CORE2
7-
8-
config BOARD
9-
default "m5stack_core2"
10-
depends on BOARD_M5STACK_CORE2
11-
12-
config ENTROPY_GENERATOR
13-
default y
6+
if BOARD_M5STACK_CORE2_ESP32_PROCPU
147

158
config HEAP_MEM_POOL_ADD_SIZE_BOARD
169
int
@@ -50,4 +43,11 @@ config MIPI_DBI_INIT_PRIORITY
5043

5144
endif # MIPI_DBI
5245

53-
endif # BOARD_M5STACK_CORE2
46+
endif # BOARD_M5STACK_CORE2_ESP32_PROCPU
47+
48+
if BOARD_M5STACK_CORE2_ESP32_APPCPU
49+
50+
config HEAP_MEM_POOL_ADD_SIZE_BOARD
51+
default 256
52+
53+
endif # BOARD_M5STACK_CORE2_ESP32_APPCPU

boards/boards_legacy/xtensa/m5stack_core2/Kconfig.board renamed to boards/m5stack/m5stack_core2/Kconfig.m5stack_core2

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,4 @@
44
# SPDX-License-Identifier: Apache-2.0
55

66
config BOARD_M5STACK_CORE2
7-
bool "M5Stack Core2 Development Board"
8-
depends on SOC_SERIES_ESP32
9-
10-
choice SOC_PART_NUMBER
11-
default SOC_ESP32_D0WD_V3
12-
endchoice
7+
select SOC_ESP32_D0WD_V3
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
board:
2+
name: m5stack_core2
3+
vendor: m5stack
4+
socs:
5+
- name: esp32

boards/boards_legacy/xtensa/m5stack_core2/doc/index.rst renamed to boards/m5stack/m5stack_core2/doc/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ Build and flash applications as usual (see :ref:`build_an_application` and
152152

153153
.. zephyr-app-commands::
154154
:zephyr-app: samples/hello_world
155-
:board: m5stack_core2
155+
:board: m5stack_core2/esp32/procpu
156156
:goals: build
157157

158158
The usual ``flash`` target will work with the ``m5stack_core2`` board
@@ -161,7 +161,7 @@ application.
161161

162162
.. zephyr-app-commands::
163163
:zephyr-app: samples/hello_world
164-
:board: m5stack_core2
164+
:board: m5stack_core2/esp32/procpu
165165
:goals: flash
166166

167167
The baud rate of 921600bps is set by default. If experiencing issues when flashing,
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/*
2+
* Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
/dts-v1/;
7+
8+
#include <espressif/esp32/esp32_appcpu.dtsi>
9+
10+
/ {
11+
model = "M5Stack Core2 APPCPU";
12+
compatible = "espressif,esp32";
13+
14+
chosen {
15+
zephyr,sram = &sram0;
16+
zephyr,ipc_shm = &shm0;
17+
zephyr,ipc = &ipm0;
18+
};
19+
};
20+
21+
&cpu0 {
22+
clock-frequency = <ESP32_CLK_CPU_240M>;
23+
};
24+
25+
&cpu1 {
26+
clock-frequency = <ESP32_CLK_CPU_240M>;
27+
};
28+
29+
&ipm0 {
30+
status = "okay";
31+
};
32+
33+
&trng0 {
34+
status = "okay";
35+
};
36+
37+
&flash0 {
38+
status = "okay";
39+
partitions {
40+
compatible = "fixed-partitions";
41+
#address-cells = <1>;
42+
#size-cells = <1>;
43+
44+
/* Reserve 60kB for the bootloader */
45+
boot_partition: partition@1000 {
46+
label = "mcuboot";
47+
reg = <0x00001000 0x0000F000>;
48+
read-only;
49+
};
50+
51+
/* Reserve 1024kB for the application in slot 0 */
52+
slot0_partition: partition@10000 {
53+
label = "image-0";
54+
reg = <0x00010000 0x00100000>;
55+
};
56+
57+
/* Reserve 1024kB for the application in slot 1 */
58+
slot1_partition: partition@110000 {
59+
label = "image-1";
60+
reg = <0x00110000 0x00100000>;
61+
};
62+
63+
/* Reserve 256kB for the scratch partition */
64+
scratch_partition: partition@210000 {
65+
label = "image-scratch";
66+
reg = <0x00210000 0x00040000>;
67+
};
68+
69+
storage_partition: partition@250000 {
70+
label = "storage";
71+
reg = <0x00250000 0x00006000>;
72+
};
73+
};
74+
};

0 commit comments

Comments
 (0)