Skip to content

Commit 7bc50dd

Browse files
Merge pull request #6 from EmbeddedKitOrg/develop/nn
Develop/nn
2 parents ae8aa83 + 5881bc0 commit 7bc50dd

163 files changed

Lines changed: 472 additions & 196711 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ jobs:
4949
cmake -B build -G Ninja \
5050
-DCMAKE_TOOLCHAIN_FILE="cmake/gcc-arm-none-eabi.cmake" \
5151
-DCMAKE_BUILD_TYPE=Debug \
52-
-DLINKER_SCRIPT="L1_MCU/STM32F429ZIT6_GCC/STM32F429XX_FLASH.ld" \
53-
-DMCU_MODEL="STM32F429ZIT6_GCC" \
52+
-DLINKER_SCRIPT="L1_MCU/STM32F407VGT6_GCC/stm32f407vgt6_flash.ld" \
53+
-DMCU_MODEL="STM32F407VGT6_GCC"\
5454
-DUSE_FREERTOS=${{ matrix.config.freertos }} \
5555
-DUSE_FATFS=OFF \
5656
-DUSE_LVGL=${{ matrix.config.lvgl }}
@@ -96,8 +96,8 @@ jobs:
9696
cmake -B build -G Ninja `
9797
-DCMAKE_TOOLCHAIN_FILE="cmake/gcc-arm-none-eabi.cmake" `
9898
-DCMAKE_BUILD_TYPE=Debug `
99-
-DLINKER_SCRIPT="L1_MCU/STM32F429ZIT6_GCC/STM32F429XX_FLASH.ld" `
100-
-DMCU_MODEL="STM32F429ZIT6_GCC" `
99+
-DLINKER_SCRIPT="L1_MCU/STM32F407VGT6_GCC/stm32f407vgt6_flash.ld" `
100+
-DMCU_MODEL="STM32F407VGT6_GCC" `
101101
-DUSE_FREERTOS=${{ matrix.config.freertos }} `
102102
-DUSE_FATFS=OFF `
103103
-DUSE_LVGL=${{ matrix.config.lvgl }} `
Lines changed: 276 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,276 @@
1+
/*
2+
******************************************************************************
3+
**
4+
5+
** File : LinkerScript.ld
6+
**
7+
** Author : STM32CubeMX
8+
**
9+
** Abstract : Linker script for STM32F407VGTx series
10+
** 1024Kbytes FLASH and 192Kbytes RAM
11+
**
12+
** Set heap size, stack size and stack location according
13+
** to application requirements.
14+
**
15+
** Set memory bank area and size if external memory is used.
16+
**
17+
** Target : STMicroelectronics STM32
18+
**
19+
** Distribution: The file is distributed “as is,” without any warranty
20+
** of any kind.
21+
**
22+
*****************************************************************************
23+
** @attention
24+
**
25+
** <h2><center>&copy; COPYRIGHT(c) 2025 STMicroelectronics</center></h2>
26+
**
27+
** Redistribution and use in source and binary forms, with or without modification,
28+
** are permitted provided that the following conditions are met:
29+
** 1. Redistributions of source code must retain the above copyright notice,
30+
** this list of conditions and the following disclaimer.
31+
** 2. Redistributions in binary form must reproduce the above copyright notice,
32+
** this list of conditions and the following disclaimer in the documentation
33+
** and/or other materials provided with the distribution.
34+
** 3. Neither the name of STMicroelectronics nor the names of its contributors
35+
** may be used to endorse or promote products derived from this software
36+
** without specific prior written permission.
37+
**
38+
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
39+
** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40+
** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
41+
** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
42+
** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
43+
** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
44+
** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
45+
** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
46+
** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
47+
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
48+
**
49+
*****************************************************************************
50+
*/
51+
52+
/* Entry Point */
53+
ENTRY(Reset_Handler)
54+
55+
/* Specify the memory areas */
56+
MEMORY
57+
{
58+
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
59+
CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K
60+
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K
61+
}
62+
63+
/* Highest address of the user mode stack */
64+
_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of RAM */
65+
/* Generate a link error if heap and stack don't fit into RAM */
66+
_Min_Heap_Size = 0x200; /* required amount of heap */
67+
_Min_Stack_Size = 0x400; /* required amount of stack */
68+
69+
/* Define output sections */
70+
SECTIONS
71+
{
72+
/* The startup code goes first into FLASH */
73+
.isr_vector :
74+
{
75+
. = ALIGN(4);
76+
KEEP(*(.isr_vector)) /* Startup code */
77+
. = ALIGN(4);
78+
} >FLASH
79+
80+
/* The program code and other data goes into FLASH */
81+
.text :
82+
{
83+
. = ALIGN(4);
84+
*(.text) /* .text sections (code) */
85+
*(.text*) /* .text* sections (code) */
86+
*(.glue_7) /* glue arm to thumb code */
87+
*(.glue_7t) /* glue thumb to arm code */
88+
*(.eh_frame)
89+
90+
KEEP (*(.init))
91+
KEEP (*(.fini))
92+
93+
. = ALIGN(4);
94+
_etext = .; /* define a global symbols at end of code */
95+
} >FLASH
96+
97+
/* Constant data goes into FLASH */
98+
.rodata :
99+
{
100+
. = ALIGN(4);
101+
*(.rodata) /* .rodata sections (constants, strings, etc.) */
102+
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
103+
. = ALIGN(4);
104+
} >FLASH
105+
106+
.ARM.extab (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
107+
{
108+
. = ALIGN(4);
109+
*(.ARM.extab* .gnu.linkonce.armextab.*)
110+
. = ALIGN(4);
111+
} >FLASH
112+
113+
.ARM (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
114+
{
115+
. = ALIGN(4);
116+
__exidx_start = .;
117+
*(.ARM.exidx*)
118+
__exidx_end = .;
119+
. = ALIGN(4);
120+
} >FLASH
121+
122+
.preinit_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
123+
{
124+
. = ALIGN(4);
125+
PROVIDE_HIDDEN (__preinit_array_start = .);
126+
KEEP (*(.preinit_array*))
127+
PROVIDE_HIDDEN (__preinit_array_end = .);
128+
. = ALIGN(4);
129+
} >FLASH
130+
131+
.init_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
132+
{
133+
. = ALIGN(4);
134+
PROVIDE_HIDDEN (__init_array_start = .);
135+
KEEP (*(SORT(.init_array.*)))
136+
KEEP (*(.init_array*))
137+
PROVIDE_HIDDEN (__init_array_end = .);
138+
. = ALIGN(4);
139+
} >FLASH
140+
141+
.fini_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
142+
{
143+
. = ALIGN(4);
144+
PROVIDE_HIDDEN (__fini_array_start = .);
145+
KEEP (*(SORT(.fini_array.*)))
146+
KEEP (*(.fini_array*))
147+
PROVIDE_HIDDEN (__fini_array_end = .);
148+
. = ALIGN(4);
149+
} >FLASH
150+
151+
_siccmram = LOADADDR(.ccmram);
152+
153+
/* CCM-RAM section
154+
*
155+
* IMPORTANT NOTE!
156+
* If initialized variables will be placed in this section,
157+
* the startup code needs to be modified to copy the init-values.
158+
*/
159+
.ccmram :
160+
{
161+
. = ALIGN(4);
162+
_sccmram = .; /* create a global symbol at ccmram start */
163+
*(.ccmram)
164+
*(.ccmram*)
165+
166+
. = ALIGN(4);
167+
_eccmram = .; /* create a global symbol at ccmram end */
168+
} >CCMRAM AT> FLASH
169+
170+
/* used by the startup to initialize data */
171+
_sidata = LOADADDR(.data);
172+
173+
/* Initialized data sections goes into RAM, load LMA copy after code */
174+
.data :
175+
{
176+
. = ALIGN(4);
177+
_sdata = .; /* create a global symbol at data start */
178+
*(.data) /* .data sections */
179+
*(.data*) /* .data* sections */
180+
*(.RamFunc) /* .RamFunc sections */
181+
*(.RamFunc*) /* .RamFunc* sections */
182+
183+
. = ALIGN(4);
184+
} >RAM AT> FLASH
185+
186+
/* Initialized TLS data section */
187+
.tdata : ALIGN(4)
188+
{
189+
*(.tdata .tdata.* .gnu.linkonce.td.*)
190+
. = ALIGN(4);
191+
_edata = .; /* define a global symbol at data end */
192+
PROVIDE(__data_end = .);
193+
PROVIDE(__tdata_end = .);
194+
} >RAM AT> FLASH
195+
196+
PROVIDE( __tdata_start = ADDR(.tdata) );
197+
PROVIDE( __tdata_size = __tdata_end - __tdata_start );
198+
199+
PROVIDE( __data_start = ADDR(.data) );
200+
PROVIDE( __data_size = __data_end - __data_start );
201+
202+
PROVIDE( __tdata_source = LOADADDR(.tdata) );
203+
PROVIDE( __tdata_source_end = LOADADDR(.tdata) + SIZEOF(.tdata) );
204+
PROVIDE( __tdata_source_size = __tdata_source_end - __tdata_source );
205+
206+
PROVIDE( __data_source = LOADADDR(.data) );
207+
PROVIDE( __data_source_end = __tdata_source_end );
208+
PROVIDE( __data_source_size = __data_source_end - __data_source );
209+
/* Uninitialized data section */
210+
.tbss (NOLOAD) : ALIGN(4)
211+
{
212+
/* This is used by the startup in order to initialize the .bss secion */
213+
_sbss = .; /* define a global symbol at bss start */
214+
__bss_start__ = _sbss;
215+
*(.tbss .tbss.*)
216+
. = ALIGN(4);
217+
PROVIDE( __tbss_end = . );
218+
} >RAM
219+
220+
PROVIDE( __tbss_start = ADDR(.tbss) );
221+
PROVIDE( __tbss_size = __tbss_end - __tbss_start );
222+
PROVIDE( __tbss_offset = ADDR(.tbss) - ADDR(.tdata) );
223+
224+
PROVIDE( __tls_base = __tdata_start );
225+
PROVIDE( __tls_end = __tbss_end );
226+
PROVIDE( __tls_size = __tls_end - __tls_base );
227+
PROVIDE( __tls_align = MAX(ALIGNOF(.tdata), ALIGNOF(.tbss)) );
228+
PROVIDE( __tls_size_align = (__tls_size + __tls_align - 1) & ~(__tls_align - 1) );
229+
PROVIDE( __arm32_tls_tcb_offset = MAX(8, __tls_align) );
230+
PROVIDE( __arm64_tls_tcb_offset = MAX(16, __tls_align) );
231+
232+
.bss (NOLOAD) : ALIGN(4)
233+
{
234+
*(.bss)
235+
*(.bss*)
236+
*(COMMON)
237+
238+
. = ALIGN(4);
239+
_ebss = .; /* define a global symbol at bss end */
240+
__bss_end__ = _ebss;
241+
PROVIDE( __bss_end = .);
242+
} >RAM
243+
PROVIDE( __non_tls_bss_start = ADDR(.bss) );
244+
245+
PROVIDE( __bss_start = __tbss_start );
246+
PROVIDE( __bss_size = __bss_end - __bss_start );
247+
248+
/* User_heap_stack section, used to check that there is enough RAM left */
249+
._user_heap_stack (NOLOAD) :
250+
{
251+
. = ALIGN(8);
252+
PROVIDE ( end = . );
253+
PROVIDE ( _end = . );
254+
. = . + _Min_Heap_Size;
255+
. = . + _Min_Stack_Size;
256+
. = ALIGN(8);
257+
} >RAM
258+
259+
.ek_export :
260+
{
261+
. = ALIGN(4);
262+
_ek_export_fn_start = .;
263+
KEEP(*(SORT(.ek_export_fn*)))
264+
. = ALIGN(4);
265+
_ek_export_fn_end = .;
266+
} > FLASH
267+
268+
/* Remove information from the standard libraries */
269+
/DISCARD/ :
270+
{
271+
libc.a:* ( * )
272+
libm.a:* ( * )
273+
libgcc.a:* ( * )
274+
}
275+
276+
}

0 commit comments

Comments
 (0)