From 3f4d30de567ff3351004c7c88d26dae7d0e4b2bd Mon Sep 17 00:00:00 2001
From: justinkim <justinkim@winzet.io>
Date: Wed, 29 Aug 2018 14:20:30 +0900
Subject: [PATCH 1/2] Fix Bug : IAR heap memory problem

---
 .../device/TOOLCHAIN_IAR/W7500_Flash.icf                  | 8 ++++----
 .../device/TOOLCHAIN_IAR/W7500_Flash.icf                  | 8 ++++----
 .../device/TOOLCHAIN_IAR/W7500_Flash.icf                  | 8 ++++----
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/device/TOOLCHAIN_IAR/W7500_Flash.icf b/targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/device/TOOLCHAIN_IAR/W7500_Flash.icf
index dd71139d17..41a6d25020 100644
--- a/targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/device/TOOLCHAIN_IAR/W7500_Flash.icf
+++ b/targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/device/TOOLCHAIN_IAR/W7500_Flash.icf
@@ -8,9 +8,9 @@ define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
 define symbol __ICFEDIT_region_ROM_end__   = 0x00020000;
 define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
 define symbol __ICFEDIT_region_RAM_end__   = 0x20004000;
-/*-Sizes-*/
-define symbol __ICFEDIT_size_cstack__ = 0x00000400;
-define symbol __ICFEDIT_size_heap__   = 0x00000400;
+/*-Heap 1/4 of ram and stack 1/8-*/
+define symbol __ICFEDIT_size_cstack__ = 0x00000800;
+define symbol __ICFEDIT_size_heap__   = 0x00001000;
 /**** End of ICF editor section. ###ICF###*/
 
 
@@ -28,4 +28,4 @@ place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
 
 place in ROM_region   { readonly };
 place in RAM_region   { readwrite,
-                        block CSTACK, block HEAP };
\ No newline at end of file
+                        block CSTACK, block HEAP };
diff --git a/targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500ECO/device/TOOLCHAIN_IAR/W7500_Flash.icf b/targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500ECO/device/TOOLCHAIN_IAR/W7500_Flash.icf
index dd71139d17..41a6d25020 100644
--- a/targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500ECO/device/TOOLCHAIN_IAR/W7500_Flash.icf
+++ b/targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500ECO/device/TOOLCHAIN_IAR/W7500_Flash.icf
@@ -8,9 +8,9 @@ define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
 define symbol __ICFEDIT_region_ROM_end__   = 0x00020000;
 define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
 define symbol __ICFEDIT_region_RAM_end__   = 0x20004000;
-/*-Sizes-*/
-define symbol __ICFEDIT_size_cstack__ = 0x00000400;
-define symbol __ICFEDIT_size_heap__   = 0x00000400;
+/*-Heap 1/4 of ram and stack 1/8-*/
+define symbol __ICFEDIT_size_cstack__ = 0x00000800;
+define symbol __ICFEDIT_size_heap__   = 0x00001000;
 /**** End of ICF editor section. ###ICF###*/
 
 
@@ -28,4 +28,4 @@ place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
 
 place in ROM_region   { readonly };
 place in RAM_region   { readwrite,
-                        block CSTACK, block HEAP };
\ No newline at end of file
+                        block CSTACK, block HEAP };
diff --git a/targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500P/device/TOOLCHAIN_IAR/W7500_Flash.icf b/targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500P/device/TOOLCHAIN_IAR/W7500_Flash.icf
index dd71139d17..41a6d25020 100644
--- a/targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500P/device/TOOLCHAIN_IAR/W7500_Flash.icf
+++ b/targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500P/device/TOOLCHAIN_IAR/W7500_Flash.icf
@@ -8,9 +8,9 @@ define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
 define symbol __ICFEDIT_region_ROM_end__   = 0x00020000;
 define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
 define symbol __ICFEDIT_region_RAM_end__   = 0x20004000;
-/*-Sizes-*/
-define symbol __ICFEDIT_size_cstack__ = 0x00000400;
-define symbol __ICFEDIT_size_heap__   = 0x00000400;
+/*-Heap 1/4 of ram and stack 1/8-*/
+define symbol __ICFEDIT_size_cstack__ = 0x00000800;
+define symbol __ICFEDIT_size_heap__   = 0x00001000;
 /**** End of ICF editor section. ###ICF###*/
 
 
@@ -28,4 +28,4 @@ place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
 
 place in ROM_region   { readonly };
 place in RAM_region   { readwrite,
-                        block CSTACK, block HEAP };
\ No newline at end of file
+                        block CSTACK, block HEAP };

From 251ab0173da8c1ed4cb73cdbb1921c4b1741d3dc Mon Sep 17 00:00:00 2001
From: justinkim <justinkim@winzet.io>
Date: Thu, 30 Aug 2018 08:41:12 +0900
Subject: [PATCH 2/2] Stack size change to 1K in IAR Linker Script.

---
 .../TARGET_WIZwiki_W7500/device/TOOLCHAIN_IAR/W7500_Flash.icf   | 2 +-
 .../device/TOOLCHAIN_IAR/W7500_Flash.icf                        | 2 +-
 .../TARGET_WIZwiki_W7500P/device/TOOLCHAIN_IAR/W7500_Flash.icf  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/device/TOOLCHAIN_IAR/W7500_Flash.icf b/targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/device/TOOLCHAIN_IAR/W7500_Flash.icf
index 41a6d25020..b73571e33d 100644
--- a/targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/device/TOOLCHAIN_IAR/W7500_Flash.icf
+++ b/targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/device/TOOLCHAIN_IAR/W7500_Flash.icf
@@ -9,7 +9,7 @@ define symbol __ICFEDIT_region_ROM_end__   = 0x00020000;
 define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
 define symbol __ICFEDIT_region_RAM_end__   = 0x20004000;
 /*-Heap 1/4 of ram and stack 1/8-*/
-define symbol __ICFEDIT_size_cstack__ = 0x00000800;
+define symbol __ICFEDIT_size_cstack__ = 0x00000400;
 define symbol __ICFEDIT_size_heap__   = 0x00001000;
 /**** End of ICF editor section. ###ICF###*/
 
diff --git a/targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500ECO/device/TOOLCHAIN_IAR/W7500_Flash.icf b/targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500ECO/device/TOOLCHAIN_IAR/W7500_Flash.icf
index 41a6d25020..b73571e33d 100644
--- a/targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500ECO/device/TOOLCHAIN_IAR/W7500_Flash.icf
+++ b/targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500ECO/device/TOOLCHAIN_IAR/W7500_Flash.icf
@@ -9,7 +9,7 @@ define symbol __ICFEDIT_region_ROM_end__   = 0x00020000;
 define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
 define symbol __ICFEDIT_region_RAM_end__   = 0x20004000;
 /*-Heap 1/4 of ram and stack 1/8-*/
-define symbol __ICFEDIT_size_cstack__ = 0x00000800;
+define symbol __ICFEDIT_size_cstack__ = 0x00000400;
 define symbol __ICFEDIT_size_heap__   = 0x00001000;
 /**** End of ICF editor section. ###ICF###*/
 
diff --git a/targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500P/device/TOOLCHAIN_IAR/W7500_Flash.icf b/targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500P/device/TOOLCHAIN_IAR/W7500_Flash.icf
index 41a6d25020..b73571e33d 100644
--- a/targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500P/device/TOOLCHAIN_IAR/W7500_Flash.icf
+++ b/targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500P/device/TOOLCHAIN_IAR/W7500_Flash.icf
@@ -9,7 +9,7 @@ define symbol __ICFEDIT_region_ROM_end__   = 0x00020000;
 define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
 define symbol __ICFEDIT_region_RAM_end__   = 0x20004000;
 /*-Heap 1/4 of ram and stack 1/8-*/
-define symbol __ICFEDIT_size_cstack__ = 0x00000800;
+define symbol __ICFEDIT_size_cstack__ = 0x00000400;
 define symbol __ICFEDIT_size_heap__   = 0x00001000;
 /**** End of ICF editor section. ###ICF###*/