Skip to content

Commit 62acc5c

Browse files
authored
Merge pull request #4971 from ze9hyr/acm32f030
add acm32f030 bsp
2 parents 1066eca + 7d8cfef commit 62acc5c

Some content is hidden

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

98 files changed

+31096
-3131
lines changed

.github/workflows/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
fail-fast: false
3030
matrix:
3131
legs:
32+
- {RTT_BSP: "acm32f0x0-nucleo", RTT_TOOL_CHAIN: "sourcery-arm"}
3233
- {RTT_BSP: "CME_M7", RTT_TOOL_CHAIN: "sourcery-arm"}
3334
- {RTT_BSP: "apollo2", RTT_TOOL_CHAIN: "sourcery-arm"}
3435
- {RTT_BSP: "asm9260t", RTT_TOOL_CHAIN: "sourcery-arm"}

bsp/Copyright_Notice.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ The peripheral library or firmware library of the chip manufacturer is authorize
1010

1111
## BSP's License and Coyright:
1212

13+
### acm32f0x0-nucleo
14+
15+
License: bsd-new
16+
17+
Copyright: Copyright (c) 2021, AisinoChip
18+
19+
Path:
20+
21+
- bsp/acm32f0x0-nucleo/libraries
22+
1323
### apollo2
1424

1525
License: bsd-new
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# files format check exclude path, please follow the instructions below to modify;
2+
# If you need to exclude an entire folder, add the folder path in dir_path;
3+
# If you need to exclude a file, add the path to the file in file_path.
4+
5+
dir_path:
6+
- libraries

bsp/acm32f0x0-nucleo/Kconfig

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
mainmenu "RT-Thread Project 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_SERIES_ACM32F0
22+
bool
23+
select ARCH_ARM_CORTEX_M0
24+
default y
25+
26+
source "$BSP_DIR/drivers/Kconfig"
27+

bsp/acm32f0x0-nucleo/README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# acm32f0x0板级支持包
2+
3+
## 1. 简介
4+
5+
ACM32F0x0芯片是上海爱信诺航芯电子科技有限公司(后续简称上海航芯)一系列支持多种低功耗模式的通用MCU。包括如下硬件特性:
6+
7+
|--------------------------|--------------------|
8+
| 硬件 | 描述 |
9+
| -------------------------|--------------------|
10+
|芯片型号 | ACM32F0X0系列 |
11+
|CPU | ARM Cortex-M0 |
12+
|主频 | 64MHz |
13+
|片内SRAM | 32K |
14+
|片内Flash | 128K |
15+
|--------------------------|--------------------|
16+
17+
具体型号及资源请参考上海航芯官方网站[ACM32F0](www.aisinochip.com/index.php/product/child1/id/217.html)
18+
19+
## 2. 编译说明
20+
21+
推荐使用[env工具][1],可以在console下进入到`bsp/acm32f0x0-nucleo`目录中,运行以下命令:
22+
23+
`scons`
24+
25+
来编译这个板级支持包。如果编译正确无误,会产生rtthread.elf、rtthread.bin文件。其中rtthread.bin需要烧写到设备中进行运行。
26+
27+
也可以通过`scons --target=iar``scons --target=mdk5`生成IAR或是keil工程,再使用相应的工具进行编译。
28+
29+
## 3. 烧写及执行
30+
31+
开发板的使用请参考上海航芯官方网站相应型号的[开发工具](www.aisinochip.com/index.php/product/detail/id/25.html)
32+
33+
### 3.1 运行结果
34+
35+
如果编译 & 烧写无误,当复位设备后,会在串口上看到RT-Thread的启动logo信息:
36+
37+
## 4. 驱动支持情况及计划
38+
39+
| **片上外设** | **支持情况** | **备注** |
40+
| ------------- | ------------ | ------------------------------------- |
41+
| GPIO | 支持 | PA0, PA1... PD15 ---> PIN: 0, 1...63 |
42+
| UART | 支持 | UART1/UART2 |
43+
| LED | 支持 | LED1 |
44+
| WDT | 支持 | WDT/IWDT |
45+
| ADC | 支持 | |
46+
47+
## 5. 联系人信息
48+
49+
维护人:AisinoChip < [email protected] >
50+
51+
## 6. 参考
52+
53+
* 板子[数据手册][2]
54+
* 芯片[数据手册][3]
55+
56+
[1]: https://www.rt-thread.org/page/download.html
57+
[2]: www.aisinochip.com/index.php/product/detail/id/32.html
58+
[3]: www.aisinochip.com/index.php/product/detail/id/32.html

bsp/acm32f0x0-nucleo/SConscript

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# for module compiling
2+
import os
3+
from building import *
4+
5+
cwd = GetCurrentDir()
6+
objs = []
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')
15+

bsp/acm32f0x0-nucleo/SConstruct

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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+
DefaultEnvironment(tools=[])
21+
env = Environment(tools = ['mingw'],
22+
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
23+
CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,
24+
AR = rtconfig.AR, ARFLAGS = '-rc',
25+
CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS,
26+
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
27+
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
28+
29+
if rtconfig.PLATFORM == 'iar':
30+
env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES'])
31+
env.Replace(ARFLAGS = [''])
32+
env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map')
33+
34+
Export('RTT_ROOT')
35+
Export('rtconfig')
36+
37+
SDK_ROOT = os.path.abspath('./')
38+
39+
if os.path.exists(SDK_ROOT + '/libraries'):
40+
libraries_path_prefix = SDK_ROOT + '/libraries'
41+
else:
42+
libraries_path_prefix = os.path.dirname(SDK_ROOT) + '/libraries'
43+
44+
SDK_LIB = libraries_path_prefix
45+
Export('SDK_LIB')
46+
47+
# prepare building environment
48+
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
49+
50+
# make a building
51+
DoBuilding(TARGET, objs)
52+
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+
CPPPATH = [cwd, str(Dir('#'))]
8+
9+
group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH)
10+
11+
Return('group')
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright (c) 2006-2021, RT-Thread Development Team
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Change Logs:
7+
* Date Author Notes
8+
* 2021-08-23 AisinoChip the first version
9+
*/
10+
11+
#include <rthw.h>
12+
#include <rtthread.h>
13+
#include "board.h"
14+
#include <drivers/pin.h>
15+
16+
#define LED_PIN_NUM 1 /* PA1 */
17+
18+
int main(void)
19+
{
20+
rt_pin_mode(LED_PIN_NUM, PIN_MODE_OUTPUT);
21+
22+
while(1)
23+
{
24+
rt_pin_write(LED_PIN_NUM, PIN_LOW);
25+
rt_thread_delay(RT_TICK_PER_SECOND/2);
26+
rt_pin_write(LED_PIN_NUM, PIN_HIGH);
27+
rt_thread_delay(RT_TICK_PER_SECOND/2);
28+
}
29+
}
30+

0 commit comments

Comments
 (0)