diff --git a/bsp/stmsky001/project.Uv2 b/bsp/stmsky001/project.Uv2 index 654b0627f7d8e8ed85e3dd6320a87a1a378ebf27..8ddc8bde9f9a0d91f8b9be6ed8ab781a6592fdc3 100644 --- a/bsp/stmsky001/project.Uv2 +++ b/bsp/stmsky001/project.Uv2 @@ -1,7 +1,7 @@ ### uVision2 Project, (C) Keil Software ### Do not modify ! -Target (RT-Thread/STMSky), 0x0004 // Tools: 'ARM-ADS' +Target (RT-Thread STMSky), 0x0004 // Tools: 'ARM-ADS' Group (Startup) Group (Library) @@ -78,7 +78,7 @@ File 5,1,<..\..\finsh\symbol.c> File 5,1,<..\..\finsh\cmd.c> -Options 1,0,0 // Target 'RT-Thread/STMSky' +Options 1,0,0 // Target 'RT-Thread STMSky' Device (STM32F103ZE) Vendor (STMicroelectronics) Cpu (IRAM(0x20000000-0x2000FFFF) IROM(0x8000000-0x807FFFF) CLOCK(8000000) CPUTYPE("Cortex-M3")) @@ -161,9 +161,9 @@ Options 1,0,0 // Target 'RT-Thread/STMSky' ADSLDIF () ADSLDDW () OPTDL (SARMCM3.DLL)()(DARMSTM.DLL)(-pSTM32F103ZE)(SARMCM3.DLL)()(TARMSTM.DLL)(-pSTM32F103ZE) - OPTDBG 48117,7,()()()()()()()()()() (Segger\JL2CM3.dll)()()() + OPTDBG 48118,7,()()()()()()()()()() (Segger\JL2CM3.dll)()()() FLASH1 { 9,0,0,0,1,0,0,0,5,16,0,0,0,0,0,0,0,0,0,0 } - FLASH2 (Segger\JLTAgdi.dll) + FLASH2 (Segger\JL2CM3.dll) FLASH3 ("" ()) FLASH4 () EndOpt diff --git a/bsp/stmsky001/startup.c b/bsp/stmsky001/startup.c index 4a2092e750489670d2cb54abf233a048a08e4c4c..15d00e9a257edc37dd583f1212a39f76226bf52b 100644 --- a/bsp/stmsky001/startup.c +++ b/bsp/stmsky001/startup.c @@ -1,156 +1,156 @@ -/* - * 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 -#include - +/* + * 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 +#include + #include "board.h" #include "rtc.h" - + #ifdef RT_USING_LWIP #include #include "enc28j60.h" -#endif - -/** - * @addtogroup STM32 - */ - -/*@{*/ -#ifdef RT_USING_FINSH -extern void finsh_system_init(void); -extern void finsh_set_device(char* device); -#endif - -extern int rt_application_init(void); - -#ifndef RT_USING_BOARD_SRAM -#ifdef __CC_ARM -extern int Image$$RW_IRAM1$$ZI$$Limit; -#elif __ICCARM__ -#pragma section="HEAP" -#else -extern int __bss_end; -#endif #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 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(); - + +/** + * @addtogroup STM32 + */ + +/*@{*/ +#ifdef RT_USING_FINSH +extern void finsh_system_init(void); +extern void finsh_set_device(char* device); +#endif + +extern int rt_application_init(void); + +#ifndef RT_USING_BOARD_SRAM +#ifdef __CC_ARM +extern int Image$$RW_IRAM1$$ZI$$Limit; +#elif __ICCARM__ +#pragma section="HEAP" +#else +extern int __bss_end; +#endif +#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 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 RT_USING_BOARD_SRAM rt_system_heap_init((void*)BOARD_SRAM_BEGIN, (void*)BOARD_SRAM_END); -#else -#ifdef __CC_ARM - rt_system_heap_init((void*)&Image$$RW_IRAM1$$ZI$$Limit, (void*)0x20010000); -#elif __ICCARM__ - rt_system_heap_init(__segment_end("HEAP"), (void*)0x20010000); -#else - /* init memory system */ - rt_system_heap_init((void*)&__bss_end, (void*)0x20010000); +#else +#ifdef __CC_ARM + rt_system_heap_init((void*)&Image$$RW_IRAM1$$ZI$$Limit, (void*)0x20010000); +#elif __ICCARM__ + rt_system_heap_init(__segment_end("HEAP"), (void*)0x20010000); +#else + /* init memory system */ + rt_system_heap_init((void*)&__bss_end, (void*)0x20010000); +#endif #endif -#endif -#endif - - /* init scheduler system */ - rt_system_scheduler_init(); - -#ifdef RT_USING_LWIP - eth_system_device_init(); - - /* register ethernetif device */ - rt_hw_enc28j60_init(); #endif - + + /* init scheduler system */ + rt_system_scheduler_init(); + +#ifdef RT_USING_LWIP + eth_system_device_init(); + + /* register ethernetif device */ + rt_hw_enc28j60_init(); +#endif + rt_hw_rtc_init(); - - /* init hardware serial device */ - rt_hw_usart_init(); -#ifdef RT_USING_DFS - rt_hw_sdcard_init(); -#endif - - /* init all device */ - rt_device_init_all(); - - /* init application */ - rt_application_init(); - -#ifdef RT_USING_FINSH - /* init finsh */ - finsh_system_init(); -#ifdef RT_USING_DEVICE - finsh_set_device("uart1"); -#endif -#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(); - rtthread_startup(); - - return 0; -} - -/*@}*/ + + /* init hardware serial device */ + rt_hw_usart_init(); +#ifdef RT_USING_DFS + rt_hw_sdcard_init(); +#endif + + /* init all device */ + rt_device_init_all(); + + /* init application */ + rt_application_init(); + +#ifdef RT_USING_FINSH + /* init finsh */ + finsh_system_init(); +#ifdef RT_USING_DEVICE + finsh_set_device("uart1"); +#endif +#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(); + rtthread_startup(); + + return 0; +} + +/*@}*/ diff --git a/bsp/stmsky001/stm32f10x.h b/bsp/stmsky001/stm32f10x.h new file mode 100644 index 0000000000000000000000000000000000000000..7460805ec4c37532dfb566a0461c6834190e8ba1 --- /dev/null +++ b/bsp/stmsky001/stm32f10x.h @@ -0,0 +1,6 @@ +#ifndef __STM32F10X_H__ +#define __STM32F10X_H__ + +#include + +#endif