Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
rt-thread
提交
010891fc
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,发现更多精彩内容 >>
提交
010891fc
编写于
12月 07, 2017
作者:
T
tanek liang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[bsp] add link info dump and update SDCard mount
上级
da30f0fa
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
95 addition
and
42 deletion
+95
-42
bsp/imxrt1052-evk/applications/main.c
bsp/imxrt1052-evk/applications/main.c
+95
-42
未找到文件。
bsp/imxrt1052-evk/applications/main.c
浏览文件 @
010891fc
...
@@ -30,13 +30,13 @@
...
@@ -30,13 +30,13 @@
#include <dfs_file.h>
#include <dfs_file.h>
#endif
#endif
#include <board.h>
#ifdef RT_USING_DEVICE
#include <rtdevice.h>
RT_USED
MPU_Type
*
mpu
=
MPU
;
#endif
RT_USED
IOMUXC_GPR_Type
*
iomuxc_gpr
=
IOMUXC_GPR
;
#include <board.h>
static
void
dump_clock
(
void
)
void
dump_clock
(
void
)
{
{
rt_kprintf
(
"CPU clock: %d
\n
"
,
CLOCK_GetFreq
(
kCLOCK_CpuClk
));
rt_kprintf
(
"CPU clock: %d
\n
"
,
CLOCK_GetFreq
(
kCLOCK_CpuClk
));
rt_kprintf
(
"AHB clock : %d
\n
"
,
CLOCK_GetFreq
(
kCLOCK_AhbClk
));
rt_kprintf
(
"AHB clock : %d
\n
"
,
CLOCK_GetFreq
(
kCLOCK_AhbClk
));
...
@@ -63,29 +63,82 @@ static void dump_clock(void)
...
@@ -63,29 +63,82 @@ static void dump_clock(void)
rt_kprintf
(
"Video PLLCLK : %d
\n
"
,
CLOCK_GetFreq
(
kCLOCK_VideoPllClk
));
rt_kprintf
(
"Video PLLCLK : %d
\n
"
,
CLOCK_GetFreq
(
kCLOCK_VideoPllClk
));
}
}
void
dump_
tcm
(
void
)
void
dump_
cc_info
(
void
)
{
{
#define DUMP_REG(__REG) \
#if defined(__CC_ARM)
rt_kprintf("%s(%08p): %08x\n", #__REG, &(__REG), __REG)
rt_kprintf
(
"using armcc, version: %d
\n
"
,
__ARMCC_VERSION
);
#elif defined(__ICCARM__)
rt_kprintf
(
"using iccarm, version: %d
\n
"
,
__VER__
);
#elif defined(__GNUC__)
rt_kprintf
(
"using gcc, version: %d.%d
\n
"
,
__GNUC__
,
__GNUC_MINOR__
);
#endif
}
void
dump_link_info
(
void
)
{
#if defined(__CC_ARM)
#elif defined(__ICCARM__)
#elif defined(__GNUC__)
#define DUMP_SYMBOL(__SYM) \
extern int __SYM; \
rt_kprintf("%s: %p\n", #__SYM, &__SYM)
DUMP_SYMBOL
(
__fsymtab_start
);
DUMP_SYMBOL
(
__fsymtab_end
);
DUMP_SYMBOL
(
__vsymtab_start
);
DUMP_SYMBOL
(
__vsymtab_end
);
DUMP_SYMBOL
(
__rt_init_start
);
DUMP_SYMBOL
(
__rt_init_end
);
DUMP_SYMBOL
(
__exidx_start
);
DUMP_SYMBOL
(
__exidx_end
);
DUMP_SYMBOL
(
__etext
);
DUMP_REG
(
IOMUXC_GPR
->
GPR14
);
DUMP_SYMBOL
(
__data_start__
);
DUMP_REG
(
IOMUXC_GPR
->
GPR16
);
DUMP_SYMBOL
(
__data_end__
);
DUMP_REG
(
IOMUXC_GPR
->
GPR17
);
DUMP_SYMBOL
(
__noncachedata_start__
);
DUMP_SYMBOL
(
__noncachedata_init_end__
);
DUMP_SYMBOL
(
__noncachedata_end__
);
DUMP_SYMBOL
(
__bss_start__
);
DUMP_SYMBOL
(
__bss_end__
);
DUMP_SYMBOL
(
stack_start
);
DUMP_SYMBOL
(
stack_end
);
DUMP_SYMBOL
(
heap_start
);
#endif
}
}
int
main
(
void
)
int
main
(
void
)
{
{
rt_uint32_t
result
;
//dump_clock();
//dump_clock();
//dump_tcm();
dump_cc_info
();
dump_link_info
();
rt_
thread_delay
(
RT_TICK_PER_SECOND
*
2
);
rt_
kprintf
(
"build time: %s %s
\n
"
,
__DATE__
,
__TIME__
);
#if defined(RT_USING_DFS) && defined(RT_USING_SDIO)
result
=
mmcsd_wait_cd_changed
(
RT_TICK_PER_SECOND
);
if
(
result
==
MMCSD_HOST_PLUGED
)
{
/* mount sd card fat partition 1 as root directory */
/* mount sd card fat partition 1 as root directory */
if
(
dfs_mount
(
"sd0"
,
"/"
,
"elm"
,
0
,
0
)
==
0
)
if
(
dfs_mount
(
"sd0"
,
"/"
,
"elm"
,
0
,
0
)
==
0
)
rt_kprintf
(
"File System initialized!
\n
"
);
rt_kprintf
(
"File System initialized!
\n
"
);
else
else
rt_kprintf
(
"File System init failed!
\n
"
);
rt_kprintf
(
"File System init failed!
\n
"
);
}
else
{
rt_kprintf
(
"sdcard init fail or timeout: %d!
\n
"
,
result
);
}
#endif
while
(
1
)
while
(
1
)
{
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录