diff --git a/README.md b/README.md index 621a26702..7aa3854ca 100644 --- a/README.md +++ b/README.md @@ -3,25 +3,28 @@ [![Build Status](https://travis-ci.org/RT-Thread/rt-thread.svg)](https://travis-ci.org/RT-Thread/rt-thread) [![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/RT-Thread/rt-thread?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -RT-Thread is an open source real-time operating system for embedded devices from China. RT-Thread RTOS is a scalable real-time operating system: a tiny kernel for ARM Cortex-M0, Cortex-M3/4, or a full feature system in ARM Cortex-A8, ARM Cortex-A9 DualCore etc. +RT-Thread is an open source real-time operating system for embedded devices from China. RT-Thread RTOS is a scalable real-time operating system: a tiny kernel for ARM Cortex-M0, Cortex-M3/4/7, or a rich feature system like ARM Cortex-A8, ARM Cortex-A9 DualCore etc. ## Overview ## RT-Thread RTOS like a traditional real-time operating system. The kernel has real-time multi-task scheduling, semaphore, mutex, mail box, message queue etc. However, it has two different things: * Device Driver; -* Component. +* Component; +* Application Module -The device driver is more like a driver framework, UART, SPI, USB device/host, EMAC, MTD NAND etc. The developer can easily add low level driver and board configuration, then he/she can use lots of features. +The device driver is more like a driver framework, UART, IIC, SPI, SDIO, USB device/host, EMAC, MTD NAND etc. The developer can easily add low level driver and board configuration, then he/she can use lots of features. -The Component is a software concept upon RT-Thread kernel, for example a shell (finsh shell), virtual file system (FAT, YAFFS, UFFS, ROM/RAM file system etc), TCP/IP protocol stack (lwIP), POSIX interface etc. One component must be a directory under RT-Thread/Components and one component can be descripted by a SConscript file (then be compiled and linked into the system). +The Component is a software concept upon RT-Thread kernel, for example a shell (finsh/msh shell), virtual file system (FAT, YAFFS, UFFS, ROM/RAM file system etc), TCP/IP protocol stack (lwIP), POSIX (thread) interface etc. One component must be a directory under RT-Thread/Components and one component can be descripted by a SConscript file (then be compiled and linked into the system). + +The Appliation Module, or User Applicaion (UA) is a dyanmic loaded module, it can be compiled standalone without Kernel. Each UA has its own object container to manage thread/semaphore/kernel object which was created or initialized inside this UA. More information about UA, please visit another [git repo](https://github.com/RT-Thread/rtthread-apps). ## Board Support Package ## RT-Thread RTOS can support many architectures: * ARM Cortex-M0 -* ARM Cortex-M3/M4 +* ARM Cortex-M3/M4/7 * ARM Cortex-R4 * ARM Cortex-A8/A9 * ARM920T/ARM926 etc @@ -37,32 +40,30 @@ As a special exception, including RT-Thread RTOS header files in a file, instant ## Usage ## -RT-Thread RTOS uses [scons](http://www.scons.org) as its building system. Therefore, please install scons and Python 2.7 firstly. +RT-Thread RTOS uses [scons](http://www.scons.org) as building system. Therefore, please install scons and Python 2.7 firstly. -So far, the RT-Thread scons building system support the command line compiling or generate some IDE's project. There are some option varaibles in the scons building script: - -In rtconfig.py file: +So far, the RT-Thread scons building system support the command line compile or generate some IDE's project. There are some option varaibles in the scons building script (rtconfig.py): * ```CROSS_TOOL``` the compiler which you want to use, gcc/keil/iar. * ```EXEC_PATH``` the path of compiler. In SConstruct file: -```RTT_ROOT``` This variable is the root directory of RT-Thread RTOS. If you build the porting in the bsp directory, you can use the default value. Also, you can set the root directory in ```RTT_ROOT``` environment variable. +```RTT_ROOT``` This variable is the root directory of RT-Thread RTOS. If you build the porting in the bsp directory, you can use the default setting. Also, you can set the root directory in ```RTT_ROOT``` environment variable and not modify SConstruct files. When you set these variables correctly, you can use command: scons - - under BSP directory to simplely compile RT-Thread RTOS. -If you want to generate the IDE's project file, firstly you should change the ```RTT_CC``` in the rtconfig.py file. Then use command: +under BSP directory to simplely compile RT-Thread RTOS. - scons --target=mdk/mdk4/iar/cb -s +If you want to generate the IDE's project file, you can use command: +s + scons --target=mdk/mdk4/mdk5/iar/cb -s to generate the project file. -NOTE: RT-Thread scons building system will tailor the system according to your rtconfig.h configuration header file. For example, if you disable the lwIP in the rtconfig.h by commenting the ```#define RT_USING_LWIP```, the generated project file has no lwIP related files. +NOTE: RT-Thread scons building system will tailor the system according to your rtconfig.h configuration header file. For example, if you disable the lwIP in the rtconfig.h by commenting the ```#define RT_USING_LWIP```, the generated project file should have no lwIP related files. ## Contribution ## diff --git a/bsp/lm3s8962/applications/startup.c b/bsp/lm3s8962/applications/startup.c index 7f34aeef9..1f206a51b 100644 --- a/bsp/lm3s8962/applications/startup.c +++ b/bsp/lm3s8962/applications/startup.c @@ -142,10 +142,8 @@ void rtthread_startup(void) int main(void) { - rt_uint32_t level UNUSED; - /* disable interrupt first */ - level = rt_hw_interrupt_disable(); + rt_hw_interrupt_disable(); rtthread_startup(); return 0; diff --git a/bsp/lpc2148/drivers/serial.c b/bsp/lpc2148/drivers/serial.c index 6cfcbb18a..e8dcda2d0 100644 --- a/bsp/lpc2148/drivers/serial.c +++ b/bsp/lpc2148/drivers/serial.c @@ -66,7 +66,7 @@ void rt_hw_serial_init(void); void rt_hw_uart_isr(struct rt_lpcserial* lpc_serial) { - UNUSED rt_uint32_t iir; + RT_UNUSED rt_uint32_t iir; RT_ASSERT(lpc_serial != RT_NULL) diff --git a/bsp/lpc2478/drivers/serial.c b/bsp/lpc2478/drivers/serial.c index 8a0e1aa15..9bb95f2e0 100644 --- a/bsp/lpc2478/drivers/serial.c +++ b/bsp/lpc2478/drivers/serial.c @@ -66,7 +66,7 @@ void rt_hw_serial_init(void); void rt_hw_uart_isr(int irqno, void *param) { - UNUSED rt_uint32_t iir; + RT_UNUSED rt_uint32_t iir; struct rt_lpcserial* lpc_serial = (struct rt_lpcserial*)param; RT_ASSERT(lpc_serial != RT_NULL) diff --git a/bsp/mb9bf500r/startup.c b/bsp/mb9bf500r/startup.c index 2549441b9..dc65496ba 100644 --- a/bsp/mb9bf500r/startup.c +++ b/bsp/mb9bf500r/startup.c @@ -90,10 +90,8 @@ void rtthread_startup(void) int main(void) { - rt_uint32_t UNUSED level; - /* disable interrupt first */ - level = rt_hw_interrupt_disable(); + rt_hw_interrupt_disable(); /* init system setting */ SystemInit(); diff --git a/bsp/mini4020/drivers/board.c b/bsp/mini4020/drivers/board.c index 72b75d484..b77d8faf5 100644 --- a/bsp/mini4020/drivers/board.c +++ b/bsp/mini4020/drivers/board.c @@ -51,7 +51,7 @@ void rt_serial_handler(int vector, void *param) { //rt_kprintf("in rt_serial_handler\n"); rt_int32_t stat = *(RP)UART0_IIR ; - UNUSED char c; + RT_UNUSED char c; /*Received data*/ if (((stat & 0x0E) >> 1) == 0x02) diff --git a/bsp/mini4020/drivers/sdcard.c b/bsp/mini4020/drivers/sdcard.c index 9b802d2ec..af3e3fd41 100644 --- a/bsp/mini4020/drivers/sdcard.c +++ b/bsp/mini4020/drivers/sdcard.c @@ -271,7 +271,7 @@ static rt_err_t sd_readblock(rt_uint32_t address, rt_uint8_t* buf) U32 complete,i; rt_uint8_t temp; rt_err_t err; - UNUSED rt_uint32_t discard; + RT_UNUSED rt_uint32_t discard; #ifdef USE_TIMEOUT rt_uint32_t to = 10; #endif diff --git a/bsp/nios_ii/startup.c b/bsp/nios_ii/startup.c index cb43a7ae0..25ebb5e4a 100644 --- a/bsp/nios_ii/startup.c +++ b/bsp/nios_ii/startup.c @@ -85,10 +85,8 @@ void rtthread_startup(void) int main(void) { - rt_uint32_t UNUSED level; - /* disable interrupt first */ - level = rt_hw_interrupt_disable(); + rt_hw_interrupt_disable(); /* startup RT-Thread RTOS */ rtthread_startup(); diff --git a/bsp/stm32f0x/rtconfig.h b/bsp/stm32f0x/rtconfig.h index f72cdfa6d..03fa50ba3 100644 --- a/bsp/stm32f0x/rtconfig.h +++ b/bsp/stm32f0x/rtconfig.h @@ -83,11 +83,13 @@ #define FINSH_THREAD_STACK_SIZE 1024 #define FINSH_HISTORY_LINES 1 /* Using symbol table */ -#define FINSH_USING_SYMTAB -#define FINSH_USING_DESCRIPTION +//#define FINSH_USING_SYMTAB +//#define FINSH_USING_DESCRIPTION +#define FINSH_USING_MSH +#define FINSH_USING_MSH_ONLY /* SECTION: libc management */ -#define RT_USING_LIBC +// #define RT_USING_LIBC /* SECTION: device filesystem */ /* #define RT_USING_DFS */ diff --git a/components/drivers/include/drivers/sdio.h b/components/drivers/include/drivers/sdio.h index 6533ec3cb..b52af3830 100644 --- a/components/drivers/include/drivers/sdio.h +++ b/components/drivers/include/drivers/sdio.h @@ -181,6 +181,12 @@ rt_int32_t sdio_io_rw_extended(struct rt_mmcsd_card *card, rt_uint8_t *buf, rt_uint32_t blocks, rt_uint32_t blksize); +rt_int32_t sdio_io_rw_extended_block(struct rt_sdio_function *func, + rt_int32_t rw, + rt_uint32_t addr, + rt_int32_t op_code, + rt_uint8_t *buf, + rt_uint32_t len); rt_uint8_t sdio_io_readb(struct rt_sdio_function *func, rt_uint32_t reg, rt_int32_t *err); diff --git a/components/drivers/sdio/sdio.c b/components/drivers/sdio/sdio.c index 7817ae5c5..6b2d655dd 100644 --- a/components/drivers/sdio/sdio.c +++ b/components/drivers/sdio/sdio.c @@ -244,7 +244,7 @@ rt_inline rt_uint32_t sdio_max_block_size(struct rt_sdio_function *func) return MIN(size, 512u); /* maximum size for byte mode */ } -static rt_int32_t sdio_io_rw_extended_block(struct rt_sdio_function *func, +rt_int32_t sdio_io_rw_extended_block(struct rt_sdio_function *func, rt_int32_t rw, rt_uint32_t addr, rt_int32_t op_code, @@ -1325,6 +1325,7 @@ rt_int32_t sdio_register_driver(struct rt_sdio_driver *driver) return -RT_ENOMEM; } + sd->drv = driver; rt_list_insert_after(&sdio_drivers, &sd->list); if (!rt_list_isempty(&sdio_cards))