Skip to content

Commit

Permalink
Fix linker scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
hedgecrw committed Nov 15, 2023
1 parent c7a57bf commit bad3802
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 64 deletions.
2 changes: 1 addition & 1 deletion software/firmware/.cproject
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildProperties="" description="" id="ilg.gnuarmeclipse.managedbuild.cross.toolchain.base.1790597438" name="Default" optionalBuildProperties="org.eclipse.cdt.docker.launcher.containerbuild.property.dockerdpath=,org.eclipse.cdt.docker.launcher.containerbuild.property.volumes=,org.eclipse.cdt.docker.launcher.containerbuild.property.selectedvolumes=" parent="org.eclipse.cdt.build.core.emptycfg">
<configuration artifactName="${ProjName}" buildProperties="" description="" id="ilg.gnuarmeclipse.managedbuild.cross.toolchain.base.1790597438" name="Default" optionalBuildProperties="org.eclipse.cdt.docker.launcher.containerbuild.property.dockerdpath=,org.eclipse.cdt.docker.launcher.containerbuild.property.selectedvolumes=,org.eclipse.cdt.docker.launcher.containerbuild.property.volumes=" parent="org.eclipse.cdt.build.core.emptycfg">
<folderInfo id="ilg.gnuarmeclipse.managedbuild.cross.toolchain.base.1790597438.1033093985" name="/" resourcePath="">
<toolChain id="ilg.gnuarmeclipse.managedbuild.cross.toolchain.base.1406672748" name="Arm Cross GCC" superClass="ilg.gnuarmeclipse.managedbuild.cross.toolchain.base">
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.architecture.275751269" name="Architecture" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.architecture" value="ilg.gnuarmeclipse.managedbuild.cross.option.architecture.arm" valueType="enumerated"/>
Expand Down
2 changes: 1 addition & 1 deletion software/firmware/.settings/language.settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1347002660722691700" id="org.eclipse.embedcdt.managedbuild.cross.arm.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Arm Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-339510081203349785" id="org.eclipse.embedcdt.managedbuild.cross.arm.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Arm Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand Down
50 changes: 23 additions & 27 deletions software/firmware/AmbiqSDK/bsp/apollo4_blue/linker/socitrack.ld
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ SECTIONS
KEEP(*(.isr_vector))
KEEP(*(.patch))
. = ALIGN(4);
}
} > MCU_MRAM

.text :
{
Expand All @@ -39,7 +39,6 @@ SECTIONS
*(.rodata)
*(.rodata*)
. = ALIGN(4);
_etext = .;
} > MCU_MRAM

.ARM.exidx :
Expand All @@ -49,24 +48,8 @@ SECTIONS
__exidx_end = .;
} > MCU_MRAM

/* User stack section initialized by startup code. */
.stack (NOLOAD):
{
. = ALIGN(8);
*(.stack)
*(.stack*)
. = ALIGN(8);
} > MCU_TCM

.heap : {
__heap_start__ = .;
end = __heap_start__;
_end = end;
__end = end;
KEEP(*(.heap))
__heap_end__ = .;
__HeapLimit = __heap_end__;
} > MCU_TCM
. = ALIGN(8);
_etext = .;

.data :
{
Expand All @@ -81,7 +64,7 @@ SECTIONS
/* used by startup to initialize data */
_init_data = LOADADDR(.data);

.bss :
.bss (NOLOAD):
{
. = ALIGN(4);
_sbss = .;
Expand All @@ -92,13 +75,26 @@ SECTIONS
_ebss = .;
} > MCU_TCM

.shared :
.heap (NOLOAD):
{
. = ALIGN(4);
KEEP(*(.resource_table))
KEEP(*(.shared))
. = ALIGN(4);
} > SHARED_SRAM AT>MCU_MRAM
__heap_start__ = .;
end = __heap_start__;
_end = end;
__end = end;
KEEP(*(.heap))
__heap_end__ = .;
__HeapLimit = __heap_end__;
} > MCU_TCM

/* User stack section initialized by startup code. */
.stack (NOLOAD):
{
. = ALIGN(8);
*(.stack)
*(.stack*)
. = ALIGN(8);
} > MCU_TCM

.ARM.attributes 0 : { *(.ARM.attributes) }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,6 @@ extern int main(void);
__attribute__ ((section(".stack")))
static uint32_t g_pui32Stack[0xac0];

__attribute__ ((section(".heap"))) __attribute__ ((__used__))
static uint32_t g_pui32Heap[0];

//*****************************************************************************
//
// The vector table.
Expand Down
52 changes: 23 additions & 29 deletions software/firmware/AmbiqSDK/bsp/apollo4_blue_pro/linker/socitrack.ld
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ SECTIONS
KEEP(*(.isr_vector))
KEEP(*(.patch))
. = ALIGN(4);
}
} > MCU_MRAM

.text :
{
Expand All @@ -39,7 +39,6 @@ SECTIONS
*(.rodata)
*(.rodata*)
. = ALIGN(4);
_etext = .;
} > MCU_MRAM

.ARM.exidx :
Expand All @@ -48,42 +47,24 @@ SECTIONS
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
__exidx_end = .;
} > MCU_MRAM
_etext = .;

/* User stack section initialized by startup code. */
.stack (NOLOAD):
{
. = ALIGN(8);
*(.stack)
*(.stack*)
. = ALIGN(8);
} > MCU_TCM

.heap (NOLOAD): {
__heap_start__ = .;
end = __heap_start__;
_end = end;
__end = end;
KEEP(*(.heap))
__heap_end__ = .;
__HeapLimit = __heap_end__;
} > MCU_TCM
. = ALIGN(8);
_etext = .;

.data :
{
. = ALIGN(4);
_sdata = .;
*(.data)
*(.data*)
*(.ramfunc)
. = ALIGN(4);
_edata = .;
} > MCU_TCM AT>MCU_MRAM

/* used by startup to initialize data */
_init_data = LOADADDR(.data);

.bss :
.bss (NOLOAD):
{
. = ALIGN(4);
_sbss = .;
Expand All @@ -94,13 +75,26 @@ SECTIONS
_ebss = .;
} > MCU_TCM

.shared (NOLOAD):
.heap (NOLOAD):
{
. = ALIGN(4);
KEEP(*(.resource_table))
KEEP(*(.shared))
. = ALIGN(4);
} > SHARED_SRAM AT>MCU_MRAM
__heap_start__ = .;
end = __heap_start__;
_end = end;
__end = end;
KEEP(*(.heap))
__heap_end__ = .;
__HeapLimit = __heap_end__;
} > MCU_TCM

/* User stack section initialized by startup code. */
.stack (NOLOAD):
{
. = ALIGN(8);
*(.stack)
*(.stack*)
. = ALIGN(8);
} > MCU_TCM

.ARM.attributes 0 : { *(.ARM.attributes) }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,6 @@ extern int main(void);
__attribute__ ((section(".stack")))
static uint32_t g_pui32Stack[0xac0];

__attribute__ ((section(".heap"))) __attribute__ ((__used__))
static uint32_t g_pui32Heap[0];

//*****************************************************************************
//
// The vector table.
Expand Down

0 comments on commit bad3802

Please sign in to comment.