Skip to content

Commit 6e601ab

Browse files
author
oclyke
committed
support tflu
this removes the need to patch the AmbiqSuite SDK - startup_gcc_tflu.c has an increased stack size - apollo3_tflu.ld is a linker script that provides the necessary symbols and C++ initialization array
1 parent 6398086 commit 6e601ab

File tree

2 files changed

+431
-0
lines changed

2 files changed

+431
-0
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/******************************************************************************
2+
*
3+
* apollo3_tflu.ld - linker script for apollo3 targets in tensorflow lite micro
4+
*
5+
*****************************************************************************/
6+
ENTRY(Reset_Handler)
7+
8+
MEMORY
9+
{
10+
FLASH (rx) : ORIGIN = 0x0000C000, LENGTH = 960K
11+
SRAM (rwx) : ORIGIN = 0x10000000, LENGTH = 384K
12+
}
13+
14+
SECTIONS
15+
{
16+
.text :
17+
{
18+
. = ALIGN(4);
19+
KEEP(*(.isr_vector))
20+
KEEP(*(.patch))
21+
*(.text)
22+
*(.text*)
23+
24+
/* These are the C++ global constructors. Stick them all here and
25+
* then walk through the array in main() calling them all.
26+
*/
27+
_init_array_start = .;
28+
KEEP (*(SORT(.init_array*)))
29+
_init_array_end = .;
30+
31+
/* XXX Currently not doing anything for global destructors. */
32+
33+
*(.rodata)
34+
*(.rodata*)
35+
. = ALIGN(4);
36+
_etext = .;
37+
} > FLASH
38+
39+
/* User stack section initialized by startup code. */
40+
.stack (NOLOAD):
41+
{
42+
. = ALIGN(8);
43+
*(.stack)
44+
*(.stack*)
45+
. = ALIGN(8);
46+
} > SRAM
47+
48+
.data :
49+
{
50+
. = ALIGN(4);
51+
_sdata = .;
52+
*(.data)
53+
*(.data*)
54+
. = ALIGN(4);
55+
_edata = .;
56+
} > SRAM AT>FLASH
57+
58+
/* used by startup to initialize data */
59+
_init_data = LOADADDR(.data);
60+
61+
.bss :
62+
{
63+
. = ALIGN(4);
64+
_sbss = .;
65+
*(.bss)
66+
*(.bss*)
67+
*(COMMON)
68+
. = ALIGN(4);
69+
_ebss = .;
70+
} > SRAM
71+
/* Add this to satisfy reference to symbol "end" from libnosys.a(sbrk.o)
72+
* to denote the HEAP start.
73+
*/
74+
end = .;
75+
76+
.ARM.attributes 0 : { *(.ARM.attributes) }
77+
}

0 commit comments

Comments
 (0)