Skip to content

Commit 6a32fad

Browse files
committed
Add Generic F103Zx support
Signed-off-by: Frederic Pillon <[email protected]>
1 parent 757493c commit 6a32fad

File tree

7 files changed

+1118
-0
lines changed

7 files changed

+1118
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
108108
| :green_heart: | [BluePill F103C(6-8-B)](https://stm32-base.org/boards/STM32F103C8T6-Blue-Pill) | *1.2.0* | USB CDC support since *1.5.0*, Maple bootloaders support since *1.6.0* |
109109
| :green_heart: | [BlackPill F103C(8-B)](https://stm32-base.org/boards/STM32F103C8T6-Black-Pill) | *1.5.0* | |
110110
| :green_heart: | [Generic F103R(8-B-C-E)T6](https://stm32-base.org/boards/STM32F103RET6-Generic-Board) | *1.7.0* | Blue Button |
111+
| :yellow_heart: | Generic F103Z(C-D-E-F-G) | **1.8.1** | |
111112
| :green_heart: | HY-TinySTM103T | *1.5.0* | |
112113
| :green_heart: | MapleMini F103CB | *1.2.0* | USB CDC support since *1.5.0*, Maple bootloaders support since *1.6.0* |
113114

boards.txt

+37
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,42 @@ GenF1.menu.pnum.Generic_F103RET6.build.board=GENERIC_F103RET6
831831
GenF1.menu.pnum.Generic_F103RET6.build.product_line=STM32F103xE
832832
GenF1.menu.pnum.Generic_F103RET6.build.variant=Generic_F103Rx
833833

834+
# Generic STM32F103Zx boards
835+
GenF1.menu.pnum.Generic_F103ZC=Generic F103ZC
836+
GenF1.menu.pnum.Generic_F103ZC.upload.maximum_size=262144
837+
GenF1.menu.pnum.Generic_F103ZC.upload.maximum_data_size=49152
838+
GenF1.menu.pnum.Generic_F103ZC.build.board=Generic_F103ZC
839+
GenF1.menu.pnum.Generic_F103ZC.build.product_line=STM32F103xE
840+
GenF1.menu.pnum.Generic_F103ZC.build.variant=Generic_F103Zx
841+
842+
GenF1.menu.pnum.Generic_F103ZD=Generic F103ZD
843+
GenF1.menu.pnum.Generic_F103ZD.upload.maximum_size=393216
844+
GenF1.menu.pnum.Generic_F103ZD.upload.maximum_data_size=65536
845+
GenF1.menu.pnum.Generic_F103ZD.build.board=Generic_F103ZC
846+
GenF1.menu.pnum.Generic_F103ZD.build.product_line=STM32F103xE
847+
GenF1.menu.pnum.Generic_F103ZD.build.variant=Generic_F103Zx
848+
849+
GenF1.menu.pnum.Generic_F103ZE=Generic F103ZE
850+
GenF1.menu.pnum.Generic_F103ZE.upload.maximum_size=524288
851+
GenF1.menu.pnum.Generic_F103ZE.upload.maximum_data_size=65536
852+
GenF1.menu.pnum.Generic_F103ZE.build.board=Generic_F103ZE
853+
GenF1.menu.pnum.Generic_F103ZE.build.product_line=STM32F103xE
854+
GenF1.menu.pnum.Generic_F103ZE.build.variant=Generic_F103Zx
855+
856+
GenF1.menu.pnum.Generic_F103ZF=Generic F103ZF
857+
GenF1.menu.pnum.Generic_F103ZF.upload.maximum_size=786432
858+
GenF1.menu.pnum.Generic_F103ZF.upload.maximum_data_size=98304
859+
GenF1.menu.pnum.Generic_F103ZF.build.board=Generic_F103ZF
860+
GenF1.menu.pnum.Generic_F103ZF.build.product_line=STM32F103xG
861+
GenF1.menu.pnum.Generic_F103ZF.build.variant=Generic_F103Zx
862+
863+
GenF1.menu.pnum.Generic_F103ZG=Generic F103ZG
864+
GenF1.menu.pnum.Generic_F103ZG.upload.maximum_size=1048576
865+
GenF1.menu.pnum.Generic_F103ZG.upload.maximum_data_size=98304
866+
GenF1.menu.pnum.Generic_F103ZG.build.board=Generic_F103ZG
867+
GenF1.menu.pnum.Generic_F103ZG.build.product_line=STM32F103xG
868+
GenF1.menu.pnum.Generic_F103ZG.build.variant=Generic_F103Zx
869+
834870
# HY-TinySTM103TB board
835871
GenF1.menu.pnum.HY_TinySTM103TB=HY-TinySTM103TB
836872
GenF1.menu.pnum.HY_TinySTM103TB.upload.maximum_size=131072
@@ -847,6 +883,7 @@ GenF1.menu.pnum.MAPLEMINI_F103CB.build.board=MAPLEMINI_F103CB
847883
GenF1.menu.pnum.MAPLEMINI_F103CB.build.product_line=STM32F103xB
848884
GenF1.menu.pnum.MAPLEMINI_F103CB.build.variant=MAPLEMINI_F103CB
849885

886+
850887
# Upload menu
851888
GenF1.menu.upload_method.swdMethod=STM32CubeProgrammer (SWD)
852889
GenF1.menu.upload_method.swdMethod.upload.protocol=0

variants/Generic_F103Zx/PeripheralPins.c

+368
Large diffs are not rendered by default.

variants/Generic_F103Zx/PinNamesVar.h

+30
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 = 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_DM = PA_11,
29+
USB_DP = PA_12,
30+
#endif

variants/Generic_F103Zx/ldscript.ld

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

0 commit comments

Comments
 (0)