Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
人间散章
rt-thread
提交
741346e3
R
rt-thread
项目概览
人间散章
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
1
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,发现更多精彩内容 >>
提交
741346e3
编写于
9月 26, 2015
作者:
B
Bernard Xiong
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #553 from ArdaFu/master
[bsp][stm32f746-Disco] Cleanup code
上级
b4e3fb20
090153f9
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
37 addition
and
145 deletion
+37
-145
bsp/stm32f7-disco/applications/application.c
bsp/stm32f7-disco/applications/application.c
+3
-3
bsp/stm32f7-disco/applications/startup.c
bsp/stm32f7-disco/applications/startup.c
+0
-125
bsp/stm32f7-disco/drivers/board.c
bsp/stm32f7-disco/drivers/board.c
+16
-9
bsp/stm32f7-disco/drivers/board.h
bsp/stm32f7-disco/drivers/board.h
+1
-1
bsp/stm32f7-disco/drivers/drv_mpu.c
bsp/stm32f7-disco/drivers/drv_mpu.c
+5
-4
bsp/stm32f7-disco/drivers/drv_mpu.h
bsp/stm32f7-disco/drivers/drv_mpu.h
+2
-2
bsp/stm32f7-disco/drivers/drv_sdram.c
bsp/stm32f7-disco/drivers/drv_sdram.c
+6
-0
bsp/stm32f7-disco/rtconfig.h
bsp/stm32f7-disco/rtconfig.h
+3
-0
bsp/stm32f7-disco/rtconfig.py
bsp/stm32f7-disco/rtconfig.py
+1
-1
未找到文件。
bsp/stm32f7-disco/applications/application.c
浏览文件 @
741346e3
...
...
@@ -24,14 +24,14 @@
*/
#include <rtthread.h>
#include <components.h>
void
rt_init_thread_entry
(
void
*
parameter
)
{
rt_components_init
();
//
rt_components_init();
}
int
rt_application_init
()
//int rt_application_init()
int
main
(
void
)
{
rt_thread_t
tid
;
...
...
bsp/stm32f7-disco/applications/startup.c
已删除
100644 → 0
浏览文件 @
b4e3fb20
/*
* File : startup.c
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2015, 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
* 2006-08-31 Bernard first implementation
* 2015-08-01 xiaonong modify for STM32F7 version
*/
#include <rthw.h>
#include <rtthread.h>
#include "board.h"
#ifdef RT_USING_EXT_SDRAM
#include "drv_sdram.h"
#include "sram.h"
#endif
/**
* @addtogroup STM32
*/
/*@{*/
extern
int
rt_application_init
(
void
);
#ifdef USE_FULL_ASSERT
/**
* @brief assert_failed
* Reports the name of the source file and the source line number
* where the assert_param error has occurred.
* @param File: pointer to the source file name
* @param Line: assert_param error line source number
* @retval None
*/
void
assert_failed
(
uint8_t
*
file
,
uint32_t
line
)
{
/* User can add his own implementation to report the file name and line
number,ex: printf("Wrong parameters value: file %s on line %d\r\n",
file, 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
);
/* Infinite loop */
while
(
1
)
{}
}
#endif
/**
* 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_EXT_SDRAM
sdram_hw_init
();
rt_system_heap_init
((
void
*
)
EXT_SDRAM_BEGIN
,
(
void
*
)
EXT_SDRAM_END
);
sram_init
();
#else
rt_system_heap_init
((
void
*
)
HEAP_BEGIN
,
(
void
*
)
HEAP_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/stm32f7-disco/drivers/board.c
浏览文件 @
741346e3
...
...
@@ -22,13 +22,10 @@
* 2009-01-05 Bernard first implementation
*/
#include <rthw.h>
#include <rtthread.h>
#include <components.h>
#include "board.h"
#include "
drv_usart
.h"
#include "drv_mpu.h"
#include "
sram
.h"
/**
* @addtogroup STM32
...
...
@@ -70,11 +67,11 @@ static void SystemClock_Config(void)
RCC_OscInitStruct
.
PLL
.
PLLN
=
400
;
RCC_OscInitStruct
.
PLL
.
PLLP
=
RCC_PLLP_DIV2
;
RCC_OscInitStruct
.
PLL
.
PLLQ
=
8
;
ret
=
HAL_RCC_OscConfig
(
&
RCC_OscInitStruct
);
if
(
ret
!=
HAL_OK
)
{
while
(
1
)
{
;
}
while
(
1
)
{
;
}
}
ret
=
HAL_PWREx_EnableOverDrive
();
...
...
@@ -85,7 +82,8 @@ static void SystemClock_Config(void)
/* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2
clocks dividers */
RCC_ClkInitStruct
.
ClockType
=
(
RCC_CLOCKTYPE_SYSCLK
|
RCC_CLOCKTYPE_HCLK
|
RCC_CLOCKTYPE_PCLK1
|
RCC_CLOCKTYPE_PCLK2
);
RCC_ClkInitStruct
.
ClockType
=
(
RCC_CLOCKTYPE_SYSCLK
|
RCC_CLOCKTYPE_HCLK
|
\
RCC_CLOCKTYPE_PCLK1
|
RCC_CLOCKTYPE_PCLK2
);
RCC_ClkInitStruct
.
SYSCLKSource
=
RCC_SYSCLKSOURCE_PLLCLK
;
RCC_ClkInitStruct
.
AHBCLKDivider
=
RCC_SYSCLK_DIV1
;
RCC_ClkInitStruct
.
APB1CLKDivider
=
RCC_HCLK_DIV4
;
...
...
@@ -167,7 +165,7 @@ void HAL_ResumeTick(void)
void
rt_hw_board_init
()
{
/* Configure the MPU attributes as Write Through */
mpu_init
();
//
mpu_init();
/* Enable the CPU Cache */
CPU_CACHE_Enable
();
...
...
@@ -186,7 +184,16 @@ void rt_hw_board_init()
/* set pend exception priority */
NVIC_SetPriority
(
PendSV_IRQn
,
(
1
<<
__NVIC_PRIO_BITS
)
-
1
);
#ifdef RT_USING_COMPONENTS_INIT
rt_components_board_init
();
#endif
#ifdef RT_USING_EXT_SDRAM
rt_system_heap_init
((
void
*
)
EXT_SDRAM_BEGIN
,
(
void
*
)
EXT_SDRAM_END
);
sram_init
();
#else
rt_system_heap_init
((
void
*
)
HEAP_BEGIN
,
(
void
*
)
HEAP_END
);
#endif
#ifdef RT_USING_CONSOLE
rt_console_set_device
(
RT_CONSOLE_DEVICE_NAME
);
...
...
bsp/stm32f7-disco/drivers/board.h
浏览文件 @
741346e3
...
...
@@ -31,8 +31,8 @@
// <e>Use external SDRAM memory on the board
// <o>Begin Address of External SDRAM
#define EXT_SDRAM_BEGIN 0xC0000000
// <o>Size of External SDRAM
#define EXT_SDRAM_SIZE (0x800000)
// <o>End Address of External SDRAM
#define EXT_SDRAM_END (EXT_SDRAM_BEGIN + EXT_SDRAM_SIZE)
// </e>
...
...
bsp/stm32f7-disco/drivers/drv_mpu.c
浏览文件 @
741346e3
...
...
@@ -23,9 +23,9 @@
*/
#include "drv_mpu.h"
void
mpu_init
(
void
)
#include <rtthread.h>
#include "stm32f7xx.h"
int
mpu_init
(
void
)
{
MPU_Region_InitTypeDef
MPU_InitStruct
;
...
...
@@ -79,5 +79,6 @@ void mpu_init(void)
/* Enable the MPU */
HAL_MPU_Enable
(
MPU_PRIVILEGED_DEFAULT
);
return
0
;
}
INIT_BOARD_EXPORT
(
mpu_init
);
bsp/stm32f7-disco/drivers/drv_mpu.h
浏览文件 @
741346e3
#ifndef __DRV_MPU_H
#define __DRV_MPU_H
#include "stm32f7xx.h"
/* Initialize Cortex M MPU */
void
mpu_init
(
void
);
int
mpu_init
(
void
);
#endif
bsp/stm32f7-disco/drivers/drv_sdram.c
浏览文件 @
741346e3
...
...
@@ -362,3 +362,9 @@ void SDRAM_DMA_IRQHandler(void)
{
HAL_DMA_IRQHandler
(
sdramHandle
.
hdma
);
}
static
int
rt_sdram_hw_init
(
void
)
{
return
(
int
)
sdram_hw_init
();
}
INIT_BOARD_EXPORT
(
rt_sdram_hw_init
);
bsp/stm32f7-disco/rtconfig.h
浏览文件 @
741346e3
...
...
@@ -227,4 +227,7 @@
/* enable SDRAM */
#define RT_USING_EXT_SDRAM
#define RT_USING_COMPONENTS_INIT
#define RT_USING_USER_MAIN
#endif
bsp/stm32f7-disco/rtconfig.py
浏览文件 @
741346e3
...
...
@@ -45,7 +45,7 @@ if PLATFORM == 'gcc':
STRIP
=
PREFIX
+
'strip'
DEVICE
=
' -mcpu=cortex-m7 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -ffunction-sections -fdata-sections'
CFLAGS
=
DEVICE
+
' -g -Wall -DSTM32F756xx -DUSE_HAL_DRIVER -D__ASSEMBLY__ -D__FPU_USED'
CFLAGS
=
DEVICE
+
' -g -Wall -DSTM32F756xx -DUSE_HAL_DRIVER -D__ASSEMBLY__ -D__FPU_USED
-eentry
'
AFLAGS
=
' -c'
+
DEVICE
+
' -x assembler-with-cpp -Wa,-mimplicit-it=thumb '
LFLAGS
=
DEVICE
+
' -lm -lgcc -lc'
+
' -nostartfiles -Wl,--gc-sections,-Map=rtthread_stm32f7xx.map,-cref,-u,Reset_Handler -T rtthread-stm32f7xx.ld'
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录