delete the evb4020 and sep4020 branches, now We only maintain mini4020 branch.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1291 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
dennis.zhang.os@gmail.com
2011-02-26 09:25:51 +00:00
parent 9236274689
commit 835ee58a4b
42 changed files with 0 additions and 21321 deletions
-2
View File
@@ -1,2 +0,0 @@
[EXTDLL]
Count=0
-25
View File
@@ -1,25 +0,0 @@
/******************************************************************************/
/* MEMORY.INI: Memory Debug Initialization File */
/******************************************************************************/
/* This file is part of the uVision/ARM development tools. */
/* Copyright (c) 2005-2006 Keil Software. All rights reserved. */
/* This software may only be used under the terms of a valid, current, */
/* end user licence from KEIL for a compatible version of KEIL software */
/* development tools. Nothing else gives you the right to use this software. */
/******************************************************************************/
RESET
FUNC void InitEmi(void)
{
_WWORD(0x11000000,0x08a6a6a1);
_WWORD(0x11000010,0x8cfffff1);
_WWORD(0x11000018,0x1e104177);
_WWORD(0x1100001C,0x80001860);
_WWORD(0x11000020,0x0000000b);
}
InitEmi();
Load %L INCREMENTAL;
PC = 0x30000000;
-14
View File
@@ -1,14 +0,0 @@
[FLASH]
SkipProgOnCRCMatch = 1
VerifyDownload = 1
AllowCaching = 1
EnableFlashDL = 2
Override = 0
Device="ADUC7020X62"
[BREAKPOINTS]
ShowInfoWin = 1
EnableFlashBP = 2
BPDuringExecution = 0
[CPU]
OverrideMemMap = 0
AllowSimulation = 1
Binary file not shown.
View File
-25
View File
@@ -1,25 +0,0 @@
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************
; *************************************************************
; *** Scatter-Loadig Description File generated by uVision ***n
; *************************************************************
LR_ROM1 0x30000000 0x0FFD00 ; load region size_region
{
ER_ROM1 0x30000000 0x0FFD00 ; load address = execution address
{
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
}
RW_RAM1 0x30100000 0x100000 ; RW data
{
.ANY (+RW +ZI)
}
}
-21
View File
@@ -1,21 +0,0 @@
*** Creating Trace Output File 'evb4020.tra' Ok.
### Preparing for ADS-LD.
### Creating ADS-LD Command Line
### List of Objects: adding '"startup.o"'
### List of Objects: adding '".\context_rvds.o"'
### List of Objects: adding '".\start_rvds.o"'
### ADS-LD Command completed:
--cpu ARM7TDMI "startup.o" ".\context_rvds.o" ".\start_rvds.o" --strict --scatter "evb4020.sct" ␍
--autoat --summary_stderr --info summarysizes --map --xref --callgraph --symbols ␍
--info sizes --info totals --info unused --info veneers ␍
--list ".\evb4020.map" -o "evb4020.axf"### Preparing Environment (PrepEnvAds)
### ADS-LD Output File: 'evb4020.axf'
### ADS-LD Command File: 'evb4020.lnp'
### Checking for dirty Components...
### Creating CmdFile 'evb4020.lnp', Handle=0x000006D0
### Writing '.lnp' file
### ADS-LD Command file 'evb4020.lnp' is ready.
### ADS-LD: About to start ADS-LD Thread.
### ADS-LD: executed with 0 errors
### Updating obj list
### LDADS_file() completed.
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
-1
View File
@@ -1 +0,0 @@
Dependencies for Project 'evb4020', Target 'Target 1': (DO NOT MODIFY !)
-18
View File
@@ -1,18 +0,0 @@
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************
LR_ROM1 0x20000200 0x0FFD00 ; load region size_region
{
ER_ROM1 0x20000200 0x0FFD00 ; load address = execution address
{
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
}
RW_RAM1 0x30100000 0x080000 ; RW data
{
.ANY (+RW +ZI)
}
}
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
-154
View File
@@ -1,154 +0,0 @@
<html>
<body>
<pre>
<h1>µVision Build Log</h1>
<h2>Project:</h2>
F:\rtt\bsp\evb4020\evb4020.uvproj
Project File Date: 10/26/2010
<h2>Output:</h2>
Build target 'EVB4020'
compiling startup.c...
compiling application.c...
compiling export.c...
compiling clock.c...
compiling device.c...
compiling idle.c...
compiling ipc.c...
compiling irq.c...
compiling kservice.c...
compiling mem.c...
compiling mempool.c...
compiling object.c...
compiling scheduler.c...
compiling slab.c...
compiling thread.c...
compiling timer.c...
assembling context_rvds.S...
assembling start_rvds.S...
compiling stack.c...
compiling trap.c...
compiling interrupt.c...
compiling cpu.c...
..\..\libcpu\arm\sep4020\cpu.c(21): warning: #1215-D: #warning directive: I DON'T KNOW IF THE MMU OPERATION WORKS ON SEP4020
..\..\libcpu\arm\sep4020\cpu.c: #warning I DON'T KNOW IF THE MMU OPERATION WORKS ON SEP4020
..\..\libcpu\arm\sep4020\cpu.c: ^
..\..\libcpu\arm\sep4020\cpu.c(187): warning: #236-D: controlling expression is constant
..\..\libcpu\arm\sep4020\cpu.c: RT_ASSERT(RT_NULL);
..\..\libcpu\arm\sep4020\cpu.c: ^
..\..\libcpu\arm\sep4020\cpu.c: ..\..\libcpu\arm\sep4020\cpu.c: 2 warnings, 0 errors
compiling board.c...
compiling serial.c...
compiling sdcard.c...
src\sdcard.c(359): warning: #177-D: function "sd_readmultiblock" was declared but never referenced
src\sdcard.c: static rt_uint8_t sd_readmultiblock(rt_uint32_t address, rt_uint8_t* buf,rt_uint32_t size)
src\sdcard.c: ^
src\sdcard.c: src\sdcard.c: 1 warning, 0 errors
compiling dm9161.c...
src\dm9161.c(363): warning: #1215-D: #warning directive: SHOULD SET MAC ADDR
src\dm9161.c: #warning SHOULD SET MAC ADDR
src\dm9161.c: ^
src\dm9161.c(369): warning: #1215-D: #warning directive: SHOULD DETERMIN LINK SPEED
src\dm9161.c: #warning SHOULD DETERMIN LINK SPEED
src\dm9161.c: ^
src\dm9161.c(487): warning: #1215-D: #warning directive: disable ether;
src\dm9161.c: #warning disable ether;
src\dm9161.c: ^
src\dm9161.c(534): warning: #1215-D: #warning directive: SHOULD DISABLE INTEERUPT?
src\dm9161.c: #warning SHOULD DISABLE INTEERUPT?
src\dm9161.c: ^
src\dm9161.c(563): warning: #1215-D: #warning directive: SHOULD NOTICE IT'S LENGTH
src\dm9161.c: #warning SHOULD NOTICE IT'S LENGTH
src\dm9161.c: ^
src\dm9161.c(616): warning: #177-D: variable "len" was declared but never referenced
src\dm9161.c: rt_int32_t len;
src\dm9161.c: ^
src\dm9161.c(664): warning: #1215-D: #warning directive: NOTICE:
src\dm9161.c: #warning NOTICE:
src\dm9161.c: ^
src\dm9161.c(688): warning: #1215-D: #warning directive: TODO
src\dm9161.c: #warning TODO
src\dm9161.c: ^
src\dm9161.c: src\dm9161.c: 8 warnings, 0 errors
compiling backtrace.c...
compiling div0.c...
compiling showmem.c...
compiling dfs.c...
compiling dfs_file.c...
compiling dfs_fs.c...
compiling dfs_posix.c...
compiling dfs_elm.c...
compiling ff.c...
compiling cmd.c...
compiling finsh_compiler.c...
compiling finsh_error.c...
compiling finsh_heap.c...
compiling finsh_init.c...
compiling finsh_node.c...
compiling finsh_ops.c...
compiling finsh_parser.c...
compiling finsh_token.c...
compiling finsh_var.c...
compiling finsh_vm.c...
compiling shell.c...
compiling symbol.c...
compiling api_lib.c...
compiling api_msg.c...
compiling err.c...
compiling netbuf.c...
compiling netdb.c...
compiling netifapi.c...
compiling sockets.c...
compiling tcpip.c...
compiling sys_arch.c...
compiling sys_arch_init.c...
compiling dhcp.c...
compiling dns.c...
compiling init.c...
compiling memp.c...
compiling netif.c...
compiling pbuf.c...
compiling raw.c...
compiling stats.c...
compiling sys.c...
compiling tcp.c...
compiling tcp_in.c...
compiling tcp_out.c...
compiling udp.c...
compiling autoip.c...
compiling icmp.c...
compiling igmp.c...
compiling inet.c...
compiling inet_chksum.c...
compiling ip.c...
compiling ip_addr.c...
compiling ip_frag.c...
compiling asn1_dec.c...
compiling asn1_enc.c...
compiling mib_structs.c...
compiling mib2.c...
compiling msg_in.c...
compiling msg_out.c...
compiling etharp.c...
compiling ethernetif.c...
compiling loopif.c...
compiling slipif.c...
compiling auth.c...
compiling chap.c...
compiling chpms.c...
compiling fsm.c...
compiling ipcp.c...
compiling lcp.c...
compiling magic.c...
compiling md5.c...
compiling pap.c...
compiling ppp.c...
compiling ppp_oe.c...
compiling randm.c...
compiling vj.c...
compiling ping.c...
linking...
Program Size: Code=96692 RO-data=3264 RW-data=468 ZI-data=17844
".\output\evb4020.axf" - 0 Error(s), 11 Warning(s).
Clean started: Project: 'evb4020'
deleting intermediate output files for target 'EVB4020'
-121
View File
@@ -1,121 +0,0 @@
*** Creating Trace Output File '.\output\evb4020.tra' Ok.
### Preparing for ADS-LD.
### Creating ADS-LD Command Line
### List of Objects: adding '".\output\startup.o"'
### List of Objects: adding '".\output\application.o"'
### List of Objects: adding '".\output\export.o"'
### List of Objects: adding '".\output\clock.o"'
### List of Objects: adding '".\output\device.o"'
### List of Objects: adding '".\output\idle.o"'
### List of Objects: adding '".\output\ipc.o"'
### List of Objects: adding '".\output\irq.o"'
### List of Objects: adding '".\output\kservice.o"'
### List of Objects: adding '".\output\mem.o"'
### List of Objects: adding '".\output\mempool.o"'
### List of Objects: adding '".\output\object.o"'
### List of Objects: adding '".\output\scheduler.o"'
### List of Objects: adding '".\output\slab.o"'
### List of Objects: adding '".\output\thread.o"'
### List of Objects: adding '".\output\timer.o"'
### List of Objects: adding '".\output\context_rvds.o"'
### List of Objects: adding '".\output\start_rvds.o"'
### List of Objects: adding '".\output\stack.o"'
### List of Objects: adding '".\output\trap.o"'
### List of Objects: adding '".\output\interrupt.o"'
### List of Objects: adding '".\output\cpu.o"'
### List of Objects: adding '".\output\board.o"'
### List of Objects: adding '".\output\serial.o"'
### List of Objects: adding '".\output\sdcard.o"'
### List of Objects: adding '".\output\dm9161.o"'
### List of Objects: adding '".\output\backtrace.o"'
### List of Objects: adding '".\output\div0.o"'
### List of Objects: adding '".\output\showmem.o"'
### List of Objects: adding '".\output\dfs.o"'
### List of Objects: adding '".\output\dfs_file.o"'
### List of Objects: adding '".\output\dfs_fs.o"'
### List of Objects: adding '".\output\dfs_posix.o"'
### List of Objects: adding '".\output\dfs_elm.o"'
### List of Objects: adding '".\output\ff.o"'
### List of Objects: adding '".\output\cmd.o"'
### List of Objects: adding '".\output\finsh_compiler.o"'
### List of Objects: adding '".\output\finsh_error.o"'
### List of Objects: adding '".\output\finsh_heap.o"'
### List of Objects: adding '".\output\finsh_init.o"'
### List of Objects: adding '".\output\finsh_node.o"'
### List of Objects: adding '".\output\finsh_ops.o"'
### List of Objects: adding '".\output\finsh_parser.o"'
### List of Objects: adding '".\output\finsh_token.o"'
### List of Objects: adding '".\output\finsh_var.o"'
### List of Objects: adding '".\output\finsh_vm.o"'
### List of Objects: adding '".\output\shell.o"'
### List of Objects: adding '".\output\symbol.o"'
### List of Objects: adding '".\output\api_lib.o"'
### List of Objects: adding '".\output\api_msg.o"'
### List of Objects: adding '".\output\err.o"'
### List of Objects: adding '".\output\netbuf.o"'
### List of Objects: adding '".\output\netdb.o"'
### List of Objects: adding '".\output\netifapi.o"'
### List of Objects: adding '".\output\sockets.o"'
### List of Objects: adding '".\output\tcpip.o"'
### List of Objects: adding '".\output\sys_arch.o"'
### List of Objects: adding '".\output\sys_arch_init.o"'
### List of Objects: adding '".\output\dhcp.o"'
### List of Objects: adding '".\output\dns.o"'
### List of Objects: adding '".\output\init.o"'
### List of Objects: adding '".\output\memp.o"'
### List of Objects: adding '".\output\netif.o"'
### List of Objects: adding '".\output\pbuf.o"'
### List of Objects: adding '".\output\raw.o"'
### List of Objects: adding '".\output\stats.o"'
### List of Objects: adding '".\output\sys.o"'
### List of Objects: adding '".\output\tcp.o"'
### List of Objects: adding '".\output\tcp_in.o"'
### List of Objects: adding '".\output\tcp_out.o"'
### List of Objects: adding '".\output\udp.o"'
### List of Objects: adding '".\output\autoip.o"'
### List of Objects: adding '".\output\icmp.o"'
### List of Objects: adding '".\output\igmp.o"'
### List of Objects: adding '".\output\inet.o"'
### List of Objects: adding '".\output\inet_chksum.o"'
### List of Objects: adding '".\output\ip.o"'
### List of Objects: adding '".\output\ip_addr.o"'
### List of Objects: adding '".\output\ip_frag.o"'
### List of Objects: adding '".\output\asn1_dec.o"'
### List of Objects: adding '".\output\asn1_enc.o"'
### List of Objects: adding '".\output\mib_structs.o"'
### List of Objects: adding '".\output\mib2.o"'
### List of Objects: adding '".\output\msg_in.o"'
### List of Objects: adding '".\output\msg_out.o"'
### List of Objects: adding '".\output\etharp.o"'
### List of Objects: adding '".\output\ethernetif.o"'
### List of Objects: adding '".\output\loopif.o"'
### List of Objects: adding '".\output\slipif.o"'
### List of Objects: adding '".\output\auth.o"'
### List of Objects: adding '".\output\chap.o"'
### List of Objects: adding '".\output\chpms.o"'
### List of Objects: adding '".\output\fsm.o"'
### List of Objects: adding '".\output\ipcp.o"'
### List of Objects: adding '".\output\lcp.o"'
### List of Objects: adding '".\output\magic.o"'
### List of Objects: adding '".\output\md5.o"'
### List of Objects: adding '".\output\pap.o"'
### List of Objects: adding '".\output\ppp.o"'
### List of Objects: adding '".\output\ppp_oe.o"'
### List of Objects: adding '".\output\randm.o"'
### List of Objects: adding '".\output\vj.o"'
### List of Objects: adding '".\output\ping.o"'
### ADS-LD Command completed:
--cpu ARM7TDMI ".\output\startup.o" ".\output\application.o" ".\output\export.o" ".\output\clock.o" ".\output\device.o" ".\output\idle.o" ".\output\ipc.o" ".\output\irq.o" ".\output\kservice.o" ".\output\mem.o" ".\output\mempool.o" ".\output\object.o" ".\output\scheduler.o" ".\output\slab.o" ".\output\thread.o" ".\output\timer.o" ".\output\context_rvds.o" ".\output\start_rvds.o" ".\output\stack.o" ".\output\trap.o" ".\output\interrupt.o" ".\output\cpu.o" ".\output\board.o" ".\output\serial.o" ".\output\sdcard.o" ".\output\dm9161.o" ".\output\backtrace.o" ".\output\div0.o" ".\output\showmem.o" ".\output\dfs.o" ".\output\dfs_file.o" ".\output\dfs_fs.o" ".\output\dfs_posix.o" ".\output\dfs_elm.o" ".\output\ff.o" ".\output\cmd.o" ".\output\finsh_compiler.o" ".\output\finsh_error.o" ".\output\finsh_heap.o" ".\output\finsh_init.o" ".\output\finsh_node.o" ".\output\finsh_ops.o" ".\output\finsh_parser.o" ".\output\finsh_token.o" ".\output\finsh_var.o" ".\output\finsh_vm.o" ".\output\shell.o" ".\output\symbol.o" ".\output\api_lib.o" ".\output\api_msg.o" ".\output\err.o" ".\output\netbuf.o" ".\output\netdb.o" ".\output\netifapi.o" ".\output\sockets.o" ".\output\tcpip.o" ".\output\sys_arch.o" ".\output\sys_arch_init.o" ".\output\dhcp.o" ".\output\dns.o" ".\output\init.o" ".\output\memp.o" ".\output\netif.o" ".\output\pbuf.o" ".\output\raw.o" ".\output\stats.o" ".\output\sys.o" ".\output\tcp.o" ".\output\tcp_in.o" ".\output\tcp_out.o" ".\output\udp.o" ".\output\autoip.o" ".\output\icmp.o" ".\output\igmp.o" ".\output\inet.o" ".\output\inet_chksum.o" ".\output\ip.o" ".\output\ip_addr.o" ".\output\ip_frag.o" ".\output\asn1_dec.o" ".\output\asn1_enc.o" ".\output\mib_structs.o" ".\output\mib2.o" ".\output\msg_in.o" ".\output\msg_out.o" ".\output\etharp.o" ".\output\ethernetif.o" ".\output\loopif.o" ".\output\slipif.o" ".\output\auth.o" ".\output\chap.o" ".\output\chpms.o" ".\output\fsm.o" ".\output\ipcp.o" ".\output\lcp.o" ".\output\magic.o" ".\output\md5.o" ".\output\pap.o" ".\output\ppp.o" ".\output\ppp_oe.o" ".\output\randm.o" ".\output\vj.o" ".\output\ping.o" --strict --scatter "evb4020.sct" ␍
--verbose --list=out.txt --autoat --summary_stderr --info summarysizes --map --xref --callgraph --symbols ␍
--info sizes --info totals --info unused --info veneers ␍
--list ".\evb4020.map" -o ".\output\evb4020.axf"### Preparing Environment (PrepEnvAds)
### ADS-LD Output File: '.\output\evb4020.axf'
### ADS-LD Command File: '.\output\evb4020.lnp'
### Checking for dirty Components...
### Creating CmdFile '.\output\evb4020.lnp', Handle=0x000002E8
### Writing '.lnp' file
### ADS-LD Command file '.\output\evb4020.lnp' is ready.
### ADS-LD: About to start ADS-LD Thread.
### ADS-LD: executed with 0 errors
### Updating obj list
### LDADS_file() completed.
-128
View File
@@ -1,128 +0,0 @@
/*
* 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
* 2007-11-20 Yi.Qiu add rtgui application
* 2008-6-28 Bernard no rtgui init
*/
/**
* @addtogroup mini2440
*/
/*@{*/
#include <board.h>
#include <rtthread.h>
#ifdef RT_USING_DFS
#include <dfs_init.h>
#include <dfs_elm.h>
#include <dfs_fs.h>
#include <dfs_posix.h>
#endif
static rt_uint8_t buf_init[0x200];
static struct rt_thread thread_test;
void rt_init_thread_entry(void* parameter)
{
int fd;
rt_uint32_t sz;
char buffer[20];
#ifdef RT_USING_DFS
dfs_init();
#ifdef RT_USING_DFS_ELMFATFS
elm_init();
/* mount sd card fat partition 1 as root directory */
if (dfs_mount("sd0", "/", "elm", 0, 0) == 0)
{
rt_kprintf("File System initialized!\n");
/*Open a file*/
fd = open("/fattest.txt", O_RDWR|O_CREAT, 0);
if (fd < 0)
{
rt_kprintf("open file for write failed\n");
return;
}
sz = write(fd,"Hello RT-Thread!",sizeof("Hello RT-Thread!"));
if(sz!=0)
{
rt_kprintf("written %d\n",sz);
}
else
rt_kprintf("haven't written\n");
lseek(fd,0,SEEK_SET);
sz = read(fd,buffer,sizeof(buffer));
if(sz!=0)
{
rt_kprintf("READ %d:",sz);
while(sz--)
rt_kprintf("%c",buffer[sz]);//opposite
rt_kprintf("\n");
}
else
rt_kprintf("haven't read\n");
close(fd);
}
else
rt_kprintf("File System initialzation failed!\n");
#endif
#endif
}
void rt_led_thread_entry(void* parameter)
{
/*
rt_uint32_t flag = 0;
while(1)
{
//Add your led implemention here
rt_led_put(flag^0x01);
rt_kprintf("rt led test %s\n",flag?"on":"off" );
rt_thread_delay(100);
} */
//rt_thread_suspend(rt_thread_self());
}
int rt_application_init()
{
rt_thread_t led_thread;
rt_err_t err;
err = rt_thread_init(&thread_test,"init",
rt_init_thread_entry, RT_NULL,buf_init,
sizeof(buf_init), 19, 20);
led_thread = rt_thread_create("led",
rt_led_thread_entry, RT_NULL,
512, 200, 20);
if(err == RT_EOK)
rt_thread_startup(&thread_test);
if (led_thread != RT_NULL)
rt_thread_startup(led_thread);
return 0;
}
/*@}*/
-159
View File
@@ -1,159 +0,0 @@
/*
* File : board.c
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009 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
* 2009-05-16 Bernard first implementation
* 2010-10-5 Wangmeng sep4020 implementation
*/
#include <rthw.h>
#include <rtthread.h>
#include <sep4020.h>
#include <serial.h>
void rt_hw_serial_putc(const char c);
#define UART0 ((struct uartport *)UART0_BASE)
struct rt_device uart0_device;
struct serial_int_rx uart0_int_rx;
struct serial_device uart0 =
{
UART0,
&uart0_int_rx,
RT_NULL
};
/**
* This function will handle rtos timer
*/
void rt_timer_handler(int vector)
{
rt_uint32_t clear_int;
rt_tick_increase();
/*Clear timer interrupt*/
clear_int = *(RP)TIMER_T1ISCR;
*(RP)TIMER_T1ISCR=clear_int;
}
/**
* This function will handle serial
*/
void rt_serial_handler(int vector)
{
//rt_kprintf("in rt_serial_handler\n");
rt_int32_t stat = *(RP)UART0_IIR ;
UNUSED char c;
/*Received data*/
if(((stat & 0x0E) >> 1) == 0x02)
{
rt_hw_serial_isr(&uart0_device);
/*while (((*(RP)UART0_LSR) & 0x40))
{
c = (char)(*(RP)UART0_BASE);
if(c == '\r')
{
rt_hw_serial_putc('\r');
rt_hw_serial_putc('\n');
}
else
rt_hw_serial_putc(c);
} */
}
else
{
/*clear the timeout interrupt*/
while (uart0.uart_device->lsr & USTAT_RCV_READY)
c = uart0.uart_device->dlbl_fifo.rxfifo;
}
}
/**
* This function will init timer4 for system ticks
*/
void rt_hw_timer_init()
{
/*Set timer1*/
*(RP)TIMER_T1LCR = 880000;
*(RP)TIMER_T1CR = 0x06;
rt_hw_interrupt_install(INTSRC_TIMER1, rt_timer_handler, RT_NULL);
rt_hw_interrupt_umask(INTSRC_TIMER1);
/*Enable timer1*/
*(RP)TIMER_T1CR |= 0x01;
}
/**
* This function will handle init uart
*/
void rt_hw_uart_init(void)
{
const rt_int32_t sysclk = 72000000;
/*Set data bit:8*/
*(RP)(UART0_LCR) = 0x83;
/*Set baud rate high*/
*(RP)(UART0_DLBH) = (sysclk/16/115200) >> 8;
/*Set baud rate low*/
*(RP)(UART0_DLBL) = (sysclk/16/115200) & 0xff;
*(RP)(UART0_LCR) = 0x83&(~(0x1 << 7));
/*Set trigger level*/
*(RP)(UART0_FCR) = 0x0;
*(RP)(UART0_IER) = 0x0;
/*Enable rx interrupt*/
*(RP)(UART0_IER) |= 0x01;
/*Disable tx interrupt*/
*(RP)(UART0_IER) &= ~(0x1<<1);
rt_hw_interrupt_install(INTSRC_UART0, rt_serial_handler, RT_NULL);
rt_hw_interrupt_umask(INTSRC_UART0);
}
void rt_hw_board_init()
{
/* initialize uart */
rt_hw_uart_init();
rt_hw_timer_init();
}
/* write one character to serial, must not trigger interrupt */
void rt_hw_serial_putc(const char c)
{
/*
to be polite with serial console add a line feed
to the carriage return character
*/
if (c=='\n')rt_hw_serial_putc('\r');
while (!((*(RP)UART0_LSR) & 0x40));
*(RP)(UART0_BASE) = c;
}
/**
* This function is used by rt_kprintf to display a string on console.
*
* @param str the displayed string
*/
void rt_hw_console_output(const char* str)
{
while (*str)
{
rt_hw_serial_putc(*str++);
}
}
-24
View File
@@ -1,24 +0,0 @@
/*
* File : board.h
* 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://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2006-10-08 Bernard add board.h to this bsp
* 2010-10-5 Wangmeng sep4020 implemention
*/
#ifndef __BOARD_H__
#define __BOARD_H__
#include <sep4020.h>
void rt_hw_board_init(void);
void rt_hw_sdcard_init(void);
#endif
File diff suppressed because it is too large Load Diff
-65
View File
@@ -1,65 +0,0 @@
#ifndef __DM9000_H__
#define __DM9000_H__
/*MACRO DEFINATIONS*/
#define SEP4020_ID_EMAC ((unsigned int) 28) // Ethernet Mac
/* Davicom 9161 PHY */
#define MII_DM9161_ID 0x0181b880
#define MII_DM9161A_ID 0x0181b8a0
/* Davicom specific registers */
#define MII_DSCR_REG 16
#define MII_DSCSR_REG 17
#define MII_DSINTR_REG 21
/* Intel LXT971A PHY */
#define MII_LXT971A_ID 0x001378E0
/* Intel specific registers */
#define MII_ISINTE_REG 18
#define MII_ISINTS_REG 19
#define MII_LEDCTRL_REG 20
/* Realtek RTL8201 PHY */
#define MII_RTL8201_ID 0x00008200
/* Broadcom BCM5221 PHY */
#define MII_BCM5221_ID 0x004061e0
/* Broadcom specific registers */
#define MII_BCMINTR_REG 26
/* National Semiconductor DP83847 */
#define MII_DP83847_ID 0x20005c30
/* Altima AC101L PHY */
#define MII_AC101L_ID 0x00225520
/* Micrel KS8721 PHY */
#define MII_KS8721_ID 0x00221610
/* ........................................................................ */
#define MAX_RBUFF_SZ 0x600 /* 1518 rounded up */
#define MAX_RX_DESCR 20 /* max number of receive buffers */
#define MAX_TBUFF_SZ 0x600 /* 1518 rounded up */
#define MAX_TX_DESCR 20 /* max number of receive buffers */
#define EMAC_DESC_DONE 0x00000001 /* bit for if DMA is done */
#define EMAC_DESC_WRAP 0x00000002 /* bit for wrap */
#define EMAC_BROADCAST 0x80000000 /* broadcast address */
#define EMAC_MULTICAST 0x40000000 /* multicast address */
#define EMAC_UNICAST 0x20000000 /* unicast address */
#define DM9161_inb(r) (*(volatile rt_uint8_t *)r)
#define DM9161_outb(r, d) (*(volatile rt_uint8_t *)r = d)
#define DM9161_inw(r) (*(volatile rt_uint16_t *)r)
#define DM9161_outw(r, d) (*(volatile rt_uint16_t *)r = d)
void rt_hw_dm9616_init(void);
#endif
-9
View File
@@ -1,9 +0,0 @@
#include <rtthread.h>
#include <finsh.h>
void testkkkk(void)
{
rt_kprintf("Hello wangmengmeng!\n");
return;
}
FINSH_FUNCTION_EXPORT(testkkkk,a test);
-130
View File
@@ -1,130 +0,0 @@
#ifndef __MII_H__
#define __MII_H__
/* Generic MII registers. */
#define MII_BMCR 0x00 /* Basic mode control register */
#define MII_BMSR 0x01 /* Basic mode status register */
#define MII_PHYSID1 0x02 /* PHYS ID 1 */
#define MII_PHYSID2 0x03 /* PHYS ID 2 */
#define MII_ADVERTISE 0x04 /* Advertisement control reg */
#define MII_LPA 0x05 /* Link partner ability reg */
#define MII_EXPANSION 0x06 /* Expansion register */
#define MII_CTRL1000 0x09 /* 1000BASE-T control */
#define MII_STAT1000 0x0a /* 1000BASE-T status */
#define MII_ESTATUS 0x0f /* Extended Status */
#define MII_DCOUNTER 0x12 /* Disconnect counter */
#define MII_FCSCOUNTER 0x13 /* False carrier counter */
#define MII_NWAYTEST 0x14 /* N-way auto-neg test reg */
#define MII_RERRCOUNTER 0x15 /* Receive error counter */
#define MII_SREVISION 0x16 /* Silicon revision */
#define MII_RESV1 0x17 /* Reserved... */
#define MII_LBRERROR 0x18 /* Lpback, rx, bypass error */
#define MII_PHYADDR 0x19 /* PHY address */
#define MII_RESV2 0x1a /* Reserved... */
#define MII_TPISTATUS 0x1b /* TPI status for 10mbps */
#define MII_NCONFIG 0x1c /* Network interface config */
/* Basic mode control register. */
#define BMCR_RESV 0x003f /* Unused... */
#define BMCR_SPEED1000 0x0040 /* MSB of Speed (1000) */
#define BMCR_CTST 0x0080 /* Collision test */
#define BMCR_FULLDPLX 0x0100 /* Full duplex */
#define BMCR_ANRESTART 0x0200 /* Auto negotiation restart */
#define BMCR_ISOLATE 0x0400 /* Disconnect DP83840 from MII */
#define BMCR_PDOWN 0x0800 /* Powerdown the DP83840 */
#define BMCR_ANENABLE 0x1000 /* Enable auto negotiation */
#define BMCR_SPEED100 0x2000 /* Select 100Mbps */
#define BMCR_LOOPBACK 0x4000 /* TXD loopback bits */
#define BMCR_RESET 0x8000 /* Reset the DP83840 */
/* Basic mode status register. */
#define BMSR_ERCAP 0x0001 /* Ext-reg capability */
#define BMSR_JCD 0x0002 /* Jabber detected */
#define BMSR_LSTATUS 0x0004 /* Link status */
#define BMSR_ANEGCAPABLE 0x0008 /* Able to do auto-negotiation */
#define BMSR_RFAULT 0x0010 /* Remote fault detected */
#define BMSR_ANEGCOMPLETE 0x0020 /* Auto-negotiation complete */
#define BMSR_RESV 0x00c0 /* Unused... */
#define BMSR_ESTATEN 0x0100 /* Extended Status in R15 */
#define BMSR_100FULL2 0x0200 /* Can do 100BASE-T2 HDX */
#define BMSR_100HALF2 0x0400 /* Can do 100BASE-T2 FDX */
#define BMSR_10HALF 0x0800 /* Can do 10mbps, half-duplex */
#define BMSR_10FULL 0x1000 /* Can do 10mbps, full-duplex */
#define BMSR_100HALF 0x2000 /* Can do 100mbps, half-duplex */
#define BMSR_100FULL 0x4000 /* Can do 100mbps, full-duplex */
#define BMSR_100BASE4 0x8000 /* Can do 100mbps, 4k packets */
/* Advertisement control register. */
#define ADVERTISE_SLCT 0x001f /* Selector bits */
#define ADVERTISE_CSMA 0x0001 /* Only selector supported */
#define ADVERTISE_10HALF 0x0020 /* Try for 10mbps half-duplex */
#define ADVERTISE_1000XFULL 0x0020 /* Try for 1000BASE-X full-duplex */
#define ADVERTISE_10FULL 0x0040 /* Try for 10mbps full-duplex */
#define ADVERTISE_1000XHALF 0x0040 /* Try for 1000BASE-X half-duplex */
#define ADVERTISE_100HALF 0x0080 /* Try for 100mbps half-duplex */
#define ADVERTISE_1000XPAUSE 0x0080 /* Try for 1000BASE-X pause */
#define ADVERTISE_100FULL 0x0100 /* Try for 100mbps full-duplex */
#define ADVERTISE_1000XPSE_ASYM 0x0100 /* Try for 1000BASE-X asym pause */
#define ADVERTISE_100BASE4 0x0200 /* Try for 100mbps 4k packets */
#define ADVERTISE_PAUSE_CAP 0x0400 /* Try for pause */
#define ADVERTISE_PAUSE_ASYM 0x0800 /* Try for asymetric pause */
#define ADVERTISE_RESV 0x1000 /* Unused... */
#define ADVERTISE_RFAULT 0x2000 /* Say we can detect faults */
#define ADVERTISE_LPACK 0x4000 /* Ack link partners response */
#define ADVERTISE_NPAGE 0x8000 /* Next page bit */
#define ADVERTISE_FULL (ADVERTISE_100FULL | ADVERTISE_10FULL | \
ADVERTISE_CSMA)
#define ADVERTISE_ALL (ADVERTISE_10HALF | ADVERTISE_10FULL | \
ADVERTISE_100HALF | ADVERTISE_100FULL)
/* Link partner ability register. */
#define LPA_SLCT 0x001f /* Same as advertise selector */
#define LPA_10HALF 0x0020 /* Can do 10mbps half-duplex */
#define LPA_1000XFULL 0x0020 /* Can do 1000BASE-X full-duplex */
#define LPA_10FULL 0x0040 /* Can do 10mbps full-duplex */
#define LPA_1000XHALF 0x0040 /* Can do 1000BASE-X half-duplex */
#define LPA_100HALF 0x0080 /* Can do 100mbps half-duplex */
#define LPA_1000XPAUSE 0x0080 /* Can do 1000BASE-X pause */
#define LPA_100FULL 0x0100 /* Can do 100mbps full-duplex */
#define LPA_1000XPAUSE_ASYM 0x0100 /* Can do 1000BASE-X pause asym*/
#define LPA_100BASE4 0x0200 /* Can do 100mbps 4k packets */
#define LPA_PAUSE_CAP 0x0400 /* Can pause */
#define LPA_PAUSE_ASYM 0x0800 /* Can pause asymetrically */
#define LPA_RESV 0x1000 /* Unused... */
#define LPA_RFAULT 0x2000 /* Link partner faulted */
#define LPA_LPACK 0x4000 /* Link partner acked us */
#define LPA_NPAGE 0x8000 /* Next page bit */
#define LPA_DUPLEX (LPA_10FULL | LPA_100FULL)
#define LPA_100 (LPA_100FULL | LPA_100HALF | LPA_100BASE4)
/* Expansion register for auto-negotiation. */
#define EXPANSION_NWAY 0x0001 /* Can do N-way auto-nego */
#define EXPANSION_LCWP 0x0002 /* Got new RX page code word */
#define EXPANSION_ENABLENPAGE 0x0004 /* This enables npage words */
#define EXPANSION_NPCAPABLE 0x0008 /* Link partner supports npage */
#define EXPANSION_MFAULTS 0x0010 /* Multiple faults detected */
#define EXPANSION_RESV 0xffe0 /* Unused... */
#define ESTATUS_1000_TFULL 0x2000 /* Can do 1000BT Full */
#define ESTATUS_1000_THALF 0x1000 /* Can do 1000BT Half */
/* N-way test register. */
#define NWAYTEST_RESV1 0x00ff /* Unused... */
#define NWAYTEST_LOOPBACK 0x0100 /* Enable loopback for N-way */
#define NWAYTEST_RESV2 0xfe00 /* Unused... */
/* 1000BASE-T Control register */
#define ADVERTISE_1000FULL 0x0200 /* Advertise 1000BASE-T full duplex */
#define ADVERTISE_1000HALF 0x0100 /* Advertise 1000BASE-T half duplex */
/* 1000BASE-T Status register */
#define LPA_1000LOCALRXOK 0x2000 /* Link partner local receiver status */
#define LPA_1000REMRXOK 0x1000 /* Link partner remote receiver status */
#define LPA_1000FULL 0x0800 /* Link partner 1000BASE-T full duplex */
#define LPA_1000HALF 0x0400 /* Link partner 1000BASE-T half duplex */
#endif
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-51
View File
@@ -1,51 +0,0 @@
#ifndef __SDCARD_H
#define __SDCARD_H
#include <rtthread.h>
#ifdef RT_USING_DFS
#include <sep4020.h>
#define INICLK 300000
#define SDCLK 24000000 //PCLK=49.392MHz
#define MMCCLK 15000000 //PCLK=49.392MHz
/*struct of the SDC*/
struct sd_c
{
__IO rt_uint32_t clk_ctl;
__IO rt_uint32_t soft_rst;
__IO rt_uint32_t arg;
__IO rt_uint32_t cmd;
__IO rt_uint32_t blk_sz;
__IO rt_uint32_t blk_cnt;
__IO rt_uint32_t trans_mode;
__O rt_uint32_t response0;
__O rt_uint32_t response1;
__O rt_uint32_t response2;
__O rt_uint32_t response3;
__IO rt_uint32_t rd_to_ctl;
__IO rt_uint32_t int_stat;
__IO rt_uint32_t int_stat_mask;
__O rt_uint32_t rx_fifo;
__I rt_uint32_t tx_fifo;
};
/*sdcard driver structure*/
struct sd_device
{
struct rt_device *device; /*rt_device*/
struct sd_c *sdc; /*SDCARD register*/
struct dfs_partition *part; /*dfs partitions*/
rt_uint8_t *sec_buf; /*sdcard buffer*/
rt_uint32_t part_num; /*partiont numbers*/
rt_uint32_t buf_size; /*buffer size*/
};
#endif
#endif
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-90
View File
@@ -1,90 +0,0 @@
/*
* File : serial.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://openlab.rt-thread.com/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2006-03-13 Bernard first version
* 2009-04-20 yi.qiu modified according bernard's stm32 version
* 2010-10-6 wangmeng added sep4020 surpport
*/
#ifndef __SERIAL_H__
#define __SERIAL_H__
#include <sep4020.h>
#define USTAT_RCV_READY 0x01 /* receive data ready */
#define USTAT_TXB_EMPTY 0x40 /* tx buffer empty */
#define BPS 115200 /* serial baudrate */
#define UART_RX_BUFFER_SIZE 64
#define UART_TX_BUFFER_SIZE 64
/*For sep4020's uart have several secondary function*/
/*we use union to decribe it*/
union dlbl_fifo
{
rt_uint32_t dlbl;
rt_uint32_t rxfifo;
rt_uint32_t txfifo;
};
union dlbh_ier
{
rt_uint32_t dlbh;
rt_uint32_t ier;
};
union iir_fcr
{
rt_uint32_t iir;
rt_uint32_t fcr;
};
struct serial_int_rx
{
rt_uint8_t rx_buffer[UART_RX_BUFFER_SIZE];
rt_uint32_t read_index, save_index;
};
struct serial_int_tx
{
rt_uint8_t tx_buffer[UART_TX_BUFFER_SIZE];
rt_uint32_t write_index, save_index;
};
typedef struct uartport
{
union dlbl_fifo dlbl_fifo;
union dlbh_ier dlbh_ier;
union iir_fcr iir_fcr;
rt_uint32_t lcr;
rt_uint32_t mcr;
rt_uint32_t lsr;
rt_uint32_t msr;
}uartport;
struct serial_device
{
uartport* uart_device;
/* rx structure */
struct serial_int_rx* int_rx;
/* tx structure */
struct serial_int_tx* int_tx;
};
rt_err_t rt_hw_serial_register(rt_device_t device, const char* name, rt_uint32_t flag, struct serial_device *serial);
void rt_hw_serial_isr(rt_device_t device);
#endif
-119
View File
@@ -1,119 +0,0 @@
#include <rthw.h>
#include <rtthread.h>
#include <sep4020.h>
#include <board.h>
#include <serial.h>
#include <finsh.h>
#ifdef RT_USING_LWIP
#include <lwip/sys.h>
#include <netif/ethernetif.h>
#endif
#define SDRAM_BASE 0x30000000
#ifdef __CC_ARM
extern int Image$$RW_RAM1$$ZI$$Limit;
#endif
extern void rt_application_init(void);
extern void finsh_system_init(void);
extern void sd_init(void);
extern rt_uint8_t sd_readblock(rt_uint32_t address, rt_uint8_t* buf);
extern rt_uint8_t sd_writeblock(rt_uint32_t address, rt_uint8_t* buf);
extern struct serial_device uart0;
extern struct rt_device uart0_device;
void rtthread_startup()
{
/* init hardware interrupt */
rt_hw_interrupt_init();
/* 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();
/* init heap memory system */
#ifdef __CC_ARM
rt_kprintf("base=%p\n",&Image$$RW_RAM1$$ZI$$Limit);
rt_system_heap_init((void*)&Image$$RW_RAM1$$ZI$$Limit, (void*)(SDRAM_BASE + 0x200000));
#else
rt_system_heap_init(&__bss_end, (void*)0x34000000);
#endif
/* init scheduler system */
rt_system_scheduler_init();
#ifdef RT_USING_DEVICE
/* register uart0 */
rt_hw_serial_register(&uart0_device, "uart0",
RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX | RT_DEVICE_FLAG_STREAM,
&uart0);
#ifdef RT_USING_DFS
rt_hw_sdcard_init();
#endif
#ifdef RT_USING_LWIP
eth_system_device_init();
rt_hw_dm9161_init();
#endif
/*init all registed devices */
rt_device_init_all();
#endif
/* init application */
rt_application_init();
#ifdef RT_USING_FINSH
/* init finsh */
finsh_system_init();
#ifdef RT_USING_DEVICE
finsh_set_device("uart0");
#endif
#endif
/* init idle thread */
rt_thread_idle_init();
/* start scheduler */
rt_system_scheduler_start();
/* never reach here */
return ;
}
int main()
{
rt_uint32_t UNUSED level;
/* disable interrupt first */
level = rt_hw_interrupt_disable();
/* startup RT-Thread RTOS */
rtthread_startup();
return 0;
}
-63
View File
@@ -1,63 +0,0 @@
#include <rtthread.h>
#include <lwip/netdb.h> /* 为了解析主机名,需要包含netdb.h头文件 */
#include <lwip/sockets.h> /* 使用BSD socket,需要包含sockets.h头文件 */
void tcp_senddata(const char* url, int port, int length)
{
struct hostent *host;
int sock, err, result, timeout, index;
struct sockaddr_in server_addr;
rt_uint8_t *buffer_ptr;
/* 通过函数入口参数url获得host地址(如果是域名,会做域名解析) */
host = gethostbyname(url);
/* 创建一个socket,类型是SOCKET_STREAM,TCP类型 */
if ((sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1)
{
/* 创建socket失败 */
rt_kprintf("Socket error\n");
return;
}
/* 神奇内存 */
buffer_ptr = rt_malloc(length);
/* 构造发生数据 */
for (index = 0; index < length; index ++)
buffer_ptr[index] = index & 0xff;
timeout = 100;
/* 设置发送超时时间100ms */
lwip_setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, &timeout, sizeof(timeout));
/* 初始化预连接的服务端地址 */
server_adlidr.sin_family = AF_INET;
server_addr.sin_port = htons(port);
server_addr.sin_addr = *((struct in_addr *)host->h_addr);
rt_memset(&(server_addr.sin_zero), 0, sizeof(server_addr.sin_zero));
/* 连接到服务端 */
err = connect(sock, (struct sockaddr *)&server_addr, sizeof(struct sockaddr));
rt_kprintf("TCP thread connect error code: %d\n", err);
while(1)
{
/* 发送数据到sock连接 */
result = send(sock, buffer_ptr, length, MSG_DONTWAIT);
if(result == -1) //数据发送错误处理
{
rt_kprintf("TCP thread send error: %d\n", result);
lwip_close(sock); //关闭连接,重新创建连接
rt_thread_delay(10);
if ((sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1)
rt_kprintf("TCP Socket error:%d\n",sock);
err = connect(sock, (struct sockaddr *)&server_addr, sizeof(struct sockaddr));
rt_kprintf("TCP thread connect error code: %d\n", err);
}
}
}
#ifdef RT_USING_FINSH
#include <finsh.h>
/* 输出tcpclient函数到finsh shell中 */
FINSH_FUNCTION_EXPORT(tcp_senddata, send a packet through tcp connection);
#endif
-40
View File
@@ -1,40 +0,0 @@
/******************************************************************************/
/* Ext_RAM.INI: External RAM (SDRAM) Initialization File */
/******************************************************************************/
// <<< Use Configuration Wizard in Context Menu >>> //
/******************************************************************************/
/* This file is part of the uVision/ARM development tools. */
/* Copyright (c) 2005-2008 Keil Software. All rights reserved. */
/* This software may only be used under the terms of a valid, current, */
/* end user licence from KEIL for a compatible version of KEIL software */
/* development tools. Nothing else gives you the right to use this software. */
/******************************************************************************/
FUNC void SetupForStart (void) {
// <o> Program Entry Point
PC = 0x30000000;
}
FUNC void Init (void) {
_WDWORD(0x1000200C, 0x00000000); // Disable Watchdog
// Clock Setup
_WDWORD(0x10001000, 0x00fa00fa); //
_WDWORD(0x10001014, 0x00000001); //
_WDWORD(0x10001004, 0x00004009); //
_WDWORD(0x10001004, 0x0000C009); //
_WDWORD(0x11000018, 0x1E104177); //
_WDWORD(0x1100001c, 0x80001860); //
}
Init(); // Initialize memory
LOAD build\rtthread-sep4020.axf INCREMENTAL // Download program
SetupForStart(); // Setup for Running
g, main // Goto Main
-14
View File
@@ -1,14 +0,0 @@
/******************************************************************************/
/* MEMORY.INI: Memory Debug Initialization File */
/******************************************************************************/
/* This file is part of the uVision/ARM development tools. */
/* Copyright (c) 2005-2006 Keil Software. All rights reserved. */
/* This software may only be used under the terms of a valid, current, */
/* end user licence from KEIL for a compatible version of KEIL software */
/* development tools. Nothing else gives you the right to use this software. */
/******************************************************************************/
MAP 0x00000000,0x0000FFFF READ EXEC // External ROM
MAP 0x30000000,0x31FFFFFF READ WRITE // External RAM
MAP 0x10000000,0x11000000 READ WRITE
MAP 0x11000000,0x12000000 READ WRITE
-86
View File
@@ -1,86 +0,0 @@
/*
* 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
*/
/**
* @addtogroup SEP4020
*/
/*@{*/
#include <rtthread.h>
#include "board.h"
static void rt_thread_entry_led1(void* parameter)
{
/* init led configuration */
/* rt_hw_led_init(); */
while (1)
{
/* led on */
//rt_kprintf("led1 on\r\n");
GPIO_PORTE_DATA |= 0x1<<3;
rt_thread_delay(50); /* sleep 0.5 second and switch to other thread */
/* led off */
//rt_kprintf("led1 off\r\n");
GPIO_PORTE_DATA &= ~(0x1<<3);
rt_thread_delay(50);
}
}
char thread_led2_stack[1024];
struct rt_thread thread_led2;
void rt_thread_entry_led2(void* parameter)
{
unsigned int count=0;
while (1)
{
/* led on */
//rt_kprintf("led2 on,count : %d\r\n",count);
count++;
GPIO_PORTE_DATA |= 0x1<<4;
rt_thread_delay(RT_TICK_PER_SECOND);
/* led off */
//rt_kprintf("led2 off\r\n");
GPIO_PORTE_DATA &= ~(0x1<<4);
rt_thread_delay(RT_TICK_PER_SECOND);
}
}
int rt_application_init()
{
rt_thread_t thread;
/* create led1 thread */
thread = rt_thread_create("led1",
rt_thread_entry_led1, RT_NULL,
512,
20, 5);
if (thread != RT_NULL)
rt_thread_startup(thread);
//------- init led2 thread
rt_thread_init(&thread_led2,
"led2",
rt_thread_entry_led2,
RT_NULL,
&thread_led2_stack[0],
sizeof(thread_led2_stack),10,10);
rt_thread_startup(&thread_led2);
return 0;
}
/*@}*/
-140
View File
@@ -1,140 +0,0 @@
/*
* File : board.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-23 Bernard first implementation
*/
#include <rtthread.h>
#include <rthw.h>
#include <sep4020.h>
#include "board.h"
#include "serial.h"
/**
* @addtogroup sep4020
*/
/*@{*/
extern rt_uint32_t rt_hw_get_clock(void);
/* uart0 */
#define UART0 ((struct uartport *)UART0BASE)
struct serial_int_rx uart0_int_rx;
struct serial_device uart0 =
{
UART0,
&uart0_int_rx,
RT_NULL
};
struct rt_device uart0_device;
/**
* This is the timer interrupt service routine.
* @param vector the irq number for timer
*/
void rt_hw_timer_handler(int vector)
{
/* clear interrupt */
TIMER_T1ISCR;
/* increase a tick */
rt_tick_increase();
}
/**
* This is the uart0 interrupt service routine.
* @param vector the irq number for uart0
*/
void rt_serial_handler(int vector)
{
rt_hw_serial_isr(&uart0_device);
}
/**
* This function will handle init uart.
*/
void rt_hw_uart_init(void)
{
rt_uint32_t baud;
rt_uint32_t sysclock;
sysclock = rt_hw_get_clock();
/* caculate baud rate register */
baud = sysclock/16/BR;
/* LCR */
uart0.uart_device->lcr = 0x83;
/* DLBH, IER */
uart0.uart_device->dlbh_ier = (baud>>8)&0xff;;
/* DLBL */
uart0.uart_device->dlbl_rxfifo_txfifo = baud&0xff;
/* LCR */
uart0.uart_device->lcr = 0x03;
/* IER */
uart0.uart_device->dlbh_ier = 0x01;
/* FCR */
uart0.uart_device->iir_fcr = 0x00;
rt_hw_serial_register(&uart0_device, "uart0",
RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX | RT_DEVICE_FLAG_STREAM,
&uart0);
/* install uart isr */
INTC_IER |= (1<<INT_UART0);
rt_hw_interrupt_install(INT_UART0, rt_serial_handler, RT_NULL);
rt_hw_interrupt_umask(INT_UART0);
}
/**
* This function will init led on the board
*/
static void rt_hw_board_led_init(void)
{
/* PE3 PE4 PE5 for led */
GPIO_PORTE_SEL |=0x38; /* GPIO */
GPIO_PORTE_DIR &= ~0x38; /* output*/
GPIO_PORTE_DATA &= ~0x38; /* low */
}
/**
* This function will init timer1 for system ticks
*/
static void rt_hw_timer_init(void)
{
TIMER_T1CR = 0x06; /* reload mode and interrupt enable */
TIMER_T1LCR = 0xAFC80; /* 10ms under 72MHz 0xAFC80=720000 */
INTC_IER |= (1<<INT_TIMER1); /* interrupt enable */
rt_hw_interrupt_install(INT_TIMER1, rt_hw_timer_handler, RT_NULL);
rt_hw_interrupt_umask(INT_TIMER1);
TIMER_T1CR |= 0x01; /* enable the timer 1 */
}
/**
* This function will initial sam7x board.
*/
void rt_hw_board_init()
{
/* init hardware uart */
rt_hw_uart_init();
rt_console_set_device("uart0");
/* init led */
rt_hw_board_led_init();
/* init timer for tick */
rt_hw_timer_init();
}
/*@}*/
-26
View File
@@ -1,26 +0,0 @@
/*
* File : board.h
* 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-10-08 Bernard add board.h to this bsp
*/
#ifndef __BOARD_H__
#define __BOARD_H__
#include <rthw.h>
#include <rtthread.h>
#include <sep4020.h>
#define BR 115200 /* Baud Rate */
void rt_hw_board_init(void);
#endif
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
-150
View File
@@ -1,150 +0,0 @@
/* RT-Thread config file */
#ifndef __RTTHREAD_CFG_H__
#define __RTTHREAD_CFG_H__
/* RT_NAME_MAX*/
#define RT_NAME_MAX 8
/* RT_ALIGN_SIZE*/
#define RT_ALIGN_SIZE 4
/* PRIORITY_MAX*/
#define RT_THREAD_PRIORITY_MAX 32
/* Tick per Second*/
#define RT_TICK_PER_SECOND 100
/* SECTION: RT_DEBUG */
/* Thread Debug*/
/* #define RT_THREAD_DEBUG */
/* Using Hook*/
#define RT_USING_HOOK
/* SECTION: IPC */
/* Using Semaphore*/
#define RT_USING_SEMAPHORE
/* Using Mutex*/
#define RT_USING_MUTEX
/* Using Event*/
#define RT_USING_EVENT
/* Using Faset Event*/
/* #define RT_USING_FASTEVENT */
/* Using MailBox*/
#define RT_USING_MAILBOX
/* Using Message Queue*/
#define RT_USING_MESSAGEQUEUE
/* SECTION: Memory Management */
/* Using Memory Pool Management*/
#define RT_USING_MEMPOOL
/* Using Dynamic Heap Management*/
#define RT_USING_HEAP
/* Using Small MM*/
#define RT_USING_SMALL_MEM
#define RT_MEM_STATS
/* Using SLAB Allocator*/
/* #define RT_USING_SLAB */
/* SECTION: Device System */
/* Using Device System*/
#define RT_USING_DEVICE
#define RT_USING_UART1
#define RT_UART_RX_BUFFER_SIZE 128
/* SECTION: Console options */
/* the buffer size of console*/
#define RT_CONSOLEBUF_SIZE 128
/* SECTION: FinSH shell options */
/* Using FinSH as Shell*/
#define RT_USING_FINSH
/* use symbol table */
#define FINSH_USING_SYMTAB
#define FINSH_USING_DESCRIPTION
/* SECTION: a mini libc */
/* Using mini libc library*/
/* #define RT_USING_MINILIBC */
/* SECTION: C++ support */
/* Using C++ support*/
/* #define RT_USING_CPLUSPLUS */
/* SECTION: lwip, a lighwight TCP/IP protocol stack */
/* Using lighweight TCP/IP protocol stack*/
//#define RT_USING_LWIP
/* Trace LwIP protocol*/
/* #define RT_LWIP_DEBUG */
/* LwIP tcp thread option */
#define RT_LWIP_TCPTHREAD_PRIORITY 8
#define RT_LWIP_TCPTHREAD_STACKSIZE 4096
#define RT_LWIP_TCPTHREAD_MBOX_SIZE 32
/* LwIP eth thread option */
#define RT_LWIP_ETHTHREAD_PRIORITY 15
#define RT_LWIP_ETHTHREAD_STACKSIZE 1024
#define RT_LWIP_ETHTHREAD_MBOX_SIZE 8
/* Enable ICMP protocol*/
#define RT_LWIP_ICMP
/* Enable IGMP protocol*/
#define RT_LWIP_IGMP
/* Enable UDP protocol*/
#define RT_LWIP_UDP
/* Enable TCP protocol*/
#define RT_LWIP_TCP
/* the number of simulatenously active TCP connections*/
#define RT_LWIP_TCP_PCB_NUM 5
/* TCP sender buffer space*/
#define RT_LWIP_TCP_SND_BUF 1500
/* Enable SNMP protocol*/
/* #define RT_LWIP_SNMP */
/* Using DHCP*/
/* #define RT_LWIP_DHCP */
/* ip address of target*/
#define RT_LWIP_IPADDR0 192
#define RT_LWIP_IPADDR1 168
#define RT_LWIP_IPADDR2 1
#define RT_LWIP_IPADDR3 30
/* gateway address of target*/
#define RT_LWIP_GWADDR0 192
#define RT_LWIP_GWADDR1 168
#define RT_LWIP_GWADDR2 1
#define RT_LWIP_GWADDR3 1
/* mask address of target*/
#define RT_LWIP_MSKADDR0 255
#define RT_LWIP_MSKADDR1 255
#define RT_LWIP_MSKADDR2 255
#define RT_LWIP_MSKADDR3 0
/* SECTION: DFS options */
//#define RT_USING_DFS
/* the max number of mounted filesystem */
#define DFS_FILESYSTEMS_MAX 1
/* the max number of opened files */
#define DFS_FD_MAX 2
/* the max number of cached sector */
#define DFS_CACHE_MAX_NUM 4
#endif
-15
View File
@@ -1,15 +0,0 @@
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************
LR_ROM1 0x00000000 0x00200000 { ; load region size_region
ER_ROM1 0x00000000 0x00200000 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
}
RW_RAM1 0x30000000 0x32000000 { ; RW data
.ANY (+RW +ZI)
}
}
-15
View File
@@ -1,15 +0,0 @@
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************
LR_ROM1 0x30000000 0x02000000 { ; load region size_region
ER_ROM1 0x30000000 0x02000000 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
}
RW_RAM1 0x31000000{
.ANY (+RW +ZI)
}
}
File diff suppressed because it is too large Load Diff
-132
View File
@@ -1,132 +0,0 @@
/*
* 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
*/
#include <rthw.h>
#include <rtthread.h>
#include "board.h"
/**
* @addtogroup STM32
*/
/*@{*/
extern int rt_application_init(void);
#ifdef RT_USING_FINSH
extern void finsh_system_init(void);
extern void finsh_set_device(const char* device);
#endif
#ifdef __CC_ARM
extern int Image$$RW_RAM1$$ZI$$Limit;
#elif __ICCARM__
#pragma section="HEAP"
#else
extern int __bss_end;
#endif
#ifdef DEBUG
/*******************************************************************************
* 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(u8* file, u32 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) ;
}
#endif
/**
* This function will startup RT-Thread RTOS.
*/
void rtthread_startup(void)
{
/* init hardware interrupt */
rt_hw_interrupt_init();
/* 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
#ifdef __CC_ARM
rt_system_heap_init((void*)&Image$$RW_RAM1$$ZI$$Limit, (void*)0x32000000);
#elif __ICCARM__
rt_system_heap_init(__segment_end("HEAP"), (void*)STM32_SRAM_END);
#else
/* init memory system */
rt_system_heap_init((void*)&__bss_end, (void*)STM32_SRAM_END);
#endif
#endif
/* init scheduler system */
rt_system_scheduler_init();
/* init all device */
rt_device_init_all();
/* init application */
rt_application_init();
#ifdef RT_USING_FINSH
/* init finsh */
finsh_system_init();
finsh_set_device("uart0");
#endif
/* init idle thread */
rt_thread_idle_init();
/* start scheduler */
rt_system_scheduler_start();
/* never reach here */
return ;
}
int main(void)
{
rt_uint32_t UNUSED level;
/* disable interrupt first */
level = rt_hw_interrupt_disable();
/* startup RT-Thread RTOS */
rtthread_startup();
return 0;
}
/*@}*/