[stm32][gcc] 修复栈为0的bug,将栈扩展到0x400(与Keil IAR一致)

This commit is contained in:
Meco Man 2021-12-03 09:57:56 -05:00
parent bb8f269104
commit 7b5e6a81f9
82 changed files with 85 additions and 84 deletions

View File

@ -9,7 +9,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 32k /* 32K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -9,7 +9,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 20k /* 20K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -9,7 +9,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 128k /* 20K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 16k /* 16K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 128k /* 128K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 128k /* 128K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x24000000, LENGTH = 512k /* 512K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -9,7 +9,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 16k /* 16K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -9,7 +9,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 96k /* 96KB sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -9,7 +9,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 96k /* 96KB sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x10040000, LENGTH = 128k /* 128K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -9,7 +9,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 192k /* 192KB sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -9,7 +9,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 16k /* 16K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -9,7 +9,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 32k /* 32K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -9,7 +9,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 20k /* 20K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -9,7 +9,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 64k /* 64K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -9,7 +9,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 20k /* 20K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -9,7 +9,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 64k /* 64K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -9,7 +9,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 20k /* 20K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -9,7 +9,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 64k /* 64K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -9,7 +9,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 20k /* 20K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -9,7 +9,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 64k /* 64K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -9,7 +9,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 60k /* 60K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -9,7 +9,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 48k /* 48K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -9,7 +9,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 64k /* 64K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -9,7 +9,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 128k /* 128K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 16k /* 16K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 96k /* 96K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -12,7 +12,7 @@ MEMORY
RAM2 (rw) : ORIGIN = 0x10000000, LENGTH = 64k /* 64K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 128k /* 128KB sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -12,7 +12,7 @@ MEMORY
RAM2 (rw) : ORIGIN = 0x10000000, LENGTH = 64k /* 64K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 128k /* 128K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -11,7 +11,7 @@ MEMORY
RAM2 (rw) : ORIGIN = 0x10000000, LENGTH = 64k /* 64K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 32k /* 32K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 128k /* 128K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 128k /* 128K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 128k /* 128K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 256k /* 256K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 320k /* 128K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM2 (rw) : ORIGIN = 0x10000000, LENGTH = 64k /* 64K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -12,7 +12,7 @@ MEMORY
RAM2 (rw) : ORIGIN = 0x10000000, LENGTH = 64k /* 64K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -12,7 +12,7 @@ MEMORY
RAM2 (rw) : ORIGIN = 0x10000000, LENGTH = 64k /* 64K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -12,7 +12,7 @@ MEMORY
RAM2 (rw) : ORIGIN = 0x10000000, LENGTH = 64k /* 64K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 192k /* 192K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 128k /* 128K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 320k /* 320K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 320k /* 320 K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 320k /* 320 K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 128k /* 128K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 512k /* 128K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 512k /* 512K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 512k /* 512K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -9,7 +9,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 36k /* 36K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -9,7 +9,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 36k /* 36K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 128k /* 128K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x24000000, LENGTH = 512k /* 512K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x24000000, LENGTH = 512k /* 512K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x24000000, LENGTH = 512k /* 512K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 128k /* 512K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 128k /* 128K DTCM */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -12,7 +12,7 @@ TxDecripSection (rw) : ORIGIN =0x30040060,LENGTH =32k
RxArraySection (rw) : ORIGIN =0x30040200,LENGTH =32k
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -9,7 +9,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 20k /* 20KB sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -9,7 +9,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 8k /* 8KB sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM2 (rw) : ORIGIN = 0x10000000, LENGTH = 8k /* 8K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM2 (rw) : ORIGIN = 0x10000000, LENGTH = 16k /* 16K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM2 (rw) : ORIGIN = 0x10000000, LENGTH = 16k /* 16K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM2 (rw) : ORIGIN = 0x10000000, LENGTH = 16k /* 16K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -9,7 +9,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 128k /* 128KB sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM2 (rw) : ORIGIN = 0x10000000, LENGTH = 32k /* 32K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -11,7 +11,7 @@ MEMORY
RAM2 (rw) : ORIGIN = 0x10000000, LENGTH = 32k /* 32K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM2 (rw) : ORIGIN = 0x10000000, LENGTH = 32k /* 32K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -9,7 +9,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 320k /* 320K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM2 (rw) : ORIGIN = 0x10000000, LENGTH = 128k /* 128K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -11,7 +11,7 @@ MEMORY
RAM3 (rw) : ORIGIN = 0x10000000, LENGTH = 64k /* 64K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -11,7 +11,7 @@ MEMORY
RAM3 (rw) : ORIGIN = 0x10000000, LENGTH = 64k /* 64K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM2 (rw) : ORIGIN = 0x20040000, LENGTH = 384k /* 384k sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -9,7 +9,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 96k /* 96KB sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x10040000, LENGTH = 128k /* 128K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -10,7 +10,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x10040000, LENGTH = 128k /* 128K sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -9,7 +9,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 96k /* 96KB sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -9,7 +9,7 @@ MEMORY
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 192k /* 192KB sram */
}
ENTRY(Reset_Handler)
_system_stack_size = 0x000;
_system_stack_size = 0x400;
SECTIONS
{

View File

@ -24,7 +24,8 @@
# 本文件用于在HAL库更新之后
# 1.对gcc的汇编启动文件中main替换为entry函数
# 2.将启动文件heap降为0
# 2.将启动文件heap降为0(Keil IAR)
# 3.将GCC的堆大小扩展到0x400与Keil IAR保持一致
#使用方法运行脚本将bsp/stm32的绝对路径传给脚本即可C:\Users\92036\Desktop\rt-thread\bsp\stm32
@ -122,10 +123,10 @@ def heap2zero(path):
if line == '':
break
re_result = re.match('\s*_system_stack_size\s*=\s*0[xX][0-9a-fA-F]+', line) #GCC的表示方法
re_result = re.match('\s*_system_stack_size\s*=\s*0[xX][0-9a-fA-F]+', line) #GCC的表示方法, 将默认的栈大小增加到0x400
if re_result != None:
oldline = line
newline = re.sub('0[xX][0-9a-fA-F]+','0x000', oldline)
newline = re.sub('0[xX][0-9a-fA-F]+','0x400', oldline)
flag_need_replace = True
break