Skip to content

Commit 21dd417

Browse files
committed
main/boards: Add support for M5Stack Tab5.
1 parent beffb36 commit 21dd417

File tree

10 files changed

+4241
-30
lines changed

10 files changed

+4241
-30
lines changed

main/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ elseif(CONFIG_BOARD_TYPE_MAGICLICK_C3_V2)
7777
set(BOARD_TYPE "magiclick-c3-v2")
7878
elseif(CONFIG_BOARD_TYPE_M5STACK_CORE_S3)
7979
set(BOARD_TYPE "m5stack-core-s3")
80+
elseif(CONFIG_BOARD_TYPE_M5STACK_CORE_TAB5)
81+
set(BOARD_TYPE "m5stack-tab5")
8082
elseif(CONFIG_BOARD_TYPE_ATOMS3_ECHO_BASE)
8183
set(BOARD_TYPE "atoms3-echo-base")
8284
elseif(CONFIG_BOARD_TYPE_ATOMS3R_ECHO_BASE)

main/Kconfig.projbuild

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ choice BOARD_TYPE
7474
bool "神奇按钮 Magiclick_C3_v2"
7575
config BOARD_TYPE_M5STACK_CORE_S3
7676
bool "M5Stack CoreS3"
77+
config BOARD_TYPE_M5STACK_CORE_TAB5
78+
bool "M5Stack Tab5"
7779
config BOARD_TYPE_ATOMS3_ECHO_BASE
7880
bool "AtomS3 + Echo Base"
7981
config BOARD_TYPE_ATOMS3R_ECHO_BASE

main/boards/m5stack-tab5/README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# 使用说明
2+
3+
* [M5Stack Tab5 docs](https://docs.m5stack.com/zh_CN/core/Tab5)
4+
5+
## 快速体验
6+
7+
下载编译好的 [固件](通过网盘分享的文件:tab5_xiaozhi_v1_addr0.bin
8+
链接: https://pan.baidu.com/s/1dgbUQtMyVLSCSBJLHARpwQ?pwd=1234) 提取码: 1234
9+
10+
```shell
11+
esptool.py --chip esp32p4 -p /dev/ttyACM0 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 80m --flash_size 16MB 0x00 tab5_xiaozhi_v1_addr0.bin
12+
```
13+
14+
## 基础使用
15+
16+
* idf version: v5.5-dev
17+
18+
1. 设置编译目标为 esp32p4
19+
20+
```shell
21+
idf.py set-target esp32p4
22+
```
23+
24+
2. 修改配置
25+
26+
```shell
27+
cp main/boards/m5stack-tab5/sdkconfig.tab5 sdkconfig
28+
```
29+
30+
3. 编译烧录程序
31+
32+
```shell
33+
idf.py build flash monitor
34+
```
35+
36+
> [!NOTE]
37+
> 进入下载模式:长按复位按键(约 2 秒),直至内部绿色 LED 指示灯开始快速闪烁,松开按键。
38+
39+
40+
## log
41+
42+
@2025/05/17 测试问题
43+
44+
1. listening... 需要等几秒才能获取语音输入???
45+
2. 亮度调节不对
46+
3. 音量调节不对
47+
48+
## TODO

main/boards/m5stack-tab5/config.h

Lines changed: 261 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,261 @@
1+
#ifndef _BOARD_CONFIG_H_
2+
#define _BOARD_CONFIG_H_
3+
4+
#include <driver/gpio.h>
5+
6+
/* ---------------------------------------------------------------- */
7+
// Audio CODEC ES7210 + ES8311
8+
#define AUDIO_INPUT_SAMPLE_RATE 24000
9+
#define AUDIO_OUTPUT_SAMPLE_RATE 24000
10+
11+
#define AUDIO_INPUT_REFERENCE true
12+
13+
#define AUDIO_I2S_GPIO_MCLK GPIO_NUM_30
14+
#define AUDIO_I2S_GPIO_WS GPIO_NUM_29
15+
#define AUDIO_I2S_GPIO_BCLK GPIO_NUM_27
16+
#define AUDIO_I2S_GPIO_DIN GPIO_NUM_28
17+
#define AUDIO_I2S_GPIO_DOUT GPIO_NUM_26
18+
19+
#define AUDIO_CODEC_PA_PIN GPIO_NUM_NC // PI4IOE 控制
20+
#define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_31
21+
#define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_32
22+
#define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR
23+
#define AUDIO_CODEC_ES7210_ADDR ES7210_CODEC_DEFAULT_ADDR
24+
25+
#define BUILTIN_LED_GPIO GPIO_NUM_NC
26+
#define BOOT_BUTTON_GPIO GPIO_NUM_0
27+
#define VOLUME_UP_BUTTON_GPIO GPIO_NUM_NC
28+
#define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_NC
29+
30+
/* ---------------------------------------------------------------- */
31+
// 显示屏相关参数配置
32+
#define DISPLAY_WIDTH 720
33+
#define DISPLAY_HEIGHT 1280
34+
#define DISPLAY_MIRROR_X false
35+
#define DISPLAY_MIRROR_Y false
36+
#define DISPLAY_SWAP_XY false
37+
38+
#define DISPLAY_OFFSET_X 0
39+
#define DISPLAY_OFFSET_Y 0
40+
41+
#define DISPLAY_BACKLIGHT_PIN GPIO_NUM_22
42+
#define DISPLAY_BACKLIGHT_OUTPUT_INVERT true
43+
44+
#define TOUCH_INT_GPIO GPIO_NUM_23 // 触摸中断
45+
46+
const ili9881c_lcd_init_cmd_t tab5_lcd_ili9881c_specific_init_code_default[] = {
47+
// {cmd, { data }, data_size, delay}
48+
/**** CMD_Page 1 ****/
49+
{0xFF, (uint8_t[]){0x98, 0x81, 0x01}, 3, 0},
50+
{0xB7, (uint8_t[]){0x03}, 1, 0}, // set 2 lane
51+
/**** CMD_Page 3 ****/
52+
{0xFF, (uint8_t[]){0x98, 0x81, 0x03}, 3, 0},
53+
{0x01, (uint8_t[]){0x00}, 1, 0},
54+
{0x02, (uint8_t[]){0x00}, 1, 0},
55+
{0x03, (uint8_t[]){0x73}, 1, 0},
56+
{0x04, (uint8_t[]){0x00}, 1, 0},
57+
{0x05, (uint8_t[]){0x00}, 1, 0},
58+
{0x06, (uint8_t[]){0x08}, 1, 0},
59+
{0x07, (uint8_t[]){0x00}, 1, 0},
60+
{0x08, (uint8_t[]){0x00}, 1, 0},
61+
{0x09, (uint8_t[]){0x1B}, 1, 0},
62+
{0x0a, (uint8_t[]){0x01}, 1, 0},
63+
{0x0b, (uint8_t[]){0x01}, 1, 0},
64+
{0x0c, (uint8_t[]){0x0D}, 1, 0},
65+
{0x0d, (uint8_t[]){0x01}, 1, 0},
66+
{0x0e, (uint8_t[]){0x01}, 1, 0},
67+
{0x0f, (uint8_t[]){0x26}, 1, 0},
68+
{0x10, (uint8_t[]){0x26}, 1, 0},
69+
{0x11, (uint8_t[]){0x00}, 1, 0},
70+
{0x12, (uint8_t[]){0x00}, 1, 0},
71+
{0x13, (uint8_t[]){0x02}, 1, 0},
72+
{0x14, (uint8_t[]){0x00}, 1, 0},
73+
{0x15, (uint8_t[]){0x00}, 1, 0},
74+
{0x16, (uint8_t[]){0x00}, 1, 0},
75+
{0x17, (uint8_t[]){0x00}, 1, 0},
76+
{0x18, (uint8_t[]){0x00}, 1, 0},
77+
{0x19, (uint8_t[]){0x00}, 1, 0},
78+
{0x1a, (uint8_t[]){0x00}, 1, 0},
79+
{0x1b, (uint8_t[]){0x00}, 1, 0},
80+
{0x1c, (uint8_t[]){0x00}, 1, 0},
81+
{0x1d, (uint8_t[]){0x00}, 1, 0},
82+
{0x1e, (uint8_t[]){0x40}, 1, 0},
83+
{0x1f, (uint8_t[]){0x00}, 1, 0},
84+
{0x20, (uint8_t[]){0x06}, 1, 0},
85+
{0x21, (uint8_t[]){0x01}, 1, 0},
86+
{0x22, (uint8_t[]){0x00}, 1, 0},
87+
{0x23, (uint8_t[]){0x00}, 1, 0},
88+
{0x24, (uint8_t[]){0x00}, 1, 0},
89+
{0x25, (uint8_t[]){0x00}, 1, 0},
90+
{0x26, (uint8_t[]){0x00}, 1, 0},
91+
{0x27, (uint8_t[]){0x00}, 1, 0},
92+
{0x28, (uint8_t[]){0x33}, 1, 0},
93+
{0x29, (uint8_t[]){0x03}, 1, 0},
94+
{0x2a, (uint8_t[]){0x00}, 1, 0},
95+
{0x2b, (uint8_t[]){0x00}, 1, 0},
96+
{0x2c, (uint8_t[]){0x00}, 1, 0},
97+
{0x2d, (uint8_t[]){0x00}, 1, 0},
98+
{0x2e, (uint8_t[]){0x00}, 1, 0},
99+
{0x2f, (uint8_t[]){0x00}, 1, 0},
100+
{0x30, (uint8_t[]){0x00}, 1, 0},
101+
{0x31, (uint8_t[]){0x00}, 1, 0},
102+
{0x32, (uint8_t[]){0x00}, 1, 0},
103+
{0x33, (uint8_t[]){0x00}, 1, 0},
104+
{0x34, (uint8_t[]){0x00}, 1, 0},
105+
{0x35, (uint8_t[]){0x00}, 1, 0},
106+
{0x36, (uint8_t[]){0x00}, 1, 0},
107+
{0x37, (uint8_t[]){0x00}, 1, 0},
108+
{0x38, (uint8_t[]){0x00}, 1, 0},
109+
{0x39, (uint8_t[]){0x00}, 1, 0},
110+
{0x3a, (uint8_t[]){0x00}, 1, 0},
111+
{0x3b, (uint8_t[]){0x00}, 1, 0},
112+
{0x3c, (uint8_t[]){0x00}, 1, 0},
113+
{0x3d, (uint8_t[]){0x00}, 1, 0},
114+
{0x3e, (uint8_t[]){0x00}, 1, 0},
115+
{0x3f, (uint8_t[]){0x00}, 1, 0},
116+
{0x40, (uint8_t[]){0x00}, 1, 0},
117+
{0x41, (uint8_t[]){0x00}, 1, 0},
118+
{0x42, (uint8_t[]){0x00}, 1, 0},
119+
{0x43, (uint8_t[]){0x00}, 1, 0},
120+
{0x44, (uint8_t[]){0x00}, 1, 0},
121+
122+
{0x50, (uint8_t[]){0x01}, 1, 0},
123+
{0x51, (uint8_t[]){0x23}, 1, 0},
124+
{0x52, (uint8_t[]){0x45}, 1, 0},
125+
{0x53, (uint8_t[]){0x67}, 1, 0},
126+
{0x54, (uint8_t[]){0x89}, 1, 0},
127+
{0x55, (uint8_t[]){0xab}, 1, 0},
128+
{0x56, (uint8_t[]){0x01}, 1, 0},
129+
{0x57, (uint8_t[]){0x23}, 1, 0},
130+
{0x58, (uint8_t[]){0x45}, 1, 0},
131+
{0x59, (uint8_t[]){0x67}, 1, 0},
132+
{0x5a, (uint8_t[]){0x89}, 1, 0},
133+
{0x5b, (uint8_t[]){0xab}, 1, 0},
134+
{0x5c, (uint8_t[]){0xcd}, 1, 0},
135+
{0x5d, (uint8_t[]){0xef}, 1, 0},
136+
137+
{0x5e, (uint8_t[]){0x11}, 1, 0},
138+
{0x5f, (uint8_t[]){0x02}, 1, 0},
139+
{0x60, (uint8_t[]){0x00}, 1, 0},
140+
{0x61, (uint8_t[]){0x07}, 1, 0},
141+
{0x62, (uint8_t[]){0x06}, 1, 0},
142+
{0x63, (uint8_t[]){0x0E}, 1, 0},
143+
{0x64, (uint8_t[]){0x0F}, 1, 0},
144+
{0x65, (uint8_t[]){0x0C}, 1, 0},
145+
{0x66, (uint8_t[]){0x0D}, 1, 0},
146+
{0x67, (uint8_t[]){0x02}, 1, 0},
147+
{0x68, (uint8_t[]){0x02}, 1, 0},
148+
{0x69, (uint8_t[]){0x02}, 1, 0},
149+
{0x6a, (uint8_t[]){0x02}, 1, 0},
150+
{0x6b, (uint8_t[]){0x02}, 1, 0},
151+
{0x6c, (uint8_t[]){0x02}, 1, 0},
152+
{0x6d, (uint8_t[]){0x02}, 1, 0},
153+
{0x6e, (uint8_t[]){0x02}, 1, 0},
154+
{0x6f, (uint8_t[]){0x02}, 1, 0},
155+
{0x70, (uint8_t[]){0x02}, 1, 0},
156+
{0x71, (uint8_t[]){0x02}, 1, 0},
157+
{0x72, (uint8_t[]){0x02}, 1, 0},
158+
{0x73, (uint8_t[]){0x05}, 1, 0},
159+
{0x74, (uint8_t[]){0x01}, 1, 0},
160+
{0x75, (uint8_t[]){0x02}, 1, 0},
161+
{0x76, (uint8_t[]){0x00}, 1, 0},
162+
{0x77, (uint8_t[]){0x07}, 1, 0},
163+
{0x78, (uint8_t[]){0x06}, 1, 0},
164+
{0x79, (uint8_t[]){0x0E}, 1, 0},
165+
{0x7a, (uint8_t[]){0x0F}, 1, 0},
166+
{0x7b, (uint8_t[]){0x0C}, 1, 0},
167+
{0x7c, (uint8_t[]){0x0D}, 1, 0},
168+
{0x7d, (uint8_t[]){0x02}, 1, 0},
169+
{0x7e, (uint8_t[]){0x02}, 1, 0},
170+
{0x7f, (uint8_t[]){0x02}, 1, 0},
171+
{0x80, (uint8_t[]){0x02}, 1, 0},
172+
{0x81, (uint8_t[]){0x02}, 1, 0},
173+
{0x82, (uint8_t[]){0x02}, 1, 0},
174+
{0x83, (uint8_t[]){0x02}, 1, 0},
175+
{0x84, (uint8_t[]){0x02}, 1, 0},
176+
{0x85, (uint8_t[]){0x02}, 1, 0},
177+
{0x86, (uint8_t[]){0x02}, 1, 0},
178+
{0x87, (uint8_t[]){0x02}, 1, 0},
179+
{0x88, (uint8_t[]){0x02}, 1, 0},
180+
{0x89, (uint8_t[]){0x05}, 1, 0},
181+
{0x8A, (uint8_t[]){0x01}, 1, 0},
182+
183+
/**** CMD_Page 4 ****/
184+
{0xFF, (uint8_t[]){0x98, 0x81, 0x04}, 3, 0},
185+
{0x38, (uint8_t[]){0x01}, 1, 0},
186+
{0x39, (uint8_t[]){0x00}, 1, 0},
187+
{0x6C, (uint8_t[]){0x15}, 1, 0},
188+
{0x6E, (uint8_t[]){0x1A}, 1, 0},
189+
{0x6F, (uint8_t[]){0x25}, 1, 0},
190+
{0x3A, (uint8_t[]){0xA4}, 1, 0},
191+
{0x8D, (uint8_t[]){0x20}, 1, 0},
192+
{0x87, (uint8_t[]){0xBA}, 1, 0},
193+
{0x3B, (uint8_t[]){0x98}, 1, 0},
194+
195+
/**** CMD_Page 1 ****/
196+
{0xFF, (uint8_t[]){0x98, 0x81, 0x01}, 3, 0},
197+
{0x22, (uint8_t[]){0x0A}, 1, 0},
198+
{0x31, (uint8_t[]){0x00}, 1, 0},
199+
{0x50, (uint8_t[]){0x6B}, 1, 0},
200+
{0x51, (uint8_t[]){0x66}, 1, 0},
201+
{0x53, (uint8_t[]){0x73}, 1, 0},
202+
{0x55, (uint8_t[]){0x8B}, 1, 0},
203+
{0x60, (uint8_t[]){0x1B}, 1, 0},
204+
{0x61, (uint8_t[]){0x01}, 1, 0},
205+
{0x62, (uint8_t[]){0x0C}, 1, 0},
206+
{0x63, (uint8_t[]){0x00}, 1, 0},
207+
208+
// Gamma P
209+
{0xA0, (uint8_t[]){0x00}, 1, 0},
210+
{0xA1, (uint8_t[]){0x15}, 1, 0},
211+
{0xA2, (uint8_t[]){0x1F}, 1, 0},
212+
{0xA3, (uint8_t[]){0x13}, 1, 0},
213+
{0xA4, (uint8_t[]){0x11}, 1, 0},
214+
{0xA5, (uint8_t[]){0x21}, 1, 0},
215+
{0xA6, (uint8_t[]){0x17}, 1, 0},
216+
{0xA7, (uint8_t[]){0x1B}, 1, 0},
217+
{0xA8, (uint8_t[]){0x6B}, 1, 0},
218+
{0xA9, (uint8_t[]){0x1E}, 1, 0},
219+
{0xAA, (uint8_t[]){0x2B}, 1, 0},
220+
{0xAB, (uint8_t[]){0x5D}, 1, 0},
221+
{0xAC, (uint8_t[]){0x19}, 1, 0},
222+
{0xAD, (uint8_t[]){0x14}, 1, 0},
223+
{0xAE, (uint8_t[]){0x4B}, 1, 0},
224+
{0xAF, (uint8_t[]){0x1D}, 1, 0},
225+
{0xB0, (uint8_t[]){0x27}, 1, 0},
226+
{0xB1, (uint8_t[]){0x49}, 1, 0},
227+
{0xB2, (uint8_t[]){0x5D}, 1, 0},
228+
{0xB3, (uint8_t[]){0x39}, 1, 0},
229+
230+
// Gamma N
231+
{0xC0, (uint8_t[]){0x00}, 1, 0},
232+
{0xC1, (uint8_t[]){0x01}, 1, 0},
233+
{0xC2, (uint8_t[]){0x0C}, 1, 0},
234+
{0xC3, (uint8_t[]){0x11}, 1, 0},
235+
{0xC4, (uint8_t[]){0x15}, 1, 0},
236+
{0xC5, (uint8_t[]){0x28}, 1, 0},
237+
{0xC6, (uint8_t[]){0x1B}, 1, 0},
238+
{0xC7, (uint8_t[]){0x1C}, 1, 0},
239+
{0xC8, (uint8_t[]){0x62}, 1, 0},
240+
{0xC9, (uint8_t[]){0x1C}, 1, 0},
241+
{0xCA, (uint8_t[]){0x29}, 1, 0},
242+
{0xCB, (uint8_t[]){0x60}, 1, 0},
243+
{0xCC, (uint8_t[]){0x16}, 1, 0},
244+
{0xCD, (uint8_t[]){0x17}, 1, 0},
245+
{0xCE, (uint8_t[]){0x4A}, 1, 0},
246+
{0xCF, (uint8_t[]){0x23}, 1, 0},
247+
{0xD0, (uint8_t[]){0x24}, 1, 0},
248+
{0xD1, (uint8_t[]){0x4F}, 1, 0},
249+
{0xD2, (uint8_t[]){0x5F}, 1, 0},
250+
{0xD3, (uint8_t[]){0x39}, 1, 0},
251+
252+
/**** CMD_Page 0 ****/
253+
{0xFF, (uint8_t[]){0x98, 0x81, 0x00}, 3, 0},
254+
{0x35, (uint8_t[]){0x00}, 0, 0},
255+
// {0x11, (uint8_t []){0x00}, 0},
256+
{0xFE, (uint8_t[]){0x00}, 0, 0},
257+
{0x29, (uint8_t[]){0x00}, 0, 0},
258+
//============ Gamma END===========
259+
};
260+
261+
#endif // _BOARD_CONFIG_H_
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"target": "esp32p4",
3+
"builds": [
4+
{
5+
"name": "m5stack-tab5",
6+
"sdkconfig_append": []
7+
}
8+
]
9+
}

0 commit comments

Comments
 (0)