diff --git a/bsp/stm32f107/stm32_rom.ld b/bsp/stm32f107/stm32_rom.ld index 60086674b2ee8cdaeff81cfc7b195b0d36a35a79..f9b233e4684c98fbe0fa7aa732300fb55bcf82d5 100644 --- a/bsp/stm32f107/stm32_rom.ld +++ b/bsp/stm32f107/stm32_rom.ld @@ -17,6 +17,7 @@ SECTIONS .text : { . = ALIGN(4); + _stext = .; KEEP(*(.isr_vector)) /* Startup code */ . = ALIGN(4); *(.text) /* remaining code */ diff --git a/bsp/stm32f10x/stm32_rom.ld b/bsp/stm32f10x/stm32_rom.ld index 69ca301a9293f26839c1536f703d771f0dfc0c2f..0aa6438ef917685e73d5881fafb683e218067e9c 100644 --- a/bsp/stm32f10x/stm32_rom.ld +++ b/bsp/stm32f10x/stm32_rom.ld @@ -17,6 +17,7 @@ SECTIONS .text : { . = ALIGN(4); + _stext = .; KEEP(*(.isr_vector)) /* Startup code */ . = ALIGN(4); *(.text) /* remaining code */ diff --git a/bsp/stm32f20x/stm32_rom.ld b/bsp/stm32f20x/stm32_rom.ld index ff9918899fa901ec4dcb8e2723473a1805c291bb..96cab8124c744404055c60cfc041e9a3500232e6 100644 --- a/bsp/stm32f20x/stm32_rom.ld +++ b/bsp/stm32f20x/stm32_rom.ld @@ -17,6 +17,7 @@ SECTIONS .text : { . = ALIGN(4); + _stext = .; KEEP(*(.isr_vector)) /* Startup code */ . = ALIGN(4); *(.text) /* remaining code */ diff --git a/bsp/stm32f40x/stm32_rom.ld b/bsp/stm32f40x/stm32_rom.ld index 69ca301a9293f26839c1536f703d771f0dfc0c2f..0aa6438ef917685e73d5881fafb683e218067e9c 100644 --- a/bsp/stm32f40x/stm32_rom.ld +++ b/bsp/stm32f40x/stm32_rom.ld @@ -17,6 +17,7 @@ SECTIONS .text : { . = ALIGN(4); + _stext = .; KEEP(*(.isr_vector)) /* Startup code */ . = ALIGN(4); *(.text) /* remaining code */ diff --git a/components/external/lua/README.TXT b/components/external/lua/README.TXT index bfe8db60b3562fcdb6e1fc002b9143b2873deb35..d983056198758f849f84a2cd6292b7f15c0ea170 100644 --- a/components/external/lua/README.TXT +++ b/components/external/lua/README.TXT @@ -2,7 +2,7 @@ ## 简介 RT-Thread中的Lua修改自[eLua](http://www.eluaproject.net/)的Lua-5.1.4版本。 -Lua依赖于Neblib库。 +采用gcc工具链时,Lua依赖于newlib库,其它工具链暂时还不支持。 启动lua的RAM占用情况 - 标准的lua 17.1904296875 KB - 优化的lua 5.01953125 KB @@ -24,13 +24,14 @@ Lua依赖于Neblib库。 3.更多的配置项可以在luaconf.h中找到 ## 开发相关 + - 采用gcc工具链时,依赖于newlib,需在rtconfig.h中定义RT_USING_NEWLIB - 开启编译器对C99的支持,如MDK中,在C/C++选项的Misc Controls输入框中添加--c99 - - 开启内存优化时:需要在链接脚本中定义_stext和_etext,.ordata*放在两者之间。 + - 需要在链接脚本中定义_stext和_etext,.ordata*放在两者之间。 用于判断数据是read-only和writable。MDK中如何实现?? - - 添加新的模块,参见larduinolib.c + - 添加新的模块,参见lexample.c ## 目录说明 - lua:从eLua获得Lua-5.1.4版本代码 - - exlibs:external libraries,外部库代码,如Arduino库 + - exlibs:external libraries,外部库代码,如example库 - applications:Lua应用代码,如finsh中lua() - test:测试代码 diff --git a/components/libc/newlib/syscalls.c b/components/libc/newlib/syscalls.c index 6f670c8ef2a0e306988d5bc5a862613863d653e5..4405c5ce71e376a178e6884e8502a4722c186a71 100644 --- a/components/libc/newlib/syscalls.c +++ b/components/libc/newlib/syscalls.c @@ -197,7 +197,6 @@ _wait_r(struct _reent *ptr, int *status) _ssize_t _write_r(struct _reent *ptr, int fd, const void *buf, size_t nbytes) { -#ifndef RT_USING_DFS if (fd < 3) { rt_device_t console_device; @@ -207,13 +206,13 @@ _write_r(struct _reent *ptr, int fd, const void *buf, size_t nbytes) if (console_device != 0) rt_device_write(console_device, 0, buf, nbytes); return nbytes; } - return 0; -#else - _ssize_t rc; + else + { + _ssize_t rc; - rc = write(fd, buf, nbytes); - return rc; -#endif + rc = write(fd, buf, nbytes); + return rc; + } } #endif