diff --git a/bsp/simulator/SConstruct b/bsp/simulator/SConstruct index ed5994d2f7..af6534906b 100755 --- a/bsp/simulator/SConstruct +++ b/bsp/simulator/SConstruct @@ -75,6 +75,7 @@ elif rtconfig.PLATFORM == 'mingw': env.PrependENVPath('PATH', rtconfig.EXEC_PATH) else: TARGET = 'rtthread' + env['CC']=rtconfig.CC env.Append(CCFLAGS=rtconfig.CFLAGS) env.Append(LINKFLAGS=rtconfig.LFLAGS) env.Append(LIBS=['m']) diff --git a/bsp/simulator/drivers/SConscript b/bsp/simulator/drivers/SConscript index 2f84e1db02..d939535da8 100644 --- a/bsp/simulator/drivers/SConscript +++ b/bsp/simulator/drivers/SConscript @@ -1,3 +1,4 @@ +import sys from building import * cwd = GetCurrentDir() @@ -16,6 +17,9 @@ if GetDepend('RT_USING_DFS_WINSHAREDIR') == False: SrcRemove(src, 'dfs_win32.c') if GetDepend('RT_USING_MODULE') == False: SrcRemove(src, ['module_win32.c']) +if sys.platform[0:5]=="linux": #check whether under linux + SrcRemove(src, ['module_win32.c', 'dfs_win32.c']) + CPPPATH = [cwd] group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH) diff --git a/bsp/simulator/drivers/usart_sim.c b/bsp/simulator/drivers/usart_sim.c index b16f67dfd5..28646a4b27 100755 --- a/bsp/simulator/drivers/usart_sim.c +++ b/bsp/simulator/drivers/usart_sim.c @@ -81,6 +81,8 @@ static pthread_t OSKey_Thread; void rt_hw_usart_init(void) { int res; + + rt_hw_serial_init(&serial1, RT_CONSOLE_DEVICE_NAME); res = pthread_create(&OSKey_Thread, NULL, &ThreadforKeyGet, NULL); if (res) { diff --git a/bsp/simulator/gcc.ld b/bsp/simulator/gcc.ld index 20ee79ad06..4869b5c2d7 100644 --- a/bsp/simulator/gcc.ld +++ b/bsp/simulator/gcc.ld @@ -79,6 +79,12 @@ SECTIONS __vsymtab_end = .; } . = ALIGN(4); + rti_fn : { + __rt_init_start = .; + KEEP(*(SORT(.rti_fn*))) + __rt_init_end = .; + } + . = ALIGN(4); /* setction information for finsh shell end */ .eh_frame_hdr : { *(.eh_frame_hdr) }