Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
rt-thread
提交
0f6e68ff
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看板
提交
0f6e68ff
编写于
10月 20, 2017
作者:
B
Bernard Xiong
提交者:
GitHub
10月 20, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #889 from weety/rtt3_9260
[BSP] update 9260 bsp.
上级
8e398fe4
1a9de2e1
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
106 addition
and
214 deletion
+106
-214
bsp/asm9260t/link_scripts/sdram.ld
bsp/asm9260t/link_scripts/sdram.ld
+1
-1
bsp/at91sam9260/applications/application.c
bsp/at91sam9260/applications/application.c
+5
-78
bsp/at91sam9260/applications/startup.c
bsp/at91sam9260/applications/startup.c
+0
-106
bsp/at91sam9260/drivers/at91_i2c_gpio.c
bsp/at91sam9260/drivers/at91_i2c_gpio.c
+3
-3
bsp/at91sam9260/drivers/board.c
bsp/at91sam9260/drivers/board.c
+23
-5
bsp/at91sam9260/drivers/macb.c
bsp/at91sam9260/drivers/macb.c
+6
-2
bsp/at91sam9260/drivers/macb.h
bsp/at91sam9260/drivers/macb.h
+1
-1
bsp/at91sam9260/drivers/usart.c
bsp/at91sam9260/drivers/usart.c
+5
-1
bsp/at91sam9260/link_scripts/at91sam9260_ram.ld
bsp/at91sam9260/link_scripts/at91sam9260_ram.ld
+9
-1
bsp/at91sam9260/platform/interrupt.c
bsp/at91sam9260/platform/interrupt.c
+21
-10
bsp/at91sam9260/platform/reset.c
bsp/at91sam9260/platform/reset.c
+24
-0
bsp/at91sam9260/rtconfig.h
bsp/at91sam9260/rtconfig.h
+4
-0
bsp/at91sam9260/rtconfig.py
bsp/at91sam9260/rtconfig.py
+1
-3
libcpu/arm/arm926/start_gcc.S
libcpu/arm/arm926/start_gcc.S
+3
-3
未找到文件。
bsp/asm9260t/link_scripts/sdram.ld
浏览文件 @
0f6e68ff
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(
entry
)
ENTRY(
start
)
SECTIONS
{
. = 0x20000000;
...
...
bsp/at91sam9260/applications/application.c
浏览文件 @
0f6e68ff
...
...
@@ -31,18 +31,8 @@
#include <rtdevice.h>
#ifdef RT_USING_DFS
/* dfs filesystem:ELM FatFs filesystem init */
#include <dfs_elm.h>
/* dfs Filesystem APIs */
#include <dfs_fs.h>
#ifdef RT_USING_DFS_UFFS
/* dfs filesystem:UFFS filesystem init */
#include <dfs_uffs.h>
#endif
#endif
#if defined(RT_USING_DFS_DEVFS)
#include <devfs.h>
#endif
#ifdef RT_USING_SDIO
...
...
@@ -50,37 +40,18 @@
#include "at91_mci.h"
#endif
#ifdef RT_USING_LWIP
#include <netif/ethernetif.h>
//#include <arch/sys_arch_init.h>
#include "macb.h"
#endif
#ifdef RT_USING_LED
#include "led.h"
#endif
#define RT_INIT_THREAD_STACK_SIZE (2*1024)
#ifdef RT_USING_DFS_ROMFS
#include <dfs_romfs.h>
#endif
static
int
rt_led_app_init
(
void
);
void
rt_init_thread_entry
(
void
*
parameter
)
int
main
(
void
)
{
/* Filesystem Initialization */
#ifdef RT_USING_DFS
{
/* init the device filesystem */
dfs_init
();
#if defined(RT_USING_DFS_ELMFAT)
/* init the elm chan FatFs filesystam*/
elm_init
();
#endif
#if defined(RT_USING_DFS_ROMFS)
dfs_romfs_init
();
if
(
dfs_mount
(
RT_NULL
,
"/rom"
,
"rom"
,
0
,
&
romfs_root
)
==
0
)
{
rt_kprintf
(
"ROM File System initialized!
\n
"
);
...
...
@@ -89,24 +60,8 @@ void rt_init_thread_entry(void* parameter)
rt_kprintf
(
"ROM File System initialzation failed!
\n
"
);
#endif
#if defined(RT_USING_DFS_DEVFS)
devfs_init
();
if
(
dfs_mount
(
RT_NULL
,
"/dev"
,
"devfs"
,
0
,
0
)
==
0
)
rt_kprintf
(
"Device File System initialized!
\n
"
);
else
rt_kprintf
(
"Device File System initialzation failed!
\n
"
);
#ifdef RT_USING_NEWLIB
/* init libc */
libc_system_init
(
"uart0"
);
#endif
#endif
#if defined(RT_USING_DFS_UFFS)
{
/* init the uffs filesystem */
dfs_uffs_init
();
/* mount flash device as flash directory */
if
(
dfs_mount
(
"nand0"
,
"/nand0"
,
"uffs"
,
0
,
0
)
==
0
)
rt_kprintf
(
"UFFS File System initialized!
\n
"
);
...
...
@@ -131,20 +86,9 @@ void rt_init_thread_entry(void* parameter)
}
#endif
#ifdef RT_USING_LWIP
{
/* register ethernetif device */
eth_system_device_init
();
rt_hw_macb_init
();
/* init lwip system */
lwip_sys_init
();
}
#endif
#ifdef RT_USING_I2C
{
rt_i2c_core_init
();
at91_i2c_init
();
}
#endif
...
...
@@ -177,38 +121,21 @@ void rt_led_thread_entry(void* parameter)
}
#endif
int
rt_application_init
(
)
static
int
rt_led_app_init
(
void
)
{
rt_thread_t
init_thread
;
#ifdef RT_USING_LED
rt_thread_t
led_thread
;
#endif
#if (RT_THREAD_PRIORITY_MAX == 32)
init_thread
=
rt_thread_create
(
"init"
,
rt_init_thread_entry
,
RT_NULL
,
RT_INIT_THREAD_STACK_SIZE
,
8
,
20
);
#ifdef RT_USING_LED
led_thread
=
rt_thread_create
(
"led"
,
rt_led_thread_entry
,
RT_NULL
,
512
,
20
,
20
);
#endif
512
,
20
,
20
);
#else
init_thread
=
rt_thread_create
(
"init"
,
rt_init_thread_entry
,
RT_NULL
,
RT_INIT_THREAD_STACK_SIZE
,
80
,
20
);
#ifdef RT_USING_LED
led_thread
=
rt_thread_create
(
"led"
,
rt_led_thread_entry
,
RT_NULL
,
512
,
200
,
20
);
#endif
512
,
200
,
20
);
#endif
if
(
init_thread
!=
RT_NULL
)
rt_thread_startup
(
init_thread
);
#ifdef RT_USING_LED
if
(
led_thread
!=
RT_NULL
)
rt_thread_startup
(
led_thread
);
#endif
...
...
bsp/at91sam9260/applications/startup.c
已删除
100644 → 0
浏览文件 @
8e398fe4
/*
* File : startup.c
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006, RT-Thread Develop 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
* 2011-01-13 weety first version
*/
#include <rthw.h>
#include <rtthread.h>
#include <at91sam926x.h>
#ifdef RT_USING_FINSH
#include <finsh.h>
#endif
extern
void
rt_application_init
(
void
);
/**
* @addtogroup at91sam9260
*/
/*@{*/
#if defined(__CC_ARM)
extern
int
Image
$$
ER_ZI
$$
ZI
$$
Limit
;
#define HEAP_BEGIN (&Image$$ER_ZI$$ZI$$Limit)
#elif (defined (__GNUC__))
extern
unsigned
char
__bss_end__
;
#define HEAP_BEGIN (&__bss_end__)
#elif (defined (__ICCARM__))
#pragma section=".noinit"
#define HEAP_BEGIN (__section_end(".noinit"))
#endif
#define HEAP_END (0x24000000)
/**
* This function will startup RT-Thread RTOS.
*/
static
void
rtthread_startup
(
void
)
{
/* initialize board */
rt_hw_board_init
();
/* show version */
rt_show_version
();
#ifdef RT_USING_HEAP
rt_system_heap_init
((
void
*
)
HEAP_BEGIN
,
(
void
*
)
HEAP_END
);
#endif
/* initialize scheduler system */
rt_system_scheduler_init
();
/* initialize system timer*/
rt_system_timer_init
();
/* initialize application */
rt_application_init
();
#ifdef RT_USING_FINSH
/* initialize finsh */
finsh_system_init
();
#ifdef RT_USING_DEVICE
finsh_set_device
(
RT_CONSOLE_DEVICE_NAME
);
#endif
#endif
/* initialize timer thread */
rt_system_timer_thread_init
();
/* initialize 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/at91sam9260/drivers/at91_i2c_gpio.c
浏览文件 @
0f6e68ff
...
...
@@ -104,7 +104,7 @@ static const struct rt_i2c_bit_ops bit_ops = {
100
};
rt_err_
t
at91_i2c_init
(
void
)
in
t
at91_i2c_init
(
void
)
{
struct
rt_i2c_bus_device
*
bus
;
...
...
@@ -123,8 +123,8 @@ rt_err_t at91_i2c_init(void)
rt_i2c_bit_add_bus
(
bus
,
"i2c0"
);
return
RT_EOK
;
return
0
;
}
INIT_DEVICE_EXPORT
(
at91_i2c_init
);
bsp/at91sam9260/drivers/board.c
浏览文件 @
0f6e68ff
...
...
@@ -32,6 +32,18 @@
* @addtogroup at91sam9260
*/
/*@{*/
#if defined(__CC_ARM)
extern
int
Image
$$
ER_ZI
$$
ZI
$$
Limit
;
#define HEAP_BEGIN (&Image$$ER_ZI$$ZI$$Limit)
#elif (defined (__GNUC__))
extern
unsigned
char
__bss_end__
;
#define HEAP_BEGIN (&__bss_end__)
#elif (defined (__ICCARM__))
#pragma section=".noinit"
#define HEAP_BEGIN (__section_end(".noinit"))
#endif
#define HEAP_END (0x24000000)
extern
void
rt_hw_interrupt_init
(
void
);
extern
void
rt_hw_clock_init
(
void
);
...
...
@@ -150,15 +162,21 @@ void rt_hw_board_init()
/* initialize the system clock */
rt_hw_clock_init
();
/* initialize uart */
rt_hw_uart_init
();
/* initialize early device */
#ifdef RT_USING_COMPONENTS_INIT
rt_components_board_init
();
#endif
#ifdef RT_USING_CONSOLE
rt_console_set_device
(
RT_CONSOLE_DEVICE_NAME
);
#endif
/* initialize timer0 */
rt_hw_timer_init
();
/* initialize board */
#ifdef RT_USING_HEAP
rt_system_heap_init
((
void
*
)
HEAP_BEGIN
,
(
void
*
)
HEAP_END
);
#endif
}
/*@}*/
bsp/at91sam9260/drivers/macb.c
浏览文件 @
0f6e68ff
...
...
@@ -866,7 +866,7 @@ err1:
return
-
RT_ENOMEM
;
}
void
rt_hw_macb_init
(
)
int
rt_hw_macb_init
(
void
)
{
rt_err_t
ret
;
at91_sys_write
(
AT91_PMC
+
AT91_PMC_PCER
,
1
<<
AT91SAM9260_ID_EMAC
);
//enable macb clock
...
...
@@ -903,5 +903,9 @@ void rt_hw_macb_init()
rt_sem_init
(
&
macb_device
.
mdio_bus_lock
,
"mdio_bus_lock"
,
1
,
RT_IPC_FLAG_FIFO
);
eth_device_init
(
&
(
macb_device
.
parent
),
"e0"
);
return
0
;
}
INIT_DEVICE_EXPORT
(
rt_hw_macb_init
);
bsp/at91sam9260/drivers/macb.h
浏览文件 @
0f6e68ff
...
...
@@ -340,7 +340,7 @@ struct dma_desc {
#define MACB_TX_USED_OFFSET 31
#define MACB_TX_USED_SIZE 1
extern
void
rt_hw_macb_init
();
extern
int
rt_hw_macb_init
();
#endif
/* _MACB_H */
bsp/at91sam9260/drivers/usart.c
浏览文件 @
0f6e68ff
...
...
@@ -326,7 +326,7 @@ void at91_usart_gpio_init(void)
/**
* This function will handle init uart
*/
void
rt_hw_uart_init
(
void
)
int
rt_hw_uart_init
(
void
)
{
at91_usart_gpio_init
();
...
...
@@ -422,8 +422,12 @@ void rt_hw_uart_init(void)
(
void
*
)
&
(
serial3
.
parent
),
"UART3"
);
rt_hw_interrupt_umask
(
uart3
.
irq
);
#endif
return
0
;
}
INIT_BOARD_EXPORT
(
rt_hw_uart_init
);
#ifdef RT_USING_DBGU
void
rt_dbgu_isr
(
void
)
{
...
...
bsp/at91sam9260/link_scripts/at91sam9260_ram.ld
浏览文件 @
0f6e68ff
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(
entry
)
ENTRY(
start
)
SECTIONS
{
. = 0x20000000;
...
...
@@ -34,6 +34,14 @@ SECTIONS
__rtmsymtab_start = .;
KEEP(*(RTMSymTab))
__rtmsymtab_end = .;
. = ALIGN(4);
/* section information for initial. */
. = ALIGN(4);
__rt_init_start = .;
KEEP(*(SORT(.rti_fn*)))
__rt_init_end = .;
. = ALIGN(4);
}
. = ALIGN(4);
...
...
bsp/at91sam9260/platform/interrupt.c
浏览文件 @
0f6e68ff
...
...
@@ -405,23 +405,34 @@ void rt_hw_interrupt_ack(rt_uint32_t fiq_irq, rt_uint32_t id)
}
#ifdef RT_USING_FINSH
#ifdef RT_USING_INTERRUPT_INFO
void
list_irq
(
void
)
{
int
irq
;
rt_kprintf
(
"number
\t
count
\t
name
\n
"
);
for
(
irq
=
0
;
irq
<
MAX_HANDLERS
;
irq
++
)
{
if
(
rt_strncmp
(
irq_desc
[
irq
].
name
,
"default"
,
sizeof
(
"default"
)))
{
rt_kprintf
(
"%02ld: %10ld %s
\n
"
,
irq
,
irq_desc
[
irq
].
counter
,
irq_desc
[
irq
].
name
);
}
}
int
irq
;
rt_kprintf
(
"number
\t
count
\t
name
\n
"
);
for
(
irq
=
0
;
irq
<
MAX_HANDLERS
;
irq
++
)
{
if
(
rt_strncmp
(
irq_desc
[
irq
].
name
,
"default"
,
sizeof
(
"default"
)))
{
rt_kprintf
(
"%02ld: %10ld %s
\n
"
,
irq
,
irq_desc
[
irq
].
counter
,
irq_desc
[
irq
].
name
);
}
}
}
#include <finsh.h>
FINSH_FUNCTION_EXPORT
(
list_irq
,
list
system
irq
);
#ifdef FINSH_USING_MSH
int
cmd_list_irq
(
int
argc
,
char
**
argv
)
{
list_irq
();
return
0
;
}
FINSH_FUNCTION_EXPORT_ALIAS
(
cmd_list_irq
,
__cmd_list_irq
,
list
system
irq
.);
#endif
#endif
#endif
bsp/at91sam9260/platform/reset.c
浏览文件 @
0f6e68ff
...
...
@@ -41,4 +41,28 @@ void machine_shutdown(void)
at91_sys_write
(
AT91_SHDW_CR
,
AT91_SHDW_KEY
|
AT91_SHDW_SHDW
);
}
#ifdef RT_USING_FINSH
#include <finsh.h>
FINSH_FUNCTION_EXPORT_ALIAS
(
rt_hw_cpu_reset
,
reset
,
restart
the
system
);
#ifdef FINSH_USING_MSH
int
cmd_reset
(
int
argc
,
char
**
argv
)
{
rt_hw_cpu_reset
();
return
0
;
}
int
cmd_shutdown
(
int
argc
,
char
**
argv
)
{
rt_hw_cpu_shutdown
();
return
0
;
}
FINSH_FUNCTION_EXPORT_ALIAS
(
cmd_reset
,
__cmd_reset
,
restart
the
system
.);
FINSH_FUNCTION_EXPORT_ALIAS
(
cmd_shutdown
,
__cmd_shutdown
,
shutdown
the
system
.);
#endif
#endif
/*@}*/
bsp/at91sam9260/rtconfig.h
浏览文件 @
0f6e68ff
...
...
@@ -91,6 +91,7 @@
#define FINSH_USING_SYMTAB
#define FINSH_USING_DESCRIPTION
#define FINSH_THREAD_STACK_SIZE 4096
#define FINSH_USING_MSH
/* SECTION: C++ support */
/* Using C++ support */
...
...
@@ -256,4 +257,7 @@
* #define RT_DFS_ELM_MAX_LFN 128
*/
#define RT_USING_COMPONENTS_INIT
#define RT_USING_USER_MAIN
#endif
bsp/at91sam9260/rtconfig.py
浏览文件 @
0f6e68ff
...
...
@@ -10,8 +10,7 @@ if os.getenv('RTT_CC'):
if
CROSS_TOOL
==
'gcc'
:
PLATFORM
=
'gcc'
EXEC_PATH
=
'D:/ArdaArmTools/Sourcery_Lite/bin'
#EXEC_PATH = 'D:/ArdaArmTools/GNUARM_4.9_2015q1/bin'
EXEC_PATH
=
r
'D:\arm-2013.11\bin'
elif
CROSS_TOOL
==
'keil'
:
PLATFORM
=
'armcc'
EXEC_PATH
=
'C:/Keil_v5'
...
...
@@ -34,7 +33,6 @@ TARGET_NAME = 'rtthread.bin'
if
PLATFORM
==
'gcc'
:
# toolchains
PREFIX
=
'arm-none-eabi-'
#PREFIX = 'arm-none-linux-gnueabi-'
CC
=
PREFIX
+
'gcc'
AS
=
PREFIX
+
'gcc'
AR
=
PREFIX
+
'ar'
...
...
libcpu/arm/arm926/start_gcc.S
浏览文件 @
0f6e68ff
...
...
@@ -95,8 +95,8 @@ SVC_STACK_START:
.
section
.
init
,
"ax"
.
arm
.
global
entry
entry
:
.
global
start
start
:
LDR
PC
,
vector_reset
LDR
PC
,
vector_undef
LDR
PC
,
vector_swi
...
...
@@ -204,7 +204,7 @@ ctor_loop:
ctor_end
:
@
; Enter the C code
LDR
R0
,
=
main
LDR
R0
,
=
rtthread_startup
BLX
R0
@
;----------------- Exception Handler -----------------------------------------
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录