diff --git a/compiler/systems/t_embed.pas b/compiler/systems/t_embed.pas index a7c00c34b0..fa2c4ca8f0 100644 --- a/compiler/systems/t_embed.pas +++ b/compiler/systems/t_embed.pas @@ -1400,7 +1400,7 @@ begin Add(' flash (rx) : ORIGIN = 0x'+IntToHex(flashbase,6)+', LENGTH = 0x'+IntToHex(flashsize,6)); Add(' ram (rw!x) : ORIGIN = 0x'+IntToHex(srambase,6)+', LENGTH = 0x'+IntToHex(sramsize,6)); Add('}'); - Add('_stack_top = 0x' + IntToHex(srambase+sramsize-1,4) + ';'); + Add('_stack_top = 0x' + IntToHex(srambase+sramsize,4) + ';'); end; Add('SECTIONS'); Add('{'); diff --git a/compiler/systems/t_freertos.pas b/compiler/systems/t_freertos.pas index 4c40b0e235..9e2acabc53 100644 --- a/compiler/systems/t_freertos.pas +++ b/compiler/systems/t_freertos.pas @@ -830,7 +830,7 @@ begin Add(' flash (rx) : ORIGIN = 0x'+IntToHex(flashbase,6)+', LENGTH = 0x'+IntToHex(flashsize,6)); Add(' ram (rw!x) : ORIGIN = 0x'+IntToHex(srambase,6)+', LENGTH = 0x'+IntToHex(sramsize,6)); Add('}'); - Add('_stack_top = 0x' + IntToHex(srambase+sramsize-1,4) + ';'); + Add('_stack_top = 0x' + IntToHex(srambase+sramsize,4) + ';'); end; Add('SECTIONS'); Add('{');