Skip to content

Commit 2b723f8

Browse files
ladyadafpistm
authored andcommitted
New board definition - Adafruit Feather STM32F405 (#701)
1 parent b4c6e2e commit 2b723f8

File tree

7 files changed

+920
-0
lines changed

7 files changed

+920
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
112112

113113
| Status | Generic STM32F4xx | Release | Comment |
114114
| :---: | --- | :---: | :--- |
115+
| :yellow_heart: | [Adafruit Feather STM32F405 Express](https://www.adafruit.com/product/4382) | **1.8.0** | |
115116
| :green_heart: | BlackPill F401CC | *1.7.0* | |
116117
| :green_heart: | [Black F407VET6](https://stm32-base.org/boards/STM32F407VET6-STM32-F4VE-V2.0) | *1.4.0* | VG/ZE/ZG in *1.5.0* |
117118
| :green_heart: | [Blue F407VET6 Mini](https://stm32-base.org/boards/STM32F407VET6-VCC-GND-Small) | *1.4.0* | |

boards.txt

+8
Original file line numberDiff line numberDiff line change
@@ -983,6 +983,14 @@ GenF4.menu.pnum.CoreBoard_F401RC.build.board=CoreBoard_F401RC
983983
GenF4.menu.pnum.CoreBoard_F401RC.build.product_line=STM32F401xC
984984
GenF4.menu.pnum.CoreBoard_F401RC.build.variant=CoreBoard_F401RC
985985

986+
# Adafruit Feather STM32F405 board
987+
GenF4.menu.pnum.FEATHER_F405=Adafruit Feather STM32F405
988+
GenF4.menu.pnum.FEATHER_F405.upload.maximum_size=1048576
989+
GenF4.menu.pnum.FEATHER_F405.upload.maximum_data_size=131072
990+
GenF4.menu.pnum.FEATHER_F405.build.board=FEATHER_F405
991+
GenF4.menu.pnum.FEATHER_F405.build.product_line=STM32F405xx
992+
GenF4.menu.pnum.FEATHER_F405.build.variant=FEATHER_F405
993+
986994
# Upload menu
987995
GenF4.menu.upload_method.swdMethod=STM32CubeProgrammer (SWD)
988996
GenF4.menu.upload_method.swdMethod.upload.protocol=0

variants/FEATHER_F405/PeripheralPins.c

+347
Large diffs are not rendered by default.

variants/FEATHER_F405/PinNamesVar.h

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/* SYS_WKUP */
2+
#ifdef PWR_WAKEUP_PIN1
3+
SYS_WKUP1 = PA_0,
4+
#endif
5+
#ifdef PWR_WAKEUP_PIN2
6+
SYS_WKUP2 = NC,
7+
#endif
8+
#ifdef PWR_WAKEUP_PIN3
9+
SYS_WKUP3 = NC,
10+
#endif
11+
#ifdef PWR_WAKEUP_PIN4
12+
SYS_WKUP4 = NC,
13+
#endif
14+
#ifdef PWR_WAKEUP_PIN5
15+
SYS_WKUP5 = NC,
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_OTG_FS_SOF = PA_8,
29+
USB_OTG_FS_VBUS = PA_9,
30+
USB_OTG_FS_ID = PA_10,
31+
USB_OTG_FS_DM = PA_11,
32+
USB_OTG_FS_DP = PA_12,
33+
USB_OTG_HS_ULPI_D0 = PA_3,
34+
USB_OTG_HS_SOF = PA_4,
35+
USB_OTG_HS_ULPI_CK = PA_5,
36+
USB_OTG_HS_ULPI_D1 = PB_0,
37+
USB_OTG_HS_ULPI_D2 = PB_1,
38+
USB_OTG_HS_ULPI_D7 = PB_5,
39+
USB_OTG_HS_ULPI_D3 = PB_10,
40+
USB_OTG_HS_ULPI_D4 = PB_11,
41+
USB_OTG_HS_ID = PB_12,
42+
USB_OTG_HS_ULPI_D5 = PB_12,
43+
USB_OTG_HS_ULPI_D6 = PB_13,
44+
USB_OTG_HS_VBUS = PB_13,
45+
USB_OTG_HS_DM = PB_14,
46+
USB_OTG_HS_DP = PB_15,
47+
USB_OTG_HS_ULPI_STP = PC_0,
48+
USB_OTG_HS_ULPI_DIR = PC_2,
49+
USB_OTG_HS_ULPI_NXT = PC_3,
50+
#endif

variants/FEATHER_F405/ldscript.ld

+208
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
/*
2+
*****************************************************************************
3+
**
4+
5+
** File : LinkerScript.ld
6+
**
7+
**
8+
** Abstract : Linker script for STM32F405RGTx series
9+
** 1024Kbytes FLASH and 128Kbytes RAM
10+
**
11+
** Set heap size, stack size and stack location according
12+
** to application requirements.
13+
**
14+
** Set memory bank area and size if external memory is used.
15+
**
16+
** Target : STMicroelectronics STM32
17+
**
18+
** Distribution: The file is distributed “as is,” without any warranty
19+
** of any kind.
20+
**
21+
*****************************************************************************
22+
** @attention
23+
**
24+
** <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
25+
**
26+
** Redistribution and use in source and binary forms, with or without modification,
27+
** are permitted provided that the following conditions are met:
28+
** 1. Redistributions of source code must retain the above copyright notice,
29+
** this list of conditions and the following disclaimer.
30+
** 2. Redistributions in binary form must reproduce the above copyright notice,
31+
** this list of conditions and the following disclaimer in the documentation
32+
** and/or other materials provided with the distribution.
33+
** 3. Neither the name of STMicroelectronics nor the names of its contributors
34+
** may be used to endorse or promote products derived from this software
35+
** without specific prior written permission.
36+
**
37+
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
38+
** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
39+
** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
40+
** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
41+
** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
42+
** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
43+
** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
44+
** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
45+
** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
46+
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
47+
**
48+
*****************************************************************************
49+
*/
50+
51+
/* Entry Point */
52+
ENTRY(Reset_Handler)
53+
54+
/* Highest address of the user mode stack */
55+
_estack = 0x20000000 + LD_MAX_DATA_SIZE; /* end of RAM */
56+
/* Generate a link error if heap and stack don't fit into RAM */
57+
_Min_Heap_Size = 0x200; /* required amount of heap */
58+
_Min_Stack_Size = 0x400; /* required amount of stack */
59+
60+
/* Specify the memory areas */
61+
MEMORY
62+
{
63+
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE
64+
CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K
65+
FLASH (rx) : ORIGIN = 0x8000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET
66+
}
67+
68+
/* Define output sections */
69+
SECTIONS
70+
{
71+
/* The startup code goes first into FLASH */
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 goes into FLASH */
80+
.text ALIGN(8):
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 goes into FLASH */
97+
.rodata ALIGN(4):
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 : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
106+
.ARM : {
107+
__exidx_start = .;
108+
*(.ARM.exidx*)
109+
__exidx_end = .;
110+
} >FLASH
111+
112+
.preinit_array :
113+
{
114+
PROVIDE_HIDDEN (__preinit_array_start = .);
115+
KEEP (*(.preinit_array*))
116+
PROVIDE_HIDDEN (__preinit_array_end = .);
117+
} >FLASH
118+
.init_array :
119+
{
120+
PROVIDE_HIDDEN (__init_array_start = .);
121+
KEEP (*(SORT(.init_array.*)))
122+
KEEP (*(.init_array*))
123+
PROVIDE_HIDDEN (__init_array_end = .);
124+
} >FLASH
125+
.fini_array :
126+
{
127+
PROVIDE_HIDDEN (__fini_array_start = .);
128+
KEEP (*(SORT(.fini_array.*)))
129+
KEEP (*(.fini_array*))
130+
PROVIDE_HIDDEN (__fini_array_end = .);
131+
} >FLASH
132+
133+
/* used by the startup to initialize data */
134+
_sidata = LOADADDR(.data);
135+
136+
/* Initialized data sections goes into RAM, load LMA copy after code */
137+
.data :
138+
{
139+
. = ALIGN(4);
140+
_sdata = .; /* create a global symbol at data start */
141+
*(.data) /* .data sections */
142+
*(.data*) /* .data* sections */
143+
144+
. = ALIGN(4);
145+
_edata = .; /* define a global symbol at data end */
146+
} >RAM AT> FLASH
147+
148+
_siccmram = LOADADDR(.ccmram);
149+
150+
/* CCM-RAM section
151+
*
152+
* IMPORTANT NOTE!
153+
* If initialized variables will be placed in this section,
154+
* the startup code needs to be modified to copy the init-values.
155+
*/
156+
.ccmram :
157+
{
158+
. = ALIGN(4);
159+
_sccmram = .; /* create a global symbol at ccmram start */
160+
*(.ccmram)
161+
*(.ccmram*)
162+
163+
. = ALIGN(4);
164+
_eccmram = .; /* create a global symbol at ccmram end */
165+
} >CCMRAM AT> FLASH
166+
167+
168+
/* Uninitialized data section */
169+
. = ALIGN(4);
170+
.bss :
171+
{
172+
/* This is used by the startup in order to initialize the .bss secion */
173+
_sbss = .; /* define a global symbol at bss start */
174+
__bss_start__ = _sbss;
175+
*(.bss)
176+
*(.bss*)
177+
*(COMMON)
178+
179+
. = ALIGN(4);
180+
_ebss = .; /* define a global symbol at bss end */
181+
__bss_end__ = _ebss;
182+
} >RAM
183+
184+
/* User_heap_stack section, used to check that there is enough RAM left */
185+
._user_heap_stack :
186+
{
187+
. = ALIGN(8);
188+
PROVIDE ( end = . );
189+
PROVIDE ( _end = . );
190+
. = . + _Min_Heap_Size;
191+
. = . + _Min_Stack_Size;
192+
. = ALIGN(8);
193+
} >RAM
194+
195+
196+
197+
/* Remove information from the standard libraries */
198+
/DISCARD/ :
199+
{
200+
libc.a ( * )
201+
libm.a ( * )
202+
libgcc.a ( * )
203+
}
204+
205+
.ARM.attributes 0 : { *(.ARM.attributes) }
206+
}
207+
208+

0 commit comments

Comments
 (0)