Since we are not going to talk about RT-thread during work hours, you can go to http://www.rt-thread.org/to understand it.
Previously, we transplanted UCOS + lwip1.1 in ads, which is not very stable.
RT-thread on LWIP optimization is good, rt-thread0.3.1 BSP contains the mini2440 Development Board porting package.
2410 and 2440 are slightly different.
Then start porting.
1. Download The rt-thread0.3.1 from SVN or download it at http://www.rt-thread.org.
2. After decompression, create a new working directory and copy it:
RT-Thread-0.3.1/include
RT-Thread-0.3.1/libcpu/ARM/s3c24x0 (I use Keil, if IAR, It is libcpu ia32)
RT-Thread-0.3.1/src
RT-Thread-0.3.1/bsp/mini2440
Board. H, board. C, application. C, startup. C, console. c
3. Create a Keil Project, for example:
Scatter file:
; **************************************** *********************
; *** Scatter-loading description file generated by uvision ***
; **************************************** *********************
; Run in Ram
Lr_rom1 0x30000000 {; load region
Er_rom1 0x30000000 0x02000000 {; load address = Execution address
*. O (reset, + first)
* (Inroot $ sections)
. Any (+ RO)
}
Rw_ram1 0x30200000 0x3e00000 {; RW data
. Any (+ RW + zi)
}
Rw_iram1 0x40000000 0x00001000 {
. Any (+ RW + zi)
}
}
Ram debugging Initialization File
// **** <Use configuration! Disalbe! Wizard in context menu >>> ***
Func void setup (void)
{
// <O> program entry point
_ Wdword (0x53000000, 0x00000000 );
_ Wdword (0x4a000008, 0 xffffffff );
_ Wdword (0x4a00001c, 0x000007ff );
_ Wdword (0x4c000014, 0x00000003 );
_ Wdword (0x4c000004, 0x0005c042 );
_ Wdword (0x56000070, 0x00280000 );
_ Wdword (0x56000078, 0x00000000 );
_ Wdword (0x48000000, 0x22111110 );
_ Wdword (0x48000004, 0x00000700 );
_ Wdword (0x48000008, 0x00000700 );
_ Wdword (0x4800000c, 0x00000700 );
_ Wdword (0x48000010, 0x00000700 );
_ Wdword (0x48000014, 0x00000700 );
_ Wdword (0x48000018, 0x00000700 );
_ Wdword (0x481_1c, 0x00018005 );
_ Wdword (0x48000020, 0x00000700 );
_ Wdword (0x48000024, 0x008e0459 );
_ Wdword (0x48000028, 0x000000b2 );
_ Wdword (0x481_2c, 0x00000030 );
_ Wdword (0x48000030, 0x00000030 );
_ Wdword (0x56000014, 0x00000001 );
_ Wdword (0x56000020, 0xaaaa55aa );
_ Wdword (0x56000028, 0x0000ffff );
_ Wdword (0x56000024, 0x00000000 );
}
Setup (); // setup for init
Load OBJ/uart_test.axf incremental // download
PC = 0x30000000; // <o> program entry point
G, main // run to Main Function
Setup (); // setup for running
,,,,,,,,,,,,,,,,,,,,,,,,,,,
PS: The led finally flashed. I disabled MMU, and the initial address of SDRAM was not mapped to address 0. Finally, I saw a ram_intvec in the startup code, after the macro is declared in option, it is enough to copy the interrupted table to address 0.