From c2b5cd1e85b11f25e3707a4e5f0ea3ca93ed48ae Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Mon, 12 Oct 2015 10:52:14 +0800 Subject: [PATCH 1/7] [Finsh] fix the '\r' issue in linux telnet. --- components/finsh/shell.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/finsh/shell.c b/components/finsh/shell.c index ce80e4dec2..8962a7333f 100644 --- a/components/finsh/shell.c +++ b/components/finsh/shell.c @@ -425,7 +425,7 @@ void finsh_thread_entry(void *parameter) if (rt_device_read(shell->device, 0, &next, 1) == 1) { - if (next == '\0') ch = 'r'; /* linux telnet will issue '\0' */ + if (next == '\0') ch = '\r'; /* linux telnet will issue '\0' */ else ch = next; } else ch = '\r'; From c7af45b7593f8e1b54e963b65888e0db8a894b0e Mon Sep 17 00:00:00 2001 From: "www220@tom.com" Date: Mon, 12 Oct 2015 15:55:52 +0800 Subject: [PATCH 2/7] =?UTF-8?q?msh=E4=B8=AD=E7=9A=84mkfs=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E5=86=8D=E6=90=BA=E5=B8=A6=E7=B1=BB=E5=9E=8B=E6=98=AF=EF=BC=8C?= =?UTF-8?q?=E8=A7=A3=E6=9E=90=E5=87=BA=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/finsh/msh_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/finsh/msh_cmd.c b/components/finsh/msh_cmd.c index 19eb5e0b72..a4b865b028 100644 --- a/components/finsh/msh_cmd.c +++ b/components/finsh/msh_cmd.c @@ -234,7 +234,7 @@ int cmd_mkfs(int argc, char **argv) if (strcmp(argv[1], "-t") == 0) { type = argv[2]; - result = dfs_mkfs(type, argv[1]); + result = dfs_mkfs(type, argv[3]); } } else From 1c91512e97b6591c9f6b0ef28e28b6de4f86c826 Mon Sep 17 00:00:00 2001 From: ardafu Date: Tue, 13 Oct 2015 09:49:27 +0800 Subject: [PATCH 3/7] [bsp][stm32f746g-disco] Fix MPU init bug. 1. Fixed the bug that MPU init function was called 2 times. --- bsp/stm32f7-disco/drivers/board.c | 4 ++-- bsp/stm32f7-disco/drivers/drv_mpu.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bsp/stm32f7-disco/drivers/board.c b/bsp/stm32f7-disco/drivers/board.c index 0553920a47..02f0acf2e6 100644 --- a/bsp/stm32f7-disco/drivers/board.c +++ b/bsp/stm32f7-disco/drivers/board.c @@ -25,7 +25,7 @@ #include #include "board.h" #include "sram.h" - +#include "drv_mpu.h" /** * @addtogroup STM32 @@ -165,7 +165,7 @@ void HAL_ResumeTick(void) void rt_hw_board_init() { /* Configure the MPU attributes as Write Through */ - //mpu_init(); + mpu_init(); /* Enable the CPU Cache */ CPU_CACHE_Enable(); diff --git a/bsp/stm32f7-disco/drivers/drv_mpu.c b/bsp/stm32f7-disco/drivers/drv_mpu.c index 630e48e2d2..ecf556203b 100644 --- a/bsp/stm32f7-disco/drivers/drv_mpu.c +++ b/bsp/stm32f7-disco/drivers/drv_mpu.c @@ -81,4 +81,4 @@ int mpu_init(void) HAL_MPU_Enable(MPU_PRIVILEGED_DEFAULT); return 0; } -INIT_BOARD_EXPORT(mpu_init); +//INIT_BOARD_EXPORT(mpu_init); From 78cb445af29bf78a4ea79e372da2554d0fc357a7 Mon Sep 17 00:00:00 2001 From: cedar-renjun <819280802@qq.com> Date: Tue, 13 Oct 2015 11:34:10 +0800 Subject: [PATCH 4/7] Create stm32f40x_flash.icf --- bsp/stm32f40x/stm32f40x_flash.icf | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 bsp/stm32f40x/stm32f40x_flash.icf diff --git a/bsp/stm32f40x/stm32f40x_flash.icf b/bsp/stm32f40x/stm32f40x_flash.icf new file mode 100644 index 0000000000..8888d0e081 --- /dev/null +++ b/bsp/stm32f40x/stm32f40x_flash.icf @@ -0,0 +1,33 @@ +/*###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__ = 0x08000000; +/*-Memory Regions-*/ +define symbol __ICFEDIT_region_ROM_start__ = 0x08000000; +define symbol __ICFEDIT_region_ROM_end__ = 0x0807FFFF; +define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; +define symbol __ICFEDIT_region_RAM_end__ = 0x2001FFFF; /*STM32 F446RE*/ +/*-Sizes-*/ +define symbol __ICFEDIT_size_cstack__ = 0x200; +define symbol __ICFEDIT_size_heap__ = 0x000; +/**** 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 }; +do not initialize { section .noinit }; + +keep { section FSymTab }; +keep { section VSymTab }; +keep { section .rti_fn* }; +place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; + +place in ROM_region { readonly }; +place in RAM_region { readwrite, block CSTACK, last block HEAP}; From 34a220042867dee8ee948e7021c4e7770e19f8fa Mon Sep 17 00:00:00 2001 From: cedar-renjun <819280802@qq.com> Date: Tue, 13 Oct 2015 11:40:59 +0800 Subject: [PATCH 5/7] include iar startup code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixed bug: 'scons --target=iar -s' output iar project missing startup code, and link file 修复scons生成IAR工程中没有startup code和链接文件,导致工程中断异常和Finsh无法工作 --- bsp/stm32f40x/Libraries/SConscript | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsp/stm32f40x/Libraries/SConscript b/bsp/stm32f40x/Libraries/SConscript index d23856456a..c83c06b439 100644 --- a/bsp/stm32f40x/Libraries/SConscript +++ b/bsp/stm32f40x/Libraries/SConscript @@ -18,8 +18,8 @@ if rtconfig.CROSS_TOOL == 'gcc': src = src + ['CMSIS/ST/STM32F4xx/Source/Templates/gcc_ride7/startup_stm32f4xx.s'] elif rtconfig.CROSS_TOOL == 'keil': src = src + ['CMSIS/ST/STM32F4xx/Source/Templates/arm/startup_stm32f4xx.s'] -# elif rtconfig.CROSS_TOOL == 'iar': - # src = src + ['CMSIS/CM3/DeviceSupport/ST/STM32F10x/startup/iar/' + startup_scripts[rtconfig.STM32_TYPE]] +elif rtconfig.CROSS_TOOL == 'iar': + src = src + ['CMSIS/ST/STM32F4xx/Source/Templates/iar/startup_stm32f4xx.s'] path = [cwd + '/STM32F4xx_StdPeriph_Driver/inc', cwd + '/CMSIS/ST/STM32F4xx/Include', From 238ebdd045f479c944bae64b312cfe174485b215 Mon Sep 17 00:00:00 2001 From: cedar-renjun <819280802@qq.com> Date: Tue, 13 Oct 2015 11:52:05 +0800 Subject: [PATCH 6/7] Update and rename readme.txt to readme.md --- bsp/stm32f40x/readme.md | 25 +++++++++++++++++++++++++ bsp/stm32f40x/readme.txt | 9 --------- 2 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 bsp/stm32f40x/readme.md delete mode 100644 bsp/stm32f40x/readme.txt diff --git a/bsp/stm32f40x/readme.md b/bsp/stm32f40x/readme.md new file mode 100644 index 0000000000..e1d0e56820 --- /dev/null +++ b/bsp/stm32f40x/readme.md @@ -0,0 +1,25 @@ +board info: +STM32F4 discovery +http://www.st.com/internet/evalboard/product/252419.jsp + +note: +in drivers/stm32f4xx_conf.h + /* Redefine the HSE value; it's equal to 8 MHz on the STM32F4-DISCOVERY Kit */ + #define HSE_VALUE ((uint32_t)8000000) + + + + **================= IAR WARNING =================** + + after use `scons --target=iar -s` cmd to product IAR project, you have to add iar link file by hand + + IAR steps: + 1. Project-->Options-->Linker + 2. Config-->Linker Configuration file + 3. select `Override Default`, then select `bsp/stm32f40x/stm32f40x_flash.icf` + 4. rebuild project + + + **TODO** + auto add *.icf by scons script + diff --git a/bsp/stm32f40x/readme.txt b/bsp/stm32f40x/readme.txt deleted file mode 100644 index 7bebe251c6..0000000000 --- a/bsp/stm32f40x/readme.txt +++ /dev/null @@ -1,9 +0,0 @@ -board info: -STM32F4 discovery -http://www.st.com/internet/evalboard/product/252419.jsp - -note: -in drivers/stm32f4xx_conf.h - /* Redefine the HSE value; it's equal to 8 MHz on the STM32F4-DISCOVERY Kit */ - #define HSE_VALUE ((uint32_t)8000000) - From 45d46b076fcb8d9c85ac31edac1120c01a43930b Mon Sep 17 00:00:00 2001 From: "www220@tom.com" Date: Wed, 14 Oct 2015 10:28:25 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E4=BF=AE=E6=AD=A3romfs=E5=9C=A8=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E7=9A=84=E7=9B=AE=E5=BD=95=E5=90=8D=E7=A7=B0=E6=AF=94?= =?UTF-8?q?=E5=AE=9E=E9=99=85=E7=9A=84=E5=90=8D=E7=A7=B0=E7=9F=AD=E6=97=B6?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E7=9A=84=E5=88=A4=E6=96=AD=E9=94=99=E8=AF=AF?= =?UTF-8?q?=20=E6=AF=94=E5=A6=82=E5=AE=9E=E9=99=85=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E4=B8=BAabcde=EF=BC=8Cmsh=E6=89=A7=E8=A1=8C=20cd=20abc?= =?UTF-8?q?=E4=B9=9F=E8=83=BD=E6=89=A7=E8=A1=8C=E6=88=90=E5=8A=9F=EF=BC=8C?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E5=90=8D=E7=A7=B0=E6=97=B6=E5=AD=98=E5=9C=A8?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/dfs/filesystems/romfs/dfs_romfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/dfs/filesystems/romfs/dfs_romfs.c b/components/dfs/filesystems/romfs/dfs_romfs.c index 1dd41b41eb..6110d61227 100644 --- a/components/dfs/filesystems/romfs/dfs_romfs.c +++ b/components/dfs/filesystems/romfs/dfs_romfs.c @@ -96,7 +96,8 @@ struct romfs_dirent *dfs_romfs_lookup(struct romfs_dirent *root_dirent, const ch { if (check_dirent(&dirent[index]) != 0) return RT_NULL; - if (rt_strncmp(dirent[index].name, subpath, (subpath_end - subpath)) == 0) + if (rt_strlen(dirent[index].name) == (subpath_end - subpath) && + rt_strncmp(dirent[index].name, subpath, (subpath_end - subpath)) == 0) { dirent_size = dirent[index].size;