Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
rt-thread
提交
dcce8489
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看板
提交
dcce8489
编写于
11月 14, 2017
作者:
T
tanek liang
提交者:
Bernard Xiong
11月 16, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[bsp] add gcc support
上级
234c6113
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
91 addition
and
44 deletion
+91
-44
bsp/lpc54608-LPCXpresso/SDK_2.2_LPCXpresso54608/devices/LPC54608/SConscript
...resso/SDK_2.2_LPCXpresso54608/devices/LPC54608/SConscript
+5
-3
bsp/lpc54608-LPCXpresso/SDK_2.2_LPCXpresso54608/devices/LPC54608/mcuxpresso/startup_LPC54608.c
...resso54608/devices/LPC54608/mcuxpresso/startup_LPC54608.c
+47
-38
bsp/lpc54608-LPCXpresso/applications/application.c
bsp/lpc54608-LPCXpresso/applications/application.c
+36
-0
bsp/lpc54608-LPCXpresso/link.lds
bsp/lpc54608-LPCXpresso/link.lds
+2
-2
bsp/lpc54608-LPCXpresso/rtconfig.py
bsp/lpc54608-LPCXpresso/rtconfig.py
+1
-1
未找到文件。
bsp/lpc54608-LPCXpresso/SDK_2.2_LPCXpresso54608/devices/LPC54608/SConscript
浏览文件 @
dcce8489
...
...
@@ -8,20 +8,22 @@ Import('rtconfig')
cwd
=
GetCurrentDir
()
objs
=
[]
list
=
os
.
listdir
(
cwd
)
CPPDEFINES
=
[]
objs
=
objs
+
SConscript
(
os
.
path
.
join
(
'drivers'
,
'SConscript'
))
objs
=
objs
+
SConscript
(
os
.
path
.
join
(
'utilities'
,
'SConscript'
))
if
rtconfig
.
CROSS_TOOL
==
'gcc'
:
objs
=
objs
+
SConscript
(
os
.
path
.
join
(
'mcuxpresso'
,
'SConscript'
))
CPPDEFINES
+=
[
'__USE_CMSIS'
]
elif
rtconfig
.
CROSS_TOOL
==
'keil'
:
objs
=
objs
+
SConscript
(
os
.
path
.
join
(
'arm'
,
'SConscript'
))
elif
rtconfig
.
CROSS_TOOL
==
'iar'
:
objs
=
objs
+
SConscript
(
os
.
path
.
join
(
'iar'
,
'SConscript'
))
src
=
Glob
(
'*.c'
)
CPPPATH
=
[
cwd
]
CPPDEFINES
=
[
'CORE_M4'
,
'CPU_LPC54608'
,
'CPU_LPC54608J512ET180=1'
]
src
=
Glob
(
'*.c'
)
CPPPATH
=
[
cwd
]
CPPDEFINES
+
=
[
'CORE_M4'
,
'CPU_LPC54608'
,
'CPU_LPC54608J512ET180=1'
]
group
=
DefineGroup
(
'CMSIS'
,
src
,
depend
=
[
''
],
CPPPATH
=
CPPPATH
,
CPPDEFINES
=
CPPDEFINES
)
...
...
bsp/lpc54608-LPCXpresso/SDK_2.2_LPCXpresso54608/devices/LPC54608/mcuxpresso/startup_LPC54608.c
浏览文件 @
dcce8489
...
...
@@ -82,7 +82,7 @@ extern void SystemInit(void);
// When the application defines a handler (with the same name), this will
// automatically take precedence over these weak definitions
//*****************************************************************************
void
Reset
ISR
(
void
);
void
Reset
_Handler
(
void
);
WEAK
void
NMI_Handler
(
void
);
WEAK
void
HardFault_Handler
(
void
);
WEAK
void
MemManage_Handler
(
void
);
...
...
@@ -234,7 +234,7 @@ extern int main(void);
//*****************************************************************************
// External declaration for the pointer to the stack top from the Linker Script
//*****************************************************************************
extern
void
_
vStackTop
(
void
);
extern
void
_
estack
(
void
);
//*****************************************************************************
// External declaration for LPC MCU vector table checksum from Linker Script
...
...
@@ -256,8 +256,8 @@ extern void * __Vectors __attribute__ ((alias ("g_pfnVectors")));
__attribute__
((
used
,
section
(
".isr_vector"
)))
void
(
*
const
g_pfnVectors
[])(
void
)
=
{
// Core Level - CM4
&
_
vStackTop
,
// The initial stack pointer
Reset
ISR
,
// The reset handler
&
_
estack
,
// The initial stack pointer
Reset
_Handler
,
// The reset handler
NMI_Handler
,
// The NMI handler
HardFault_Handler
,
// The hard fault handler
MemManage_Handler
,
// The MPU fault handler
...
...
@@ -336,7 +336,7 @@ void (* const g_pfnVectors[])(void) = {
//*****************************************************************************
// Functions to carry out the initialization of RW and BSS data sections. These
// are written as separate functions rather than being inlined within the
// Reset
ISR
() function in order to cope with MCUs with multiple banks of
// Reset
_Handler
() function in order to cope with MCUs with multiple banks of
// memory.
//*****************************************************************************
__attribute__
((
section
(
".after_vectors.init_data"
)))
...
...
@@ -363,19 +363,23 @@ void bss_init(unsigned int start, unsigned int len) {
// contains the load address, execution address and length of each RW data
// section and the execution and length of each BSS (zero initialized) section.
//*****************************************************************************
extern
unsigned
int
__data_section_table
;
extern
unsigned
int
__data_section_table_end
;
extern
unsigned
int
__bss_section_table
;
extern
unsigned
int
__bss_section_table_end
;
extern
unsigned
int
_sdata
;
extern
unsigned
int
_edata
;
extern
unsigned
int
_sidata
;
extern
unsigned
int
_sbss
;
extern
unsigned
int
_ebss
;
//*****************************************************************************
//
Reset entry point for your code.
//
Sets up a simple runtime environment and initializes the C/C++
//
library.
//Reset entry point for your code.
//Sets up a simple runtime environment and initializes the C/C++
//library.
//*****************************************************************************
__attribute__
((
section
(
".after_vectors.reset"
)))
void
ResetISR
(
void
)
{
void
Reset_Handler
(
void
)
{
/* Data and BSS variables */
unsigned
int
*
srcdata
,
*
dstdata
,
*
sbss
;
// Disable interrupts
__asm
volatile
(
"cpsid i"
);
...
...
@@ -383,36 +387,41 @@ void ResetISR(void) {
__asm
volatile
(
"LDR R0, =0x40000220
\n\t
"
"MOV R1, #56
\n\t
"
"STR R1, [R0]"
);
// extern void Reset_ASM_Handler();
// Reset_ASM_Handler();
srcdata
=
&
_sidata
;
dstdata
=
&
_sdata
;
sbss
=
&
_sbss
;
/* Copy data */
while
(
dstdata
!=
&
_edata
)
{
*
(
dstdata
++
)
=
*
(
srcdata
++
);
}
/* Clear BSS */
while
(
sbss
!=
&
_ebss
)
{
*
(
sbss
++
)
=
'\0'
;
}
#if defined (__USE_CMSIS)
// If __USE_CMSIS defined, then call CMSIS SystemInit code
SystemInit
();
#endif // (__USE_CMSIS)
//
// Copy the data sections from flash to SRAM.
//
unsigned
int
LoadAddr
,
ExeAddr
,
SectionLen
;
unsigned
int
*
SectionTableAddr
;
// Load base address of Global Section Table
SectionTableAddr
=
&
__data_section_table
;
// Copy the data sections from flash to SRAM.
while
(
SectionTableAddr
<
&
__data_section_table_end
)
{
LoadAddr
=
*
SectionTableAddr
++
;
ExeAddr
=
*
SectionTableAddr
++
;
SectionLen
=
*
SectionTableAddr
++
;
data_init
(
LoadAddr
,
ExeAddr
,
SectionLen
);
}
// //
// // Copy the data sections from flash to SRAM.
// //
// //data_init(_sidata, _sdata, _edata - _sdata);
// // At this point, SectionTableAddr = &__bss_section_table;
// // Zero fill the bss segment
// //bss_init(_sbss, _ebss - _sbss);
//bss_init(_sbss, _ebss - _sbss);
// At this point, SectionTableAddr = &__bss_section_table;
// Zero fill the bss segment
while
(
SectionTableAddr
<
&
__bss_section_table_end
)
{
ExeAddr
=
*
SectionTableAddr
++
;
SectionLen
=
*
SectionTableAddr
++
;
bss_init
(
ExeAddr
,
SectionLen
);
}
#if !defined (__USE_CMSIS)
// Assume that if __USE_CMSIS defined, then CMSIS SystemInit code
...
...
bsp/lpc54608-LPCXpresso/applications/application.c
浏览文件 @
dcce8489
...
...
@@ -38,9 +38,45 @@ void rt_init_thread_entry(void *parameter)
#endif
}
void
build_dump
(
void
)
{
#if defined(__CC_ARM)
rt_kprintf
(
"using MDK
\n
"
);
#elif defined(__IAR_SYSTEMS_ICC__)
rt_kprintf
(
"using IAR
\n
"
);
#elif defined(__GNUC__)
rt_kprintf
(
"using GCC
\n
"
);
#else
rt_kprintf
(
"unkown Compiler
\n
"
);
#endif
}
void
link_dump
(
void
)
{
extern
unsigned
int
_sdata
;
extern
unsigned
int
_edata
;
extern
unsigned
int
_sidata
;
extern
unsigned
int
_sbss
;
extern
unsigned
int
_ebss
;
#define DUMP_VAR(__VAR) \
rt_kprintf("%-20s %p\n", #__VAR, &__VAR)
DUMP_VAR
(
_sdata
);
DUMP_VAR
(
_edata
);
DUMP_VAR
(
_sidata
);
DUMP_VAR
(
_sbss
);
DUMP_VAR
(
_ebss
);
}
int
rt_application_init
(
void
)
{
rt_thread_t
tid
;
build_dump
();
link_dump
();
tid
=
rt_thread_create
(
"init"
,
rt_init_thread_entry
,
RT_NULL
,
2048
,
RT_THREAD_PRIORITY_MAX
/
3
,
20
);
...
...
bsp/lpc54608-LPCXpresso/link.lds
浏览文件 @
dcce8489
...
...
@@ -7,7 +7,7 @@
MEMORY
{
CODE (rx) : ORIGIN = 0x00000000, LENGTH = 0x00080000
DATA (rw) : ORIGIN = 0x
10000000, LENGTH = 0x00010
000
DATA (rw) : ORIGIN = 0x
20000000, LENGTH = 0x00028
000
}
ENTRY(Reset_Handler)
_system_stack_size = 0x200;
...
...
@@ -17,7 +17,7 @@ SECTIONS
.text :
{
. = ALIGN(4);
KEEP(*(.i
nterrupt_vector))
/* Startup code */
KEEP(*(.i
sr_vector))
/* Startup code */
. = ALIGN(4);
*(.text) /* remaining code */
*(.text.*) /* remaining code */
...
...
bsp/lpc54608-LPCXpresso/rtconfig.py
浏览文件 @
dcce8489
...
...
@@ -55,7 +55,7 @@ if PLATFORM == 'gcc':
CXXFLAGS
=
CFLAGS
POST_ACTION
=
OBJCPY
+
' -O
binary $TARGET rtthread.bin
\n
'
+
SIZE
+
' $TARGET
\n
'
POST_ACTION
=
OBJCPY
+
' -O
ihex $TARGET rtthread.hex
\n
'
+
SIZE
+
' $TARGET
\n
'
elif
PLATFORM
==
'armcc'
:
# toolchains
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录