diff --git a/bsp/lpc176x/SConstruct b/bsp/lpc176x/SConstruct index 827da21b313aa7f14eebf78dce2fafb07859fa02..f66c829c9d1e795d77c32a9a36aa5bc6e0f450ff 100644 --- a/bsp/lpc176x/SConstruct +++ b/bsp/lpc176x/SConstruct @@ -17,6 +17,11 @@ env = Environment(tools = ['mingw'], AR = rtconfig.AR, ARFLAGS = '-rc', LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS) +if rtconfig.PLATFORM == 'iar': + env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) + env.Replace(ARFLAGS = ['']) + env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map project.map']) + Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/lpc176x/lpc17xx_flash.icf b/bsp/lpc176x/lpc17xx_flash.icf new file mode 100644 index 0000000000000000000000000000000000000000..68d22fff9ed2f453a855137d7319db3f5c653f9b --- /dev/null +++ b/bsp/lpc176x/lpc17xx_flash.icf @@ -0,0 +1,32 @@ +/*###ICF### Section handled by ICF editor, don't touch! ****/ +/*-Editor annotation file-*/ +/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ +/*-Specials-*/ +define symbol __ICFEDIT_intvec_start__ = 0x00000000; +/*-Memory Regions-*/ +define symbol __ICFEDIT_region_ROM_start__ = 0x00000000; +define symbol __ICFEDIT_region_ROM_end__ = 0x0007FFFF; +define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; +define symbol __ICFEDIT_region_RAM_end__ = 0x2000FFFF; +/*-Sizes-*/ +define symbol __ICFEDIT_size_cstack__ = 0x400; +define symbol __ICFEDIT_size_heap__ = 0x800; +/**** End of ICF editor section. ###ICF###*/ + + +define memory mem with size = 4G; +define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; +define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; + +define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; +define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; + +initialize by copy { readwrite }; +//initialize by copy with packing = none { section __DLIB_PERTHREAD }; // Required in a multi-threaded application +do not initialize { section .noinit }; + +place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; + +place in ROM_region { readonly }; +place in RAM_region { readwrite, + block CSTACK, block HEAP }; diff --git a/bsp/lpc176x/project.ewp b/bsp/lpc176x/project.ewp index dcdc5f164f07142de3a64eb62e289798456f3074..9190a7aada04a4efdbdc7a2f10f46570a29af171 100644 --- a/bsp/lpc176x/project.ewp +++ b/bsp/lpc176x/project.ewp @@ -1,3 +1,5 @@ + + 2 @@ -10,7 +12,7 @@ General 3 - 17 + 20 1 1 - + + + ICCARM 2 - 21 + 26 1 1 - - + + + + + + + + + + + + AARM 2 - 7 + 8 1 1 - @@ -520,7 +568,7 @@ @@ -810,7 +890,7 @@ General 3 - 17 + 20 1 0 - + + + ICCARM 2 - 21 + 26 1 0 - - + + + + + + + + + + + + AARM 2 - 7 + 8 1 0 - @@ -1320,7 +1446,7 @@ - Startup - - $PROJ_DIR$\.\application.c - - - $PROJ_DIR$\.\startup.c - - - $PROJ_DIR$\.\board.c - + CMSIS - $PROJ_DIR$\.\uart.c + $PROJ_DIR$\CMSIS\CM3\CoreSupport\core_cm3.c - $PROJ_DIR$\.\led.c + $PROJ_DIR$\CMSIS\CM3\DeviceSupport\NXP\LPC17xx\startup\iar\startup_LPC17xx.s - $PROJ_DIR$\.\emac.c + $PROJ_DIR$\CMSIS\CM3\DeviceSupport\NXP\LPC17xx\system_LPC17xx.c - Kernel + CORTEX-M3 - $PROJ_DIR$\..\..\src\clock.c + $PROJ_DIR$\..\..\libcpu\arm\common\backtrace.c - $PROJ_DIR$\..\..\src\device.c + $PROJ_DIR$\..\..\libcpu\arm\cortex-m3\context_iar.S - $PROJ_DIR$\..\..\src\idle.c + $PROJ_DIR$\..\..\libcpu\arm\cortex-m3\cpuport.c - $PROJ_DIR$\..\..\src\ipc.c + $PROJ_DIR$\..\..\libcpu\arm\common\div0.c - $PROJ_DIR$\..\..\src\irq.c + $PROJ_DIR$\..\..\libcpu\arm\common\showmem.c + + + finsh - $PROJ_DIR$\..\..\src\kservice.c + $PROJ_DIR$\..\..\components\finsh\cmd.c - $PROJ_DIR$\..\..\src\mem.c + $PROJ_DIR$\..\..\components\finsh\finsh_compiler.c - $PROJ_DIR$\..\..\src\mempool.c + $PROJ_DIR$\..\..\components\finsh\finsh_error.c - $PROJ_DIR$\..\..\src\object.c + $PROJ_DIR$\..\..\components\finsh\finsh_heap.c - $PROJ_DIR$\..\..\src\scheduler.c + $PROJ_DIR$\..\..\components\finsh\finsh_init.c - $PROJ_DIR$\..\..\src\thread.c + $PROJ_DIR$\..\..\components\finsh\finsh_node.c - $PROJ_DIR$\..\..\src\timer.c + $PROJ_DIR$\..\..\components\finsh\finsh_ops.c - - - CORTEX-M3 - $PROJ_DIR$\..\..\libcpu\arm\cortex-m3\cpuport.c + $PROJ_DIR$\..\..\components\finsh\finsh_parser.c - $PROJ_DIR$\..\..\libcpu\arm\cortex-m3\context_iar.S + $PROJ_DIR$\..\..\components\finsh\finsh_token.c - $PROJ_DIR$\..\..\libcpu\arm\common\backtrace.c + $PROJ_DIR$\..\..\components\finsh\finsh_var.c - $PROJ_DIR$\..\..\libcpu\arm\common\div0.c + $PROJ_DIR$\..\..\components\finsh\finsh_vm.c - $PROJ_DIR$\..\..\libcpu\arm\common\showmem.c + $PROJ_DIR$\..\..\components\finsh\shell.c - - - finsh - $PROJ_DIR$\..\..\components\finsh\cmd.c + $PROJ_DIR$\..\..\components\finsh\symbol.c + + + Kernel - $PROJ_DIR$\..\..\components\finsh\finsh_compiler.c + $PROJ_DIR$\..\..\src\clock.c - $PROJ_DIR$\..\..\components\finsh\finsh_error.c + $PROJ_DIR$\..\..\src\device.c - $PROJ_DIR$\..\..\components\finsh\finsh_heap.c + $PROJ_DIR$\..\..\src\idle.c - $PROJ_DIR$\..\..\components\finsh\finsh_init.c + $PROJ_DIR$\..\..\src\ipc.c - $PROJ_DIR$\..\..\components\finsh\finsh_node.c + $PROJ_DIR$\..\..\src\irq.c - $PROJ_DIR$\..\..\components\finsh\finsh_ops.c + $PROJ_DIR$\..\..\src\kservice.c - $PROJ_DIR$\..\..\components\finsh\finsh_parser.c + $PROJ_DIR$\..\..\src\mem.c - $PROJ_DIR$\..\..\components\finsh\finsh_token.c + $PROJ_DIR$\..\..\src\mempool.c - $PROJ_DIR$\..\..\components\finsh\finsh_var.c + $PROJ_DIR$\..\..\src\object.c - $PROJ_DIR$\..\..\components\finsh\finsh_vm.c + $PROJ_DIR$\..\..\src\scheduler.c - $PROJ_DIR$\..\..\components\finsh\shell.c + $PROJ_DIR$\..\..\src\thread.c - $PROJ_DIR$\..\..\components\finsh\symbol.c + $PROJ_DIR$\..\..\src\timer.c @@ -1729,115 +1878,126 @@ $PROJ_DIR$\..\..\components\net\lwip\src\api\api_msg.c - $PROJ_DIR$\..\..\components\net\lwip\src\api\err.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\autoip.c - $PROJ_DIR$\..\..\components\net\lwip\src\api\netbuf.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\def.c - $PROJ_DIR$\..\..\components\net\lwip\src\api\netdb.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\dhcp.c - $PROJ_DIR$\..\..\components\net\lwip\src\api\netifapi.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\dns.c - $PROJ_DIR$\..\..\components\net\lwip\src\api\sockets.c + $PROJ_DIR$\..\..\components\net\lwip\src\api\err.c - $PROJ_DIR$\..\..\components\net\lwip\src\api\tcpip.c + $PROJ_DIR$\..\..\components\net\lwip\src\netif\etharp.c - $PROJ_DIR$\..\..\components\net\lwip\src\arch\sys_arch.c + $PROJ_DIR$\..\..\components\net\lwip\src\netif\ethernetif.c - $PROJ_DIR$\..\..\components\net\lwip\src\arch\sys_arch_init.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\icmp.c - $PROJ_DIR$\..\..\components\net\lwip\src\core\dhcp.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\igmp.c - $PROJ_DIR$\..\..\components\net\lwip\src\core\dns.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\inet.c - $PROJ_DIR$\..\..\components\net\lwip\src\core\init.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\inet_chksum.c - $PROJ_DIR$\..\..\components\net\lwip\src\core\memp.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\init.c - $PROJ_DIR$\..\..\components\net\lwip\src\core\netif.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\ip.c - $PROJ_DIR$\..\..\components\net\lwip\src\core\pbuf.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\ip_addr.c - $PROJ_DIR$\..\..\components\net\lwip\src\core\raw.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\ip_frag.c - $PROJ_DIR$\..\..\components\net\lwip\src\core\stats.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\memp.c - $PROJ_DIR$\..\..\components\net\lwip\src\core\sys.c + $PROJ_DIR$\..\..\components\net\lwip\src\api\netbuf.c - $PROJ_DIR$\..\..\components\net\lwip\src\core\tcp.c + $PROJ_DIR$\..\..\components\net\lwip\src\api\netdb.c - $PROJ_DIR$\..\..\components\net\lwip\src\core\tcp_in.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\netif.c - $PROJ_DIR$\..\..\components\net\lwip\src\core\tcp_out.c + $PROJ_DIR$\..\..\components\net\lwip\src\api\netifapi.c - $PROJ_DIR$\..\..\components\net\lwip\src\core\udp.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\pbuf.c - $PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\autoip.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\raw.c - $PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\icmp.c + $PROJ_DIR$\..\..\components\net\lwip\src\netif\slipif.c - $PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\igmp.c + $PROJ_DIR$\..\..\components\net\lwip\src\api\sockets.c - $PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\inet.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\stats.c - $PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\inet_chksum.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\sys.c - $PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\ip.c + $PROJ_DIR$\..\..\components\net\lwip\src\arch\sys_arch.c - $PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\ip_addr.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\tcp.c - $PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\ip_frag.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\tcp_in.c - $PROJ_DIR$\..\..\components\net\lwip\src\netif\etharp.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\tcp_out.c - $PROJ_DIR$\..\..\components\net\lwip\src\netif\ethernetif.c + $PROJ_DIR$\..\..\components\net\lwip\src\api\tcpip.c - $PROJ_DIR$\..\..\components\net\lwip\src\netif\loopif.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\timers.c - $PROJ_DIR$\..\..\components\net\lwip\src\netif\slipif.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\udp.c - CMSIS + Startup - $PROJ_DIR$\CMSIS\CM3\CoreSupport\core_cm3.c + $PROJ_DIR$\.\application.c - $PROJ_DIR$\CMSIS\CM3\DeviceSupport\NXP\LPC17xx\system_LPC17xx.c + $PROJ_DIR$\.\board.c - $PROJ_DIR$\CMSIS\CM3\DeviceSupport\NXP\LPC17xx\startup\iar\startup_LPC17xx.s + $PROJ_DIR$\.\emac.c + + + $PROJ_DIR$\.\led.c + + + $PROJ_DIR$\.\startup.c + + + $PROJ_DIR$\.\uart.c + + diff --git a/bsp/lpc176x/rtconfig.py b/bsp/lpc176x/rtconfig.py index 6868c3e91f46e5d468e915a8963a09e8c00f2468..0a7b0b107c48f94affc7887cbe914a92fb45f9cb 100644 --- a/bsp/lpc176x/rtconfig.py +++ b/bsp/lpc176x/rtconfig.py @@ -16,7 +16,7 @@ elif CROSS_TOOL == 'keil': EXEC_PATH = 'E:/Keil' elif CROSS_TOOL == 'iar': PLATFORM = 'iar' - EXEC_PATH = 'E:/Program Files/IAR Systems/Embedded Workbench 6.0/arm/bin' + IAR_PATH = 'C:/Program Files/IAR Systems/Embedded Workbench 6.0 Evaluation' if os.getenv('RTT_EXEC_PATH'): EXEC_PATH = os.getenv('RTT_EXEC_PATH') @@ -85,12 +85,37 @@ elif PLATFORM == 'iar': LINK = 'ilinkarm' TARGET_EXT = 'out' - DEVICE = ' --cpu DARMP1 --thumb' + DEVICE = ' --thumb' - CFLAGS = '' + CFLAGS = DEVICE + CFLAGS += ' --diag_suppress Pa050' + CFLAGS += ' --no_cse' + CFLAGS += ' --no_unroll' + CFLAGS += ' --no_inline' + CFLAGS += ' --no_code_motion' + CFLAGS += ' --no_tbaa' + CFLAGS += ' --no_clustering' + CFLAGS += ' --no_scheduling' + CFLAGS += ' --debug' + CFLAGS += ' --endian=little' + CFLAGS += ' --cpu=Cortex-M3' + CFLAGS += ' -e' + CFLAGS += ' --fpu=None' + CFLAGS += ' --dlib_config "' + IAR_PATH + '/arm/INC/c/DLib_Config_Normal.h"' + CFLAGS += ' -Ol' + CFLAGS += ' --use_c++_inline' + AFLAGS = '' + AFLAGS += ' -s+' + AFLAGS += ' -w+' + AFLAGS += ' -r' + AFLAGS += ' --cpu Cortex-M3' + AFLAGS += ' --fpu None' + LFLAGS = ' --config lpc17xx_flash.icf' + LFLAGS += ' --semihosting' + LFLAGS += ' --entry __iar_program_start' - EXEC_PATH += '/arm/bin/' + EXEC_PATH = IAR_PATH + '/arm/bin/' RT_USING_MINILIBC = False POST_ACTION = '' diff --git a/bsp/lpc178x/CMSIS/CM3/DeviceSupport/NXP/LPC177x_8x/startup/gcc/startup_LPC177x_8x.s b/bsp/lpc178x/CMSIS/CM3/DeviceSupport/NXP/LPC177x_8x/startup/gcc/startup_LPC177x_8x.s index 961a7e064c0c1506fa7e1cf025057588e217238f..ab30b6b050f016a2ca7e430878726d2632cf3339 100644 --- a/bsp/lpc178x/CMSIS/CM3/DeviceSupport/NXP/LPC177x_8x/startup/gcc/startup_LPC177x_8x.s +++ b/bsp/lpc178x/CMSIS/CM3/DeviceSupport/NXP/LPC177x_8x/startup/gcc/startup_LPC177x_8x.s @@ -129,7 +129,7 @@ __cs3_interrupt_vector_cortex_m: .type __cs3_reset_cortex_m, %function __cs3_reset_cortex_m: .fnstart -.if (RAM_MODE) +#if (RAM_MODE) /* Clear .bss section (Zero init) */ MOV R0, #0 LDR R1, =__bss_start__ @@ -147,12 +147,12 @@ BSSIsEmpty: BLX R0 LDR R0,=main BX R0 -.else +#else LDR R0, =SystemInit BLX R0 LDR R0,=_start BX R0 -.endif +#endif .pool .cantunwind .fnend diff --git a/bsp/lpc178x/rtconfig.py b/bsp/lpc178x/rtconfig.py index 563590ffb01aedc6fe51678b8070ce746273ccd8..e3d5c237435aa2a876e28891e57fb0384c79b4d3 100644 --- a/bsp/lpc178x/rtconfig.py +++ b/bsp/lpc178x/rtconfig.py @@ -15,8 +15,10 @@ elif CROSS_TOOL == 'keil': PLATFORM = 'armcc' EXEC_PATH = 'E:/Keil' elif CROSS_TOOL == 'iar': - PLATFORM = 'iar' - EXEC_PATH = 'E:/Program Files/IAR Systems/Embedded Workbench 6.0/arm/bin' + print '================ERROR============================' + print 'Not support iar yet!' + print '=================================================' + exit(0) if os.getenv('RTT_EXEC_PATH'): EXEC_PATH = os.getenv('RTT_EXEC_PATH') @@ -76,21 +78,3 @@ elif PLATFORM == 'armcc': CFLAGS += ' -O2' POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET' - -elif PLATFORM == 'iar': - # toolchains - CC = 'iccarm' - AS = 'iasmarm' - AR = 'iarchive' - LINK = 'ilinkarm' - TARGET_EXT = 'out' - - DEVICE = ' --cpu DARMP1 --thumb' - - CFLAGS = '' - AFLAGS = '' - LFLAGS = ' --config lpc17xx_flash.icf' - - EXEC_PATH += '/arm/bin/' - RT_USING_MINILIBC = False - POST_ACTION = '' diff --git a/bsp/lpc2478/rtconfig.py b/bsp/lpc2478/rtconfig.py index 3c92ab0be25d4954dc9f0a4dce1f9fcf9517688a..3930c684f0e72c00bafd937e97f2ef25df18a7ba 100644 --- a/bsp/lpc2478/rtconfig.py +++ b/bsp/lpc2478/rtconfig.py @@ -14,9 +14,6 @@ if CROSS_TOOL == 'gcc': elif CROSS_TOOL == 'keil': PLATFORM = 'armcc' EXEC_PATH = 'E:/Keil' -elif CROSS_TOOL == 'iar': - PLATFORM = 'iar' - EXEC_PATH = 'E:/Program Files/IAR Systems/Embedded Workbench 6.0/arm/bin' elif CROSS_TOOL == 'iar': print '================ERROR============================' print 'Not support iar yet!' diff --git a/bsp/m16c62p/rtconfig.py b/bsp/m16c62p/rtconfig.py index 3ed4a874b127047e5f476793c04747c43f449b7a..103d174a834a1670d4c4773946b4180cbb50d805 100644 --- a/bsp/m16c62p/rtconfig.py +++ b/bsp/m16c62p/rtconfig.py @@ -11,7 +11,7 @@ if os.getenv('RTT_CC'): if CROSS_TOOL == 'gcc': PLATFORM = 'gcc' - EXEC_PATH = 'E:/Program Files/CodeSourcery/Sourcery G++ Lite/bin' + EXEC_PATH = 'C:/Program Files/Renesas/Hew/Tools/KPIT Cummins/GNUM16CM32C-ELF/v11.01/m32c-elf/bin' elif CROSS_TOOL == 'iar': PLATFORM = 'iar' IAR_PATH = 'C:/Program Files/IAR Systems/Embedded Workbench Evaluation 6.0' @@ -29,20 +29,20 @@ BUILD = 'debug' if PLATFORM == 'gcc': # toolchains - PREFIX = 'arm-none-eabi-' + PREFIX = 'm32c-elf-' CC = PREFIX + 'gcc' AS = PREFIX + 'gcc' AR = PREFIX + 'ar' LINK = PREFIX + 'gcc' - TARGET_EXT = 'axf' + TARGET_EXT = 'out' SIZE = PREFIX + 'size' OBJDUMP = PREFIX + 'objdump' OBJCPY = PREFIX + 'objcopy' - DEVICE = ' -mcpu=arm920t' + DEVICE = ' -mcpu=m16c' CFLAGS = DEVICE - AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp' + ' -DTEXT_BASE=' + TextBase - LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rtthread_mini2440.map,-cref,-u,_start -T mini2440_ram.ld' + ' -Ttext ' + TextBase + AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp' + LFLAGS = DEVICE + ' -nostartfiles' + ' -Wl,--gc-sections,-Map=rtthread_m16c.map,-cref,-u,_start -T m16c62p.ld' CPATH = '' LPATH = '' @@ -53,7 +53,7 @@ if PLATFORM == 'gcc': else: CFLAGS += ' -O2' - POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n' + POST_ACTION = OBJCPY + ' -O srec $TARGET rtthread.mot\n' + SIZE + ' $TARGET \n' elif PLATFORM == 'iar': # toolchains diff --git a/bsp/m16c62p/startup.c b/bsp/m16c62p/startup.c index aad3e1a4e40e8e2e214b9989afab6923950e1de0..14da5939eb56bd8eebab14cce8fff3cec3095d25 100644 --- a/bsp/m16c62p/startup.c +++ b/bsp/m16c62p/startup.c @@ -85,7 +85,7 @@ void rtthread_startup(void) /* init timer thread */ rt_system_timer_thread_init(); - + /* init idle thread */ rt_thread_idle_init(); diff --git a/bsp/stm32f107/project.ewp b/bsp/stm32f107/project.ewp index 36db9c1e306380dd6e67da6f3829881a3bd25aab..d333667ec013f136e7c53a9d53fe67274e5a79a8 100644 --- a/bsp/stm32f107/project.ewp +++ b/bsp/stm32f107/project.ewp @@ -87,7 +87,7 @@