Skip to content

Commit 8ebe376

Browse files
committed
[G4] Add Nucleo-G474RE support
Signed-off-by: Frederic Pillon <[email protected]>
1 parent 232da44 commit 8ebe376

File tree

7 files changed

+924
-0
lines changed

7 files changed

+924
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
6262
| :green_heart: | [Nucleo F411RE](http://www.st.com/en/evaluation-tools/nucleo-f411re.html) | *0.2.1* | |
6363
| :green_heart: | [Nucleo F446RE](http://www.st.com/en/evaluation-tools/nucleo-f446re.html) | *1.1.1* | |
6464
| :green_heart: | [Nucleo-G071RB](https://www.st.com/en/evaluation-tools/nucleo-g071rb.html) | *1.6.0* | |
65+
| :yellow_heart: | [Nucleo-G474RE](https://www.st.com/en/evaluation-tools/nucleo-g474re.html) | **1.7.0** | |
6566
| :green_heart: | [Nucleo L053R8](http://www.st.com/en/evaluation-tools/nucleo-l053r8.html) | *0.1.0* | |
6667
| :green_heart: | [Nucleo L073RZ](http://www.st.com/en/evaluation-tools/nucleo-l073rz.html) | *1.4.0* | |
6768
| :green_heart: | [Nucleo L152RE](http://www.st.com/en/evaluation-tools/nucleo-l152re.html) | *1.0.0* | |

boards.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,18 @@ Nucleo_64.menu.pnum.NUCLEO_G071RB.build.variant=NUCLEO_G071RB
268268
Nucleo_64.menu.pnum.NUCLEO_G071RB.build.cmsis_lib_gcc=arm_cortexM0l_math
269269
Nucleo_64.menu.pnum.NUCLEO_G071RB.build.extra_flags=-D{build.product_line} {build.enable_usb} {build.xSerial} -D__CORTEX_SC=0
270270

271+
# NUCLEO_G474RE board
272+
Nucleo_64.menu.pnum.NUCLEO_G474RE=Nucleo G474RE
273+
Nucleo_64.menu.pnum.NUCLEO_G474RE.node=NODE_G474RE
274+
Nucleo_64.menu.pnum.NUCLEO_G474RE.upload.maximum_size=524288
275+
Nucleo_64.menu.pnum.NUCLEO_G474RE.upload.maximum_data_size=131072
276+
Nucleo_64.menu.pnum.NUCLEO_G474RE.build.mcu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard
277+
Nucleo_64.menu.pnum.NUCLEO_G474RE.build.board=NUCLEO_G474RE
278+
Nucleo_64.menu.pnum.NUCLEO_G474RE.build.series=STM32G4xx
279+
Nucleo_64.menu.pnum.NUCLEO_G474RE.build.product_line=STM32G474xx
280+
Nucleo_64.menu.pnum.NUCLEO_G474RE.build.variant=NUCLEO_G474RE
281+
Nucleo_64.menu.pnum.NUCLEO_G474RE.build.cmsis_lib_gcc=arm_cortexM4l_math
282+
271283
# NUCLEO_L053R8 board
272284
Nucleo_64.menu.pnum.NUCLEO_L053R8=Nucleo L053R8
273285
Nucleo_64.menu.pnum.NUCLEO_L053R8.node=NODE_L053R8

variants/NUCLEO_G474RE/PeripheralPins.c

Lines changed: 395 additions & 0 deletions
Large diffs are not rendered by default.

variants/NUCLEO_G474RE/PinNamesVar.h

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/* SYS_WKUP */
2+
#ifdef PWR_WAKEUP_PIN1
3+
SYS_WKUP1 = PA_0,
4+
#endif
5+
#ifdef PWR_WAKEUP_PIN2
6+
SYS_WKUP2 = PC_13,
7+
#endif
8+
#ifdef PWR_WAKEUP_PIN3
9+
SYS_WKUP3 = PE_6,
10+
#endif
11+
#ifdef PWR_WAKEUP_PIN4
12+
SYS_WKUP4 = PA_2,
13+
#endif
14+
#ifdef PWR_WAKEUP_PIN5
15+
SYS_WKUP5 = PC_5,
16+
#endif
17+
#ifdef PWR_WAKEUP_PIN6
18+
SYS_WKUP6 = NC,
19+
#endif
20+
#ifdef PWR_WAKEUP_PIN7
21+
SYS_WKUP7 = NC,
22+
#endif
23+
#ifdef PWR_WAKEUP_PIN8
24+
SYS_WKUP8 = NC,
25+
#endif
26+
/* USB */
27+
#ifdef USBCON
28+
USB_DM = PA_11,
29+
USB_DP = PA_12,
30+
#endif

variants/NUCLEO_G474RE/ldscript.ld

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
/*
2+
******************************************************************************
3+
**
4+
** File : LinkerScript.ld
5+
**
6+
** Author : Auto-generated by STM32CubeIDE
7+
**
8+
** Abstract : Linker script for NUCLEO-G474RE Board embedding STM32G474RETx Device from STM32G4 series
9+
** 512Kbytes FLASH
10+
** 128Kbytes 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) 2019 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+
/* Highest address of the user mode stack */
56+
_estack = 0x20020000; /* end of "RAM" Ram type memory */
57+
58+
_Min_Heap_Size = 0x200; /* required amount of heap */
59+
_Min_Stack_Size = 0x400; /* required amount of stack */
60+
61+
/* Memories definition */
62+
MEMORY
63+
{
64+
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
65+
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 512K
66+
}
67+
68+
/* Sections */
69+
SECTIONS
70+
{
71+
/* The startup code into "FLASH" Rom type memory */
72+
.isr_vector :
73+
{
74+
. = ALIGN(4);
75+
KEEP(*(.isr_vector)) /* Startup code */
76+
. = ALIGN(4);
77+
} >FLASH
78+
79+
/* The program code and other data into "FLASH" Rom type memory */
80+
.text :
81+
{
82+
. = ALIGN(4);
83+
*(.text) /* .text sections (code) */
84+
*(.text*) /* .text* sections (code) */
85+
*(.glue_7) /* glue arm to thumb code */
86+
*(.glue_7t) /* glue thumb to arm code */
87+
*(.eh_frame)
88+
89+
KEEP (*(.init))
90+
KEEP (*(.fini))
91+
92+
. = ALIGN(4);
93+
_etext = .; /* define a global symbols at end of code */
94+
} >FLASH
95+
96+
/* Constant data into "FLASH" Rom type memory */
97+
.rodata :
98+
{
99+
. = ALIGN(4);
100+
*(.rodata) /* .rodata sections (constants, strings, etc.) */
101+
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
102+
. = ALIGN(4);
103+
} >FLASH
104+
105+
.ARM.extab : {
106+
. = ALIGN(4);
107+
*(.ARM.extab* .gnu.linkonce.armextab.*)
108+
. = ALIGN(4);
109+
} >FLASH
110+
111+
.ARM : {
112+
. = ALIGN(4);
113+
__exidx_start = .;
114+
*(.ARM.exidx*)
115+
__exidx_end = .;
116+
. = ALIGN(4);
117+
} >FLASH
118+
119+
.preinit_array :
120+
{
121+
. = ALIGN(4);
122+
PROVIDE_HIDDEN (__preinit_array_start = .);
123+
KEEP (*(.preinit_array*))
124+
PROVIDE_HIDDEN (__preinit_array_end = .);
125+
. = ALIGN(4);
126+
} >FLASH
127+
128+
.init_array :
129+
{
130+
. = ALIGN(4);
131+
PROVIDE_HIDDEN (__init_array_start = .);
132+
KEEP (*(SORT(.init_array.*)))
133+
KEEP (*(.init_array*))
134+
PROVIDE_HIDDEN (__init_array_end = .);
135+
. = ALIGN(4);
136+
} >FLASH
137+
138+
.fini_array :
139+
{
140+
. = ALIGN(4);
141+
PROVIDE_HIDDEN (__fini_array_start = .);
142+
KEEP (*(SORT(.fini_array.*)))
143+
KEEP (*(.fini_array*))
144+
PROVIDE_HIDDEN (__fini_array_end = .);
145+
. = ALIGN(4);
146+
} >FLASH
147+
148+
/* Used by the startup to initialize data */
149+
_sidata = LOADADDR(.data);
150+
151+
/* Initialized data sections into "RAM" Ram type memory */
152+
.data :
153+
{
154+
. = ALIGN(4);
155+
_sdata = .; /* create a global symbol at data start */
156+
*(.data) /* .data sections */
157+
*(.data*) /* .data* sections */
158+
159+
. = ALIGN(4);
160+
_edata = .; /* define a global symbol at data end */
161+
162+
} >RAM AT> FLASH
163+
164+
/* Uninitialized data section into "RAM" Ram type memory */
165+
. = ALIGN(4);
166+
.bss :
167+
{
168+
/* This is used by the startup in order to initialize the .bss secion */
169+
_sbss = .; /* define a global symbol at bss start */
170+
__bss_start__ = _sbss;
171+
*(.bss)
172+
*(.bss*)
173+
*(COMMON)
174+
175+
. = ALIGN(4);
176+
_ebss = .; /* define a global symbol at bss end */
177+
__bss_end__ = _ebss;
178+
} >RAM
179+
180+
/* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */
181+
._user_heap_stack :
182+
{
183+
. = ALIGN(8);
184+
PROVIDE ( end = . );
185+
PROVIDE ( _end = . );
186+
. = . + _Min_Heap_Size;
187+
. = . + _Min_Stack_Size;
188+
. = ALIGN(8);
189+
} >RAM
190+
191+
/* Remove information from the compiler libraries */
192+
/DISCARD/ :
193+
{
194+
libc.a ( * )
195+
libm.a ( * )
196+
libgcc.a ( * )
197+
}
198+
199+
.ARM.attributes 0 : { *(.ARM.attributes) }
200+
}

0 commit comments

Comments
 (0)