Skip to content

Commit 383509e

Browse files
committed
[bsp]add bsp essemi/es8p508x.
1 parent 96fd9a5 commit 383509e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+17276
-0
lines changed

bsp/essemi/es8p508x/.config

Lines changed: 405 additions & 0 deletions
Large diffs are not rendered by default.

bsp/essemi/es8p508x/Kconfig

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
mainmenu "RT-Thread Configuration"
2+
3+
config BSP_DIR
4+
string
5+
option env="BSP_ROOT"
6+
default "."
7+
8+
config RTT_DIR
9+
string
10+
option env="RTT_ROOT"
11+
default "../../.."
12+
13+
config PKGS_DIR
14+
string
15+
option env="PKGS_ROOT"
16+
default "packages"
17+
18+
source "$RTT_DIR/Kconfig"
19+
source "$PKGS_DIR/Kconfig"
20+
21+
config SOC_ES8P508x
22+
bool
23+
select RT_USING_COMPONENTS_INIT
24+
select RT_USING_USER_MAIN
25+
default y
26+
27+
source "drivers/Kconfig"

bsp/essemi/es8p508x/README.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# HRSDK-GDB-ES8P508 开发板 BSP 说明
2+
标签: EastSoft、国产MCU、Cortex-M0、ES8P5088FLLQ
3+
4+
## 1. 简介
5+
6+
本文档为上海东软载波微电子开发团队为 HRSDK-GDB-ES8P508 开发板提供的 BSP (板级支持包) 说明。
7+
通过阅读本文档,开发者可以快速地上手该 BSP,将 RT-Thread 运行在开发板上。
8+
9+
### 1.1 开发板介绍
10+
11+
主要内容如下:
12+
HRSDK-GDB-ES8P508x 是东软载波微电子官方推出的一款基于 ARM Cortex-M0 内核的开发板,最高主频为 48MHz,可满足基础功能测试及高端功能扩展等开发需求。
13+
14+
开发板外观如下图所示:
15+
16+
HRSDK-GDB-ES8P508x-V1.0
17+
18+
![ES8P508](figures/HRSDK-GDB-ES8P508x-V1.0.jpg)
19+
20+
该开发板常用 **板载资源** 如下:
21+
22+
- MCU:ES8P5088FLLQ,主频 48MHz,24KB SRAM,128KB FLASH,45 GPIOs
23+
- 常用外设
24+
- LED:1个,(PA14)
25+
- 按键:1个(MRSTN)
26+
- 常用接口:GPIO、UART、SPI、I2C
27+
- 调试接口,ESLinkⅡ(EastSoft 官方推出的开发工具,有标准版和mini版两种版本,均自带 CDC 串口功能) SWD 下载
28+
29+
外设支持:
30+
31+
本 BSP 目前对外设的支持情况如下:
32+
33+
| **片上外设** | **支持情况** | **备注** |
34+
| :---------------- | :----------: | :-----------------------------------|
35+
| GPIO | 支持 | 45 GPIOs |
36+
| UART | 支持 | UART0/1/2/3/4/5 |
37+
38+
39+
更多详细信息请咨询[上海东软载波微电子技术支持](http://www.essemi.com/)
40+
41+
## 2. 快速上手
42+
43+
本 BSP 为开发者提供 MDK4 工程。下面以 MDK4 开发环境为例,介绍如何将系统运行起来。
44+
45+
### 硬件连接
46+
47+
使用 ESLinkⅡ (自带 CDC 串口)或 Jlink 等调试工具连接开发板到 PC,拨动开关选择使用调试工具供电或使用外部电源供电。若使用 Jlink 等调试工具,还需要将 UART5_TX(PB13)、UART5_RX(PB12)、GND 接到串口工具上。
48+
49+
使用ESlinkⅡ(mini)连接开发板如下图所示:
50+
51+
ESLinkⅡ(mini) + HRSDK-GDB-ES8P508-V1.0
52+
53+
![ESLinkII](figures/ESLinkII-mini.jpg)
54+
55+
### 编译下载
56+
57+
双击 project.uvprojx 文件,打开 MDK4 工程,工程默认配置使用 JLink 下载程序,在通过 JLink 连接开发板的基础上,点击下载按钮即可下载程序到开发板,如果使用 ESLinkⅡ,则选择 "CMSIS-DAP Debugger",连接正常后即可编译并下载程序到开发板。
58+
59+
### 运行结果
60+
61+
下载程序成功之后,系统会自动运行,观察串口输出的信息,同时开发板LED闪烁。
62+
63+
```bash
64+
\ | /
65+
- RT - Thread Operating System
66+
/ | \ 4.0.2 build Jul 12 2019
67+
2006 - 2019 Copyright by rt-thread team
68+
msh />
69+
```
70+
## 3. 进阶使用
71+
72+
此 BSP 默认只开启了 GPIO 和 uart5 的功能,如果需使用 SPI 等更多高级功能,需要利用 ENV 工具对 BSP 进行配置,步骤如下:
73+
74+
1. 在 bsp 下打开 env 工具。
75+
76+
2. 输入`menuconfig`命令配置工程,配置好之后保存退出。
77+
78+
3. 输入`pkgs --update`命令更新软件包。
79+
80+
4. 输入`scons --target=MDK4` 命令重新生成工程。
81+
82+
更多 Env 工具的详细介绍请参考 [RT-Thread 文档中心](https://www.rt-thread.org/document/site/)
83+
84+
## 4. 联系人信息
85+
86+
- [wangyongquan](https://github.com/wangyq2018)
87+
88+
## 5. 参考
89+
90+
- [ EastSoft 官网](http://www.essemi.com)
91+

bsp/essemi/es8p508x/SConscript

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# for module compiling
2+
import os
3+
Import('RTT_ROOT')
4+
5+
objs = []
6+
cwd = str(Dir('#'))
7+
list = os.listdir(cwd)
8+
9+
for d in list:
10+
path = os.path.join(cwd, d)
11+
if os.path.isfile(os.path.join(path, 'SConscript')):
12+
objs = objs + SConscript(os.path.join(d, 'SConscript'))
13+
14+
Return('objs')

bsp/essemi/es8p508x/SConstruct

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import os
2+
import sys
3+
import rtconfig
4+
5+
if os.getenv('RTT_ROOT'):
6+
RTT_ROOT = os.getenv('RTT_ROOT')
7+
else:
8+
RTT_ROOT = os.path.normpath(os.getcwd() + '/../../..')
9+
10+
sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
11+
try:
12+
from building import *
13+
except:
14+
print('Cannot found RT-Thread root directory, please check RTT_ROOT')
15+
print(RTT_ROOT)
16+
exit(-1)
17+
18+
TARGET = 'rtthread.' + rtconfig.TARGET_EXT
19+
20+
env = Environment(tools = ['mingw'],
21+
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
22+
CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,
23+
AR = rtconfig.AR, ARFLAGS = '-rc',
24+
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
25+
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
26+
27+
if rtconfig.PLATFORM == 'iar':
28+
env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES'])
29+
env.Replace(ARFLAGS = [''])
30+
env.Replace(LINKCOM = env["LINKCOM"] + ' --map project.map')
31+
32+
Export('RTT_ROOT')
33+
Export('rtconfig')
34+
35+
# prepare building environment
36+
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
37+
38+
# make a building
39+
DoBuilding(TARGET, objs)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Import('RTT_ROOT')
2+
Import('rtconfig')
3+
from building import *
4+
5+
cwd = os.path.join(str(Dir('#')), 'applications')
6+
src = Glob('*.c')
7+
8+
CPPPATH = [cwd, str(Dir('#'))]
9+
group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH)
10+
11+
Return('group')
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright (C) 2018 Shanghai Eastsoft Microelectronics Co., Ltd.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Change Logs:
7+
* Date Author Notes
8+
* 2019-07-12 wangyq the first version
9+
*/
10+
11+
#include <rtthread.h>
12+
#include <rtdevice.h>
13+
#include <lib_wdt.h>
14+
15+
#define LED_PIN 29
16+
17+
int main(void)
18+
{
19+
int count = 1;
20+
21+
/* set PA14 pin mode to output */
22+
rt_pin_mode(LED_PIN, PIN_MODE_OUTPUT);
23+
24+
while (count++)
25+
{
26+
rt_pin_write(LED_PIN, PIN_HIGH);
27+
rt_thread_mdelay(500);
28+
rt_pin_write(LED_PIN, PIN_LOW);
29+
rt_thread_mdelay(500);
30+
}
31+
32+
return RT_EOK;
33+
}
34+
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
menu "Hardware Drivers Config"
2+
3+
menu "On-chip Peripheral Drivers"
4+
config BSP_USING_GPIO
5+
bool "Enable GPIO"
6+
select RT_USING_PIN
7+
default y
8+
9+
menu "UART Drivers"
10+
config BSP_USING_UART0
11+
bool "Enable UART0 PB00/PB01(R/T)"
12+
select RT_USING_SERIAL
13+
default n
14+
15+
config BSP_USING_UART1
16+
bool "Enable UART1 PA18/PA17(R/T)"
17+
select RT_USING_SERIAL
18+
default n
19+
20+
config BSP_USING_UART2
21+
bool "Enable UART2 PA04/PA05(R/T)"
22+
select RT_USING_SERIAL
23+
default n
24+
25+
config BSP_USING_UART3
26+
bool "Enable UART3 PA30/PA29(R/T)"
27+
select RT_USING_SERIAL
28+
default n
29+
30+
config BSP_USING_UART4
31+
bool "Enable UART4 PB10/PB11(R/T)"
32+
select RT_USING_SERIAL
33+
default n
34+
35+
config BSP_USING_UART5
36+
bool "Enable UART5 PB12/PB13(R/T)"
37+
select RT_USING_SERIAL
38+
default y
39+
endmenu
40+
41+
endmenu
42+
43+
menu "Onboard Peripheral Drivers"
44+
45+
endmenu
46+
47+
menu "Offboard Peripheral Drivers"
48+
49+
endmenu
50+
51+
endmenu
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from building import *
2+
3+
cwd = GetCurrentDir()
4+
5+
# add the general drivers.
6+
src = Split('''
7+
board.c
8+
''')
9+
10+
# add gpio code
11+
if GetDepend('RT_USING_PIN'):
12+
src += ['drv_gpio.c']
13+
14+
# add serial driver code
15+
if GetDepend('BSP_USING_UART0') or GetDepend('BSP_USING_UART1') or GetDepend('BSP_USING_UART2') or GetDepend('BSP_USING_UART3') or GetDepend('BSP_USING_UART4') or GetDepend('BSP_USING_UART5'):
16+
src += ['drv_uart.c']
17+
18+
CPPPATH = [cwd]
19+
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH)
20+
21+
Return('group')

0 commit comments

Comments
 (0)