Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
rt-thread
提交
fda55ff0
R
rt-thread
项目概览
BaiXuePrincess
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fda55ff0
编写于
9月 20, 2017
作者:
Z
zhongjiequan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify bsp nv32f100x from startup/application to main style.
上级
e9cafbeb
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
92 addition
and
200 deletion
+92
-200
bsp/nv32f100x/SConstruct
bsp/nv32f100x/SConstruct
+1
-1
bsp/nv32f100x/app/src/application.c
bsp/nv32f100x/app/src/application.c
+0
-69
bsp/nv32f100x/app/src/main.c
bsp/nv32f100x/app/src/main.c
+46
-0
bsp/nv32f100x/app/src/startup.c
bsp/nv32f100x/app/src/startup.c
+0
-116
bsp/nv32f100x/board/src/board.c
bsp/nv32f100x/board/src/board.c
+36
-0
bsp/nv32f100x/project.uvprojx
bsp/nv32f100x/project.uvprojx
+2
-7
bsp/nv32f100x/rtconfig.h
bsp/nv32f100x/rtconfig.h
+2
-0
bsp/nv32f100x/rtconfig.py
bsp/nv32f100x/rtconfig.py
+5
-7
未找到文件。
bsp/nv32f100x/SConstruct
浏览文件 @
fda55ff0
...
...
@@ -10,7 +10,7 @@ else:
sys
.
path
=
sys
.
path
+
[
os
.
path
.
join
(
RTT_ROOT
,
'tools'
)]
from
building
import
*
TARGET
=
'rtthread-
stm32f0x
x.'
+
rtconfig
.
TARGET_EXT
TARGET
=
'rtthread-
nv32f100
x.'
+
rtconfig
.
TARGET_EXT
env
=
Environment
(
tools
=
[
'mingw'
],
AS
=
rtconfig
.
AS
,
ASFLAGS
=
rtconfig
.
AFLAGS
,
...
...
bsp/nv32f100x/app/src/application.c
已删除
100644 → 0
浏览文件 @
e9cafbeb
/*
* File : application.c
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2009-01-05 Bernard the first version
* 2013-11-15 bright add init thread and components initial
* 2017-09-19 Quintin.Z modify for nv32f100xxx version and components initial
*/
/**
* @addtogroup STM32
*/
/*@{*/
#include <stdio.h>
#include <rthw.h>
#include <rtdevice.h>
#include "board.h"
#include <rtthread.h>
#ifdef RT_USING_COMPONENTS_INIT
#include <components.h>
#endif
/* RT_USING_COMPONENTS_INIT */
static
void
rt_init_thread_entry
(
void
*
parameter
)
{
extern
void
led_thread_entry
(
void
*
parameter
);
rt_thread_t
thread
;
/* Initialization RT-Thread Components */
#ifdef RT_USING_COMPONENTS_INIT
rt_components_init
();
#endif
/* Set finsh device */
#ifdef RT_USING_FINSH
finsh_set_device
(
RT_CONSOLE_DEVICE_NAME
);
#endif
/* RT_USING_FINSH */
/* Create led thread */
thread
=
rt_thread_create
(
"led"
,
led_thread_entry
,
RT_NULL
,
256
,
20
,
20
);
if
(
thread
!=
RT_NULL
)
rt_thread_startup
(
thread
);
}
int
rt_application_init
()
{
rt_thread_t
init_thread
;
init_thread
=
rt_thread_create
(
"init"
,
rt_init_thread_entry
,
RT_NULL
,
512
,
8
,
20
);
if
(
init_thread
!=
RT_NULL
)
rt_thread_startup
(
init_thread
);
return
0
;
}
/*@}*/
bsp/nv32f100x/app/src/main.c
0 → 100644
浏览文件 @
fda55ff0
/*
* File : _main.c
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2008 - 2012, RT-Thread Development Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
* 2015-11-19 Urey the first version
* 2017-09-20 Quintin.Z modify for nv32
*/
#include "rtthread.h"
#include "finsh.h"
extern
void
led_thread_entry
(
void
*
parameter
);
int
main
(
void
)
{
rt_thread_t
thread
;
#ifdef RT_USING_FINSH
finsh_set_device
(
RT_CONSOLE_DEVICE_NAME
);
#endif
/* Create led thread */
thread
=
rt_thread_create
(
"led"
,
led_thread_entry
,
RT_NULL
,
256
,
20
,
20
);
if
(
thread
!=
RT_NULL
)
rt_thread_startup
(
thread
);
return
0
;
}
bsp/nv32f100x/app/src/startup.c
已删除
100644 → 0
浏览文件 @
e9cafbeb
/*
* File : startup.c
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006, RT-Thread Develop Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://openlab.rt-thread.com/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2006-08-31 Bernard first implementation
* 2013-11-15 bright modify for stm32f0xx version and components initial
* 2017-09-19 Quintin.Z modify for nv32f100xxx version and components initial
*/
#include <rthw.h>
#include <rtthread.h>
#include "board.h"
extern
int
rt_application_init
(
void
);
#ifdef RT_USING_FINSH
extern
int
finsh_system_init
(
void
);
extern
void
finsh_set_device
(
const
char
*
device
);
#endif
#ifdef __CC_ARM
extern
int
Image
$$
RW_IRAM1
$$
ZI
$$
Limit
;
#define NV32_SRAM_BEGIN (&Image$$RW_IRAM1$$ZI$$Limit)
#elif __ICCARM__
#pragma section="HEAP"
#define NV32_SRAM_BEGIN (__segment_end("HEAP"))
#else
extern
int
__bss_end
;
#define NV32_SRAM_BEGIN (&__bss_end)
#endif
/*******************************************************************************
* Function Name : assert_failed
* Description : Reports the name of the source file and the source line number
* where the assert error has occurred.
* Input : - file: pointer to the source file name
* - line: assert error line source number
* Output : None
* Return : None
*******************************************************************************/
void
assert_failed
(
uint8_t
*
file
,
uint32_t
line
)
{
rt_kprintf
(
"
\n\r
Wrong parameter value detected on
\r\n
"
);
rt_kprintf
(
" file %s
\r\n
"
,
file
);
rt_kprintf
(
" line %d
\r\n
"
,
line
);
while
(
1
)
;
}
/**
* This function will startup RT-Thread RTOS.
*/
void
rtthread_startup
(
void
)
{
/* init board */
rt_hw_board_init
();
/* show version */
rt_show_version
();
/* init tick */
rt_system_tick_init
();
/* init kernel object */
rt_system_object_init
();
/* init timer system */
rt_system_timer_init
();
#ifdef RT_USING_HEAP
rt_system_heap_init
((
void
*
)
NV32_SRAM_BEGIN
,
(
void
*
)
NV32_SRAM_END
);
#endif
/* init scheduler system */
rt_system_scheduler_init
();
/* init application */
rt_application_init
();
/* init timer thread */
rt_system_timer_thread_init
();
/* init idle thread */
rt_thread_idle_init
();
/* start scheduler */
rt_system_scheduler_start
();
/* never reach here */
return
;
}
int
main
(
void
)
{
/* disable interrupt first */
rt_hw_interrupt_disable
();
/* startup RT-Thread RTOS */
rtthread_startup
();
return
0
;
}
/*@}*/
bsp/nv32f100x/board/src/board.c
浏览文件 @
fda55ff0
...
...
@@ -37,6 +37,34 @@
#define portNVIC_PENDSV_PRI ( portMIN_INTERRUPT_PRIORITY << 16UL )
#define portNVIC_SYSTICK_PRI ( portMIN_INTERRUPT_PRIORITY << 24UL )
#ifdef __CC_ARM
extern
int
Image
$$
RW_IRAM1
$$
ZI
$$
Limit
;
#define NV32_SRAM_BEGIN (&Image$$RW_IRAM1$$ZI$$Limit)
#elif __ICCARM__
#pragma section="HEAP"
#define NV32_SRAM_BEGIN (__segment_end("HEAP"))
#else
extern
int
__bss_end
;
#define NV32_SRAM_BEGIN (&__bss_end)
#endif
/*******************************************************************************
* Function Name : assert_failed
* Description : Reports the name of the source file and the source line number
* where the assert error has occurred.
* Input : - file: pointer to the source file name
* - line: assert error line source number
* Output : None
* Return : None
*******************************************************************************/
void
assert_failed
(
uint8_t
*
file
,
uint32_t
line
)
{
rt_kprintf
(
"
\n\r
Wrong parameter value detected on
\r\n
"
);
rt_kprintf
(
" file %s
\r\n
"
,
file
);
rt_kprintf
(
" line %d
\r\n
"
,
line
);
while
(
1
)
;
}
/**
* This is the timer interrupt service routine.
...
...
@@ -75,6 +103,14 @@ void rt_hw_board_init()
rt_console_set_device
(
RT_CONSOLE_DEVICE_NAME
);
#endif
#ifdef RT_USING_HEAP
rt_system_heap_init
((
void
*
)
NV32_SRAM_BEGIN
,
(
void
*
)
NV32_SRAM_END
);
#endif
}
long
cmd_reset
(
int
argc
,
char
**
argv
)
...
...
bsp/nv32f100x/project.uvprojx
浏览文件 @
fda55ff0
...
...
@@ -378,20 +378,15 @@
<GroupName>
Applications
</GroupName>
<Files>
<File>
<FileName>
applicatio
n.c
</FileName>
<FileName>
mai
n.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
app\src\applicatio
n.c
</FilePath>
<FilePath>
.\app\src\mai
n.c
</FilePath>
</File>
<File>
<FileName>
ledapp.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
app\src\ledapp.c
</FilePath>
</File>
<File>
<FileName>
startup.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
app\src\startup.c
</FilePath>
</File>
</Files>
</Group>
<Group>
...
...
bsp/nv32f100x/rtconfig.h
浏览文件 @
fda55ff0
...
...
@@ -96,4 +96,6 @@
#define RT_USING_UART0
#define RT_USING_USER_MAIN
#endif
bsp/nv32f100x/rtconfig.py
浏览文件 @
fda55ff0
...
...
@@ -29,7 +29,7 @@ if os.getenv('RTT_EXEC_PATH'):
#BUILD = 'debug'
BUILD
=
'release'
STM32_TYPE
=
'STM32L0X
X'
NV32_TYPE
=
'NV32F100
X'
if
PLATFORM
==
'gcc'
:
# toolchains
...
...
@@ -44,9 +44,9 @@ if PLATFORM == 'gcc':
OBJCPY
=
PREFIX
+
'objcopy'
DEVICE
=
' -mcpu=cortex-m0 -mthumb -ffunction-sections -fdata-sections'
CFLAGS
=
DEVICE
+
' -D
STM32L072xx
'
+
' -DNULL=0'
CFLAGS
=
DEVICE
+
' -D
NV32F100X
'
+
' -DNULL=0'
AFLAGS
=
' -c'
+
DEVICE
+
' -x assembler-with-cpp'
LFLAGS
=
DEVICE
+
' -Wl,--gc-sections,-Map=rtthread-
stm32.map,-cref,-u,Reset_Handler -T stm
32_rom.ld'
LFLAGS
=
DEVICE
+
' -Wl,--gc-sections,-Map=rtthread-
nv32.map,-cref,-u,Reset_Handler -T nv
32_rom.ld'
CPATH
=
''
LPATH
=
''
...
...
@@ -70,7 +70,7 @@ elif PLATFORM == 'armcc':
DEVICE
=
' --device DARMSTM'
CFLAGS
=
DEVICE
+
' --apcs=interwork'
AFLAGS
=
DEVICE
LFLAGS
=
DEVICE
+
' --info sizes --info totals --info unused --info veneers --list rtthread-
stm32.map --scatter stm
32_rom.sct'
LFLAGS
=
DEVICE
+
' --info sizes --info totals --info unused --info veneers --list rtthread-
nv32.map --scatter nv
32_rom.sct'
CFLAGS
+=
' -I./'
...
...
@@ -92,8 +92,6 @@ elif PLATFORM == 'iar':
LINK
=
'ilinkarm'
TARGET_EXT
=
'out'
DEVICE
=
' -D USE_STDPERIPH_DRIVER'
+
' -D STM32F10X_HD'
CFLAGS
=
DEVICE
CFLAGS
+=
' --diag_suppress Pa050'
CFLAGS
+=
' --no_cse'
...
...
@@ -119,7 +117,7 @@ elif PLATFORM == 'iar':
AFLAGS
+=
' --cpu Cortex-M0'
AFLAGS
+=
' --fpu None'
LFLAGS
=
' --config
stm32l0x
x_flash.icf'
LFLAGS
=
' --config
nv32f100
x_flash.icf'
LFLAGS
+=
' --redirect _Printf=_PrintfTiny'
LFLAGS
+=
' --redirect _Scanf=_ScanfSmall'
LFLAGS
+=
' --entry __iar_program_start'
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录