Skip to content

Commit

Permalink
Add Generic F103Zx support
Browse files Browse the repository at this point in the history
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
  • Loading branch information
fpistm committed Jan 3, 2020
1 parent 757493c commit 6a32fad
Show file tree
Hide file tree
Showing 7 changed files with 1,118 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
| :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* |
| :green_heart: | [BlackPill F103C(8-B)](https://stm32-base.org/boards/STM32F103C8T6-Black-Pill) | *1.5.0* | |
| :green_heart: | [Generic F103R(8-B-C-E)T6](https://stm32-base.org/boards/STM32F103RET6-Generic-Board) | *1.7.0* | Blue Button |
| :yellow_heart: | Generic F103Z(C-D-E-F-G) | **1.8.1** | |
| :green_heart: | HY-TinySTM103T | *1.5.0* | |
| :green_heart: | MapleMini F103CB | *1.2.0* | USB CDC support since *1.5.0*, Maple bootloaders support since *1.6.0* |

Expand Down
37 changes: 37 additions & 0 deletions boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,42 @@ GenF1.menu.pnum.Generic_F103RET6.build.board=GENERIC_F103RET6
GenF1.menu.pnum.Generic_F103RET6.build.product_line=STM32F103xE
GenF1.menu.pnum.Generic_F103RET6.build.variant=Generic_F103Rx

# Generic STM32F103Zx boards
GenF1.menu.pnum.Generic_F103ZC=Generic F103ZC
GenF1.menu.pnum.Generic_F103ZC.upload.maximum_size=262144
GenF1.menu.pnum.Generic_F103ZC.upload.maximum_data_size=49152
GenF1.menu.pnum.Generic_F103ZC.build.board=Generic_F103ZC
GenF1.menu.pnum.Generic_F103ZC.build.product_line=STM32F103xE
GenF1.menu.pnum.Generic_F103ZC.build.variant=Generic_F103Zx

GenF1.menu.pnum.Generic_F103ZD=Generic F103ZD
GenF1.menu.pnum.Generic_F103ZD.upload.maximum_size=393216
GenF1.menu.pnum.Generic_F103ZD.upload.maximum_data_size=65536
GenF1.menu.pnum.Generic_F103ZD.build.board=Generic_F103ZC
GenF1.menu.pnum.Generic_F103ZD.build.product_line=STM32F103xE
GenF1.menu.pnum.Generic_F103ZD.build.variant=Generic_F103Zx

GenF1.menu.pnum.Generic_F103ZE=Generic F103ZE
GenF1.menu.pnum.Generic_F103ZE.upload.maximum_size=524288
GenF1.menu.pnum.Generic_F103ZE.upload.maximum_data_size=65536
GenF1.menu.pnum.Generic_F103ZE.build.board=Generic_F103ZE
GenF1.menu.pnum.Generic_F103ZE.build.product_line=STM32F103xE
GenF1.menu.pnum.Generic_F103ZE.build.variant=Generic_F103Zx

GenF1.menu.pnum.Generic_F103ZF=Generic F103ZF
GenF1.menu.pnum.Generic_F103ZF.upload.maximum_size=786432
GenF1.menu.pnum.Generic_F103ZF.upload.maximum_data_size=98304
GenF1.menu.pnum.Generic_F103ZF.build.board=Generic_F103ZF
GenF1.menu.pnum.Generic_F103ZF.build.product_line=STM32F103xG
GenF1.menu.pnum.Generic_F103ZF.build.variant=Generic_F103Zx

GenF1.menu.pnum.Generic_F103ZG=Generic F103ZG
GenF1.menu.pnum.Generic_F103ZG.upload.maximum_size=1048576
GenF1.menu.pnum.Generic_F103ZG.upload.maximum_data_size=98304
GenF1.menu.pnum.Generic_F103ZG.build.board=Generic_F103ZG
GenF1.menu.pnum.Generic_F103ZG.build.product_line=STM32F103xG
GenF1.menu.pnum.Generic_F103ZG.build.variant=Generic_F103Zx

# HY-TinySTM103TB board
GenF1.menu.pnum.HY_TinySTM103TB=HY-TinySTM103TB
GenF1.menu.pnum.HY_TinySTM103TB.upload.maximum_size=131072
Expand All @@ -847,6 +883,7 @@ GenF1.menu.pnum.MAPLEMINI_F103CB.build.board=MAPLEMINI_F103CB
GenF1.menu.pnum.MAPLEMINI_F103CB.build.product_line=STM32F103xB
GenF1.menu.pnum.MAPLEMINI_F103CB.build.variant=MAPLEMINI_F103CB


# Upload menu
GenF1.menu.upload_method.swdMethod=STM32CubeProgrammer (SWD)
GenF1.menu.upload_method.swdMethod.upload.protocol=0
Expand Down
368 changes: 368 additions & 0 deletions variants/Generic_F103Zx/PeripheralPins.c

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions variants/Generic_F103Zx/PinNamesVar.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/* SYS_WKUP */
#ifdef PWR_WAKEUP_PIN1
SYS_WKUP1 = PA_0,
#endif
#ifdef PWR_WAKEUP_PIN2
SYS_WKUP2 = NC,
#endif
#ifdef PWR_WAKEUP_PIN3
SYS_WKUP3 = NC,
#endif
#ifdef PWR_WAKEUP_PIN4
SYS_WKUP4 = NC,
#endif
#ifdef PWR_WAKEUP_PIN5
SYS_WKUP5 = NC,
#endif
#ifdef PWR_WAKEUP_PIN6
SYS_WKUP6 = NC,
#endif
#ifdef PWR_WAKEUP_PIN7
SYS_WKUP7 = NC,
#endif
#ifdef PWR_WAKEUP_PIN8
SYS_WKUP8 = NC,
#endif
/* USB */
#ifdef USBCON
USB_DM = PA_11,
USB_DP = PA_12,
#endif
200 changes: 200 additions & 0 deletions variants/Generic_F103Zx/ldscript.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
/*
******************************************************************************
**

** File : LinkerScript.ld
**
** Author : Auto-generated by STM32CubeIDE
**
** Abstract : Linker script for STM32F103Z(C/D/E/G/GTx Device from STM32F1 series
** 256/386/512K/786/1024bytes FLASH
** 48/64/96Kbytes RAM
**
** Set heap size, stack size and stack location according
** to application requirements.
**
** Set memory bank area and size if external memory is used.
**
** Target : STMicroelectronics STM32
**
** Distribution: The file is distributed as is without any warranty
** of any kind.
**
*****************************************************************************
** @attention
**
** <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
**
** Redistribution and use in source and binary forms, with or without modification,
** are permitted provided that the following conditions are met:
** 1. Redistributions of source code must retain the above copyright notice,
** this list of conditions and the following disclaimer.
** 2. Redistributions in binary form must reproduce the above copyright notice,
** this list of conditions and the following disclaimer in the documentation
** and/or other materials provided with the distribution.
** 3. Neither the name of STMicroelectronics nor the names of its contributors
** may be used to endorse or promote products derived from this software
** without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**
*****************************************************************************
*/

/* Entry Point */
ENTRY(Reset_Handler)

/* Highest address of the user mode stack */
_estack = 0x20000000 + LD_MAX_DATA_SIZE; /* end of "RAM" Ram type memory */
_Min_Heap_Size = 0x200; /* required amount of heap */
_Min_Stack_Size = 0x400; /* required amount of stack */

/* Memories definition */
MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE
FLASH (rx) : ORIGIN = 0x8000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET
}

/* Sections */
SECTIONS
{
/* The startup code into "FLASH" Rom type memory */
.isr_vector :
{
. = ALIGN(4);
KEEP(*(.isr_vector)) /* Startup code */
. = ALIGN(4);
} >FLASH

/* The program code and other data into "FLASH" Rom type memory */
.text :
{
. = ALIGN(4);
*(.text) /* .text sections (code) */
*(.text*) /* .text* sections (code) */
*(.glue_7) /* glue arm to thumb code */
*(.glue_7t) /* glue thumb to arm code */
*(.eh_frame)

KEEP (*(.init))
KEEP (*(.fini))

. = ALIGN(4);
_etext = .; /* define a global symbols at end of code */
} >FLASH

/* Constant data into "FLASH" Rom type memory */
.rodata :
{
. = ALIGN(4);
*(.rodata) /* .rodata sections (constants, strings, etc.) */
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
. = ALIGN(4);
} >FLASH

.ARM.extab : {
. = ALIGN(4);
*(.ARM.extab* .gnu.linkonce.armextab.*)
. = ALIGN(4);
} >FLASH
.ARM : {
. = ALIGN(4);
__exidx_start = .;
*(.ARM.exidx*)
__exidx_end = .;
. = ALIGN(4);
} >FLASH

.preinit_array :
{
. = ALIGN(4);
PROVIDE_HIDDEN (__preinit_array_start = .);
KEEP (*(.preinit_array*))
PROVIDE_HIDDEN (__preinit_array_end = .);
. = ALIGN(4);
} >FLASH
.init_array :
{
. = ALIGN(4);
PROVIDE_HIDDEN (__init_array_start = .);
KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array*))
PROVIDE_HIDDEN (__init_array_end = .);
. = ALIGN(4);
} >FLASH
.fini_array :
{
. = ALIGN(4);
PROVIDE_HIDDEN (__fini_array_start = .);
KEEP (*(SORT(.fini_array.*)))
KEEP (*(.fini_array*))
PROVIDE_HIDDEN (__fini_array_end = .);
. = ALIGN(4);
} >FLASH

/* Used by the startup to initialize data */
_sidata = LOADADDR(.data);

/* Initialized data sections into "RAM" Ram type memory */
.data :
{
. = ALIGN(4);
_sdata = .; /* create a global symbol at data start */
*(.data) /* .data sections */
*(.data*) /* .data* sections */

. = ALIGN(4);
_edata = .; /* define a global symbol at data end */
} >RAM AT> FLASH


/* Uninitialized data section into "RAM" Ram type memory */
. = ALIGN(4);
.bss :
{
/* This is used by the startup in order to initialize the .bss secion */
_sbss = .; /* define a global symbol at bss start */
__bss_start__ = _sbss;
*(.bss)
*(.bss*)
*(COMMON)

. = ALIGN(4);
_ebss = .; /* define a global symbol at bss end */
__bss_end__ = _ebss;
} >RAM

/* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */
._user_heap_stack :
{
. = ALIGN(8);
PROVIDE ( end = . );
PROVIDE ( _end = . );
. = . + _Min_Heap_Size;
. = . + _Min_Stack_Size;
. = ALIGN(8);
} >RAM



/* Remove information from the compiler libraries */
/DISCARD/ :
{
libc.a ( * )
libm.a ( * )
libgcc.a ( * )
}

.ARM.attributes 0 : { *(.ARM.attributes) }
}

Loading

0 comments on commit 6a32fad

Please sign in to comment.