diff --git a/boards.txt b/boards.txt
index 7f53d60d45..06ad85b011 100644
--- a/boards.txt
+++ b/boards.txt
@@ -564,6 +564,9 @@ GenF4.build.vid=0x0483
GenF4.build.core=arduino
GenF4.build.board=GenF4
GenF4.build.extra_flags=-D{build.product_line} {build.enable_usb} {build.xSerial}
+GenF4.build.mcu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard
+GenF4.build.series=STM32F4xx
+GenF4.build.cmsis_lib_gcc=arm_cortexM4l_math
# Black F407VE
# Support: Serial1 (USART1 on PA10, PA9)
@@ -571,31 +574,39 @@ GenF4.build.extra_flags=-D{build.product_line} {build.enable_usb} {build.xSerial
GenF4.menu.pnum.BLACK_F407VE=Black F407VE
GenF4.menu.pnum.BLACK_F407VE.upload.maximum_size=524288
GenF4.menu.pnum.BLACK_F407VE.upload.maximum_data_size=131072
-GenF4.menu.pnum.BLACK_F407VE.build.mcu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard
GenF4.menu.pnum.BLACK_F407VE.build.board=BLACK_F407VE
-GenF4.menu.pnum.BLACK_F407VE.build.series=STM32F4xx
GenF4.menu.pnum.BLACK_F407VE.build.product_line=STM32F407xx
-GenF4.menu.pnum.BLACK_F407VE.build.variant=BLACK_F407VE
-GenF4.menu.pnum.BLACK_F407VE.build.cmsis_lib_gcc=arm_cortexM4l_math
+GenF4.menu.pnum.BLACK_F407VE.build.variant=BLACK_F407XX
-# Black F407Z(E-G)
+# Black F407VG
# Support: Serial1 (USART1 on PA10, PA9)
# Default SPI: SPI (SPI1 on PB3,PB4,PB5 - NRF24 connector and W25Q16 (on board flash))
-GenF4.menu.pnum.BLACK_F407ZE=Black F407Z(E-G)
+GenF4.menu.pnum.BLACK_F407VG=Black F407VG
+GenF4.menu.pnum.BLACK_F407VG.upload.maximum_size=1048576
+GenF4.menu.pnum.BLACK_F407VG.upload.maximum_data_size=131072
+GenF4.menu.pnum.BLACK_F407VG.build.board=BLACK_F407VG
+GenF4.menu.pnum.BLACK_F407VG.build.product_line=STM32F407xx
+GenF4.menu.pnum.BLACK_F407VG.build.variant=BLACK_F407XX
+
+# Black F407ZE
+# Support: Serial1 (USART1 on PA10, PA9)
+# Default SPI: SPI (SPI1 on PB3,PB4,PB5 - NRF24 connector and W25Q16 (on board flash))
+GenF4.menu.pnum.BLACK_F407ZE=Black F407ZE
+GenF4.menu.pnum.BLACK_F407ZE.upload.maximum_size=524288
GenF4.menu.pnum.BLACK_F407ZE.upload.maximum_data_size=131072
-GenF4.menu.pnum.BLACK_F407ZE.build.mcu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard
-GenF4.menu.pnum.BLACK_F407ZE.build.board=BLACK_F407ZE_G
-GenF4.menu.pnum.BLACK_F407ZE.build.series=STM32F4xx
+GenF4.menu.pnum.BLACK_F407ZE.build.board=BLACK_F407ZE
GenF4.menu.pnum.BLACK_F407ZE.build.product_line=STM32F407xx
-GenF4.menu.pnum.BLACK_F407ZE.build.variant=BLACK_F407VE
-GenF4.menu.pnum.BLACK_F407ZE.build.cmsis_lib_gcc=arm_cortexM4l_math
+GenF4.menu.pnum.BLACK_F407ZE.build.variant=BLACK_F407XX
-GenF4.menu.flash.ZE=ZE 512k (default)
-GenF4.menu.flash.ZE.upload.maximum_size=524288
-GenF4.menu.flash.ZE.build.ldscript=ldscript.ld
-GenF4.menu.flash.ZG=ZG 1024k
-GenF4.menu.flash.ZG.upload.maximum_size=1048576
-GenF4.menu.flash.ZG.build.ldscript=ldscript_zg.ld
+# Black F407ZG
+# Support: Serial1 (USART1 on PA10, PA9)
+# Default SPI: SPI (SPI1 on PB3,PB4,PB5 - NRF24 connector and W25Q16 (on board flash))
+GenF4.menu.pnum.BLACK_F407ZG=Black F407ZG
+GenF4.menu.pnum.BLACK_F407ZG.upload.maximum_size=1048576
+GenF4.menu.pnum.BLACK_F407ZG.upload.maximum_data_size=131072
+GenF4.menu.pnum.BLACK_F407ZG.build.board=BLACK_F407ZG
+GenF4.menu.pnum.BLACK_F407ZG.build.product_line=STM32F407xx
+GenF4.menu.pnum.BLACK_F407ZG.build.variant=BLACK_F407XX
# Blue F407VE mini: http://wiki.stm32duino.com/index.php?title=Vcc-gnd.com_STM32F407VET6_Mini
# Support: Serial1 (USART1 on PA10, PA9)
@@ -603,12 +614,9 @@ GenF4.menu.flash.ZG.build.ldscript=ldscript_zg.ld
GenF4.menu.pnum.BLUE_F407VE_Mini=Blue F407VE mini
GenF4.menu.pnum.BLUE_F407VE_Mini.upload.maximum_size=524288
GenF4.menu.pnum.BLUE_F407VE_Mini.upload.maximum_data_size=131072
-GenF4.menu.pnum.BLUE_F407VE_Mini.build.mcu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard
GenF4.menu.pnum.BLUE_F407VE_Mini.build.board=BLUE_F407VE_Mini
-GenF4.menu.pnum.BLUE_F407VE_Mini.build.series=STM32F4xx
GenF4.menu.pnum.BLUE_F407VE_Mini.build.product_line=STM32F407xx
GenF4.menu.pnum.BLUE_F407VE_Mini.build.variant=BLUE_F407VE_Mini
-GenF4.menu.pnum.BLUE_F407VE_Mini.build.cmsis_lib_gcc=arm_cortexM4l_math
# DIYMROE STM32F407VGT board
# Support: Serial1 (USART1 on PA10, PA9)
@@ -616,12 +624,9 @@ GenF4.menu.pnum.BLUE_F407VE_Mini.build.cmsis_lib_gcc=arm_cortexM4l_math
GenF4.menu.pnum.DIYMROE_F407VGT=DIYMROE STM32F407VGT
GenF4.menu.pnum.DIYMROE_F407VGT.upload.maximum_size=1048576
GenF4.menu.pnum.DIYMROE_F407VGT.upload.maximum_data_size=131072
-GenF4.menu.pnum.DIYMROE_F407VGT.build.mcu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard
GenF4.menu.pnum.DIYMROE_F407VGT.build.board=DIYMROE_F407VGT
-GenF4.menu.pnum.DIYMROE_F407VGT.build.series=STM32F4xx
GenF4.menu.pnum.DIYMROE_F407VGT.build.product_line=STM32F407xx
GenF4.menu.pnum.DIYMROE_F407VGT.build.variant=DIYMROE_F407VGT
-GenF4.menu.pnum.DIYMROE_F407VGT.build.cmsis_lib_gcc=arm_cortexM4l_math
# Upload menu
GenF4.menu.upload_method.STLink=STLink
diff --git a/variants/BLACK_F407VE/ldscript_zg.ld b/variants/BLACK_F407VE/ldscript_zg.ld
deleted file mode 100644
index 1937e4f628..0000000000
--- a/variants/BLACK_F407VE/ldscript_zg.ld
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
-*****************************************************************************
-**
-
-** File : LinkerScript.ld
-**
-** Abstract : Linker script for STM32F407ZG Device with
-** 1024KByte FLASH, 128KByte 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
-**
-**
© COPYRIGHT(c) 2014 Ac6
-**
-** 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 Ac6 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 = 0x20020000; /* end of RAM */
-/* Generate a link error if heap and stack don't fit into RAM */
-_Min_Heap_Size = 0x200; /* required amount of heap */
-_Min_Stack_Size = 0x400; /* required amount of stack */
-
-/* Specify the memory areas */
-MEMORY
-{
-RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
-CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K
-FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K
-}
-
-/* Define output sections */
-SECTIONS
-{
- /* The startup code goes first into FLASH */
- .isr_vector :
- {
- . = ALIGN(4);
- KEEP(*(.isr_vector)) /* Startup code */
- . = ALIGN(4);
- } >FLASH
-
- /* The program code and other data goes into FLASH */
- .text ALIGN(4):
- {
- . = 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 goes into FLASH */
- .rodata ALIGN(4):
- {
- . = ALIGN(4);
- *(.rodata) /* .rodata sections (constants, strings, etc.) */
- *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
- . = ALIGN(4);
- } >FLASH
-
- .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
- .ARM : {
- __exidx_start = .;
- *(.ARM.exidx*)
- __exidx_end = .;
- } >FLASH
-
- .preinit_array :
- {
- PROVIDE_HIDDEN (__preinit_array_start = .);
- KEEP (*(.preinit_array*))
- PROVIDE_HIDDEN (__preinit_array_end = .);
- } >FLASH
- .init_array :
- {
- PROVIDE_HIDDEN (__init_array_start = .);
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array*))
- PROVIDE_HIDDEN (__init_array_end = .);
- } >FLASH
- .fini_array :
- {
- PROVIDE_HIDDEN (__fini_array_start = .);
- KEEP (*(SORT(.fini_array.*)))
- KEEP (*(.fini_array*))
- PROVIDE_HIDDEN (__fini_array_end = .);
- } >FLASH
-
- /* used by the startup to initialize data */
- _sidata = LOADADDR(.data);
-
- /* Initialized data sections goes into RAM, load LMA copy after code */
- .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
-
- _siccmram = LOADADDR(.ccmram);
-
- /* CCM-RAM section
- *
- * IMPORTANT NOTE!
- * If initialized variables will be placed in this section,
- * the startup code needs to be modified to copy the init-values.
- */
- .ccmram :
- {
- . = ALIGN(4);
- _sccmram = .; /* create a global symbol at ccmram start */
- *(.ccmram)
- *(.ccmram*)
-
- . = ALIGN(4);
- _eccmram = .; /* create a global symbol at ccmram end */
- } >CCMRAM AT> FLASH
-
-
- /* Uninitialized data section */
- . = 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 left */
- ._user_heap_stack :
- {
- . = ALIGN(4);
- PROVIDE ( end = . );
- PROVIDE ( _end = . );
- . = . + _Min_Heap_Size;
- . = . + _Min_Stack_Size;
- . = ALIGN(4);
- } >RAM
-
-
-
- /* Remove information from the standard libraries */
- /DISCARD/ :
- {
- libc.a ( * )
- libm.a ( * )
- libgcc.a ( * )
- }
-
- .ARM.attributes 0 : { *(.ARM.attributes) }
-}
-
-
diff --git a/variants/BLACK_F407VE/PeripheralPins.c b/variants/BLACK_F407XX/PeripheralPins.c
similarity index 97%
rename from variants/BLACK_F407VE/PeripheralPins.c
rename to variants/BLACK_F407XX/PeripheralPins.c
index 8bc74f4d74..cc7b866b8c 100644
--- a/variants/BLACK_F407VE/PeripheralPins.c
+++ b/variants/BLACK_F407XX/PeripheralPins.c
@@ -57,7 +57,7 @@ const PinMap PinMap_ADC[] = {
// {PA_4, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC2_IN4
// {PA_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC1_IN5
{PA_5, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC2_IN5
-#ifdef ARDUINO_BLACK_F407ZE_G
+#if defined(ARDUINO_BLACK_F407ZE) || defined(ARDUINO_BLACK_F407ZG)
{PA_6, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC1_IN6
// {PA_6, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC2_IN6
{PA_7, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC1_IN7
@@ -83,7 +83,7 @@ const PinMap PinMap_ADC[] = {
{PC_4, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC2_IN14
// {PC_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC1_IN15
{PC_5, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC2_IN15
-#ifdef ARDUINO_BLACK_F407ZE_G
+#if defined(ARDUINO_BLACK_F407ZE) || defined(ARDUINO_BLACK_F407ZG)
// {PF_3, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC3_IN9
// {PF_4, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC3_IN14
// {PF_5, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC3_IN15
@@ -115,7 +115,7 @@ const PinMap PinMap_I2C_SDA[] = {
{PB_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
{PB_11, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},
{PC_9, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)},
-#ifdef ARDUINO_BLACK_F407ZE_G
+#if defined(ARDUINO_BLACK_F407ZE) || defined(ARDUINO_BLACK_F407ZG)
{PF_0, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},
#endif
{NC, NP, 0}
@@ -128,7 +128,7 @@ const PinMap PinMap_I2C_SCL[] = {
{PB_6, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
{PB_8, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
{PB_10, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},
-#ifdef ARDUINO_BLACK_F407ZE_G
+#if defined(ARDUINO_BLACK_F407ZE) || defined(ARDUINO_BLACK_F407ZG)
{PF_1, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},
#endif
{NC, NP, 0}
@@ -207,7 +207,7 @@ const PinMap PinMap_PWM[] = {
{PE_12, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N
{PE_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3
{PE_14, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 4, 0)}, // TIM1_CH4
-#ifdef ARDUINO_BLACK_F407ZE_G
+#if defined(ARDUINO_BLACK_F407ZE) || defined(ARDUINO_BLACK_F407ZG)
{PF_6, TIM10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1
{PF_7, TIM11, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1
{PF_8, TIM13, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM13, 1, 0)}, // TIM13_CH1
@@ -232,7 +232,7 @@ const PinMap PinMap_UART_TX[] = {
{PC_12, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)},
{PD_5, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
{PD_8, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
-#ifdef ARDUINO_BLACK_F407ZE_G
+#if defined(ARDUINO_BLACK_F407ZE) || defined(ARDUINO_BLACK_F407ZG)
// {PG_14, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)},
#endif
{NC, NP, 0}
@@ -252,7 +252,7 @@ const PinMap PinMap_UART_RX[] = {
{PD_2, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)},
{PD_6, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
{PD_9, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
-#ifdef ARDUINO_BLACK_F407ZE_G
+#if defined(ARDUINO_BLACK_F407ZE) || defined(ARDUINO_BLACK_F407ZG)
// {PG_9, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)},
#endif
{NC, NP, 0}
@@ -266,7 +266,7 @@ const PinMap PinMap_UART_RTS[] = {
{PB_14, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
{PD_4, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
{PD_12, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
-#ifdef ARDUINO_BLACK_F407ZE_G
+#if defined(ARDUINO_BLACK_F407ZE) || defined(ARDUINO_BLACK_F407ZG)
{PG_8, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)},
{PG_12, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)},
#endif
@@ -281,7 +281,7 @@ const PinMap PinMap_UART_CTS[] = {
{PB_13, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
{PD_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
{PD_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
-#ifdef ARDUINO_BLACK_F407ZE_G
+#if defined(ARDUINO_BLACK_F407ZE) || defined(ARDUINO_BLACK_F407ZG)
{PG_13, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)},
{PG_15, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)},
#endif
@@ -386,7 +386,7 @@ const PinMap PinMap_Ethernet[] = {
{PC_4, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RXD0
{PC_5, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RXD1
{PE_2, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD3
-#ifdef ARDUINO_BLACK_F407ZE_G
+#if defined(ARDUINO_BLACK_F407ZE) || defined(ARDUINO_BLACK_F407ZG)
{PG_8, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_PPS_OUT
{PG_11, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TX_EN
{PG_13, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD0
diff --git a/variants/BLACK_F407VE/PinNamesVar.h b/variants/BLACK_F407XX/PinNamesVar.h
similarity index 100%
rename from variants/BLACK_F407VE/PinNamesVar.h
rename to variants/BLACK_F407XX/PinNamesVar.h
diff --git a/variants/BLACK_F407VE/ldscript.ld b/variants/BLACK_F407XX/ldscript.ld
similarity index 96%
rename from variants/BLACK_F407VE/ldscript.ld
rename to variants/BLACK_F407XX/ldscript.ld
index 95367243d7..0d75135824 100644
--- a/variants/BLACK_F407VE/ldscript.ld
+++ b/variants/BLACK_F407XX/ldscript.ld
@@ -2,10 +2,10 @@
*****************************************************************************
**
-** File : LinkerScript.ld
+** File : lscript.ld
**
-** Abstract : Linker script for STM32F407VETx Device with
-** 512KByte FLASH, 128KByte RAM
+** Abstract : Linker script for STM32F407(VZ)(EG)Tx Device with
+** 512/1024KByte FLASH, 128KByte RAM
**
** Set heap size, stack size and stack location according
** to application requirements.
@@ -62,7 +62,7 @@ MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K
-FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 512K
+FLASH (rx) : ORIGIN = 0x8000000, LENGTH = LD_MAX_SIZE
}
/* Define output sections */
diff --git a/variants/BLACK_F407VE/stm32f4xx_hal_conf.h b/variants/BLACK_F407XX/stm32f4xx_hal_conf.h
similarity index 100%
rename from variants/BLACK_F407VE/stm32f4xx_hal_conf.h
rename to variants/BLACK_F407XX/stm32f4xx_hal_conf.h
diff --git a/variants/BLACK_F407VE/variant.cpp b/variants/BLACK_F407XX/variant.cpp
similarity index 84%
rename from variants/BLACK_F407VE/variant.cpp
rename to variants/BLACK_F407XX/variant.cpp
index ae6ef1f2b6..ae02297374 100644
--- a/variants/BLACK_F407VE/variant.cpp
+++ b/variants/BLACK_F407XX/variant.cpp
@@ -34,37 +34,11 @@
extern "C" {
#endif
-#ifdef ARDUINO_BLACK_F407VE
+#if defined(ARDUINO_BLACK_F407VE) || defined(ARDUINO_BLACK_F407VG)
// Pin number
// This array allows to wrap Arduino pin number(Dx or x)
// to STM32 PinName (PX_n)
const PinName digitalPin[] = {
- // Left Side
- //Ext //Int
- //5V //5V
- //5V //5V
- //3V3 //3V3
- //3V3 //3V3
- //GND //GND
- PE_2, PE_3, // D0, D1
- PE_4, PE_5, // PE_4: BUT K0, PE_5: BUT K1
- PE_6, PC_13,
- PC_0, PC_1,
- PC_2, PC_3,
- //VREF- //VREF+
- PA_0, PA_1, // D10, D11 PA_0(WK_UP): BUT K_UP)
- PA_2, PA_3,
- PA_4, PA_5,
- PA_6, PA_7, // PA_6: LED D2, PA_7: LED D3 (active LOW)
- PC_4, PC_5,
- PB_0, PB_1, // D20, D21
- PE_7, PE_8,
- PE_9, PE_10,
- PE_11, PE_12,
- PE_13, PE_14,
- PE_15, PB_10, // D30, D31
- PB_11, PB_12,
- PB_13, PB_14,
// Right Side
//Int //Ext
//3V3 //3V3
@@ -72,45 +46,57 @@ const PinName digitalPin[] = {
//BOOT0 //BOOT1
//GND //GND
//GND //GND
- PE_1, PE_0,
+ PE_1, PE_0, // D0, D1
PB_9, PB_8,
- PB_7, PB_6, // D40, D41
+ PB_7, PB_6,
PB_5, PB_3,
PD_7, PD_6,
- PD_5, PD_4,
+ PD_5, PD_4, // D10, D11
PD_3, PD_2,
- PD_1, PD_0, // D50, D51
+ PD_1, PD_0,
PC_12, PC_11,
PC_10, PA_15,
- PA_12, PA_11, // PA_11: USB_DM, PA_12: USB_DP
+ PA_12, PA_11, // D20, D21 PA_11: USB_DM, PA_12: USB_DP
PA_10, PA_9,
- PA_8, PC_9, // D60, D61
+ PA_8, PC_9,
PC_8, PC_7,
PC_6, PD_15,
- PD_14, PD_13,
+ PD_14, PD_13, // D30, D31
PD_12, PD_11,
- PD_10, PD_9, // D70, D71
+ PD_10, PD_9,
PD_8, PB_15,
+ // Left Side
+ //Ext //Int
+ //5V //5V
+ //5V //5V
+ //3V3 //3V3
+ //3V3 //3V3
+ //GND //GND
+ PE_2, PE_3,
+ PE_4, PE_5, // D40, D41 PE_4: BUT K0, PE_5: BUT K1
+ PE_6, PC_13,
+ PC_0, PC_1,
+ PC_2, PC_3,
+ //VREF- //VREF+
+ PA_0, PA_1, // PA_0(WK_UP): BUT K_UP)
+ PA_2, PA_3, // D50, D51
+ PA_4, PA_5,
+/*PA_6, PA_7,*/ // PA_6, PA_7: Moved to allow contiguous analog pins
+ PC_4, PC_5,
+ PB_0, PB_1,
+ PA_6, PA_7, // PA_6: LED D2, PA_7: LED D3 (active LOW)
+ PE_7, PE_8, // D60, D61
+ PE_9, PE_10,
+ PE_11, PE_12,
+ PE_13, PE_14,
+ PE_15, PB_10,
+ PB_11, PB_12, // D70, D71
+ PB_13, PB_14,
PB_4,
- // Analog pins
- PA_0, // D75
- PA_1,
- PA_2,
- PA_3,
- PA_4,
- PA_5, // D80
- PB_0,
- PB_1,
- PC_0,
- PC_1,
- PC_2,
- PC_3,
- PC_4,
- PC_5
};
-#endif // ARDUINO_BLACK_F407VE
+#endif // ARDUINO_BLACK_F407VE || ARDUINO_BLACK_F407VG
-#ifdef ARDUINO_BLACK_F407ZE_G
+#if defined(ARDUINO_BLACK_F407ZE) || defined(ARDUINO_BLACK_F407ZG)
const PinName digitalPin[] = {
// Left Side
//Ext //Int
@@ -160,7 +146,8 @@ const PinName digitalPin[] = {
PF_15, PG_0,
PF_13, PF_14,
PF_11, PF_12,
- PB_1, PB_2,
+ PB_2, // PB1 PB2 Inverted to allow contiguous analog pins
+ PB_1,
PC_5, PB_0,
PA_7, PC_4,
PA_5, PA_6,
@@ -168,9 +155,10 @@ const PinName digitalPin[] = {
PA_1, PA_2,
PC_3, PA_0, // PA_0(WK_UP): BUT K_UP)
PC_1, PC_2,
- PF_10, PC_0, // PF_10: LED D2 (active low)
- PF_8, PF_9, // PF_9: LED D1 (active low)
+/*PF_10,*/PC_0, // PF_10: Moved to allow contiguous analog pins
+ PF_8, /*PF_9,*/ // PF_9: Moved to allow contiguous analog pins
PF_6, PF_7,
+ PF_10, PF_9, // PF_10: LED D2, PF_9: LED D1 (active low)
PF_4, PF_5,
PF_2, PF_3,
PF_0, PF_1,
@@ -178,29 +166,8 @@ const PinName digitalPin[] = {
PE_4, PE_5, // PE_4: BUT K0, PE_5: BUT K1
PE_2, PE_3,
PE_0, PE_1,
-
- // Analog pins
- PA_0,
- PA_1,
- PA_2,
- PA_3,
- PA_4,
- PA_5,
- PA_6,
- PA_7,
- PB_0,
- PB_1,
- PC_0,
- PC_1,
- PC_2,
- PC_3,
- PC_4,
- PC_5,
- PF_6,
- PF_7,
- PF_8
};
-#endif // ARDUINO_BLACK_F407ZE_G
+#endif // ARDUINO_BLACK_F407ZE || ARDUINO_BLACK_F407ZG
#ifdef __cplusplus
}
diff --git a/variants/BLACK_F407VE/variant.h b/variants/BLACK_F407XX/variant.h
similarity index 77%
rename from variants/BLACK_F407VE/variant.h
rename to variants/BLACK_F407XX/variant.h
index e6b51c6b6f..f2caa127f3 100644
--- a/variants/BLACK_F407VE/variant.h
+++ b/variants/BLACK_F407XX/variant.h
@@ -44,91 +44,90 @@ extern "C"{
* Pins
*----------------------------------------------------------------------------*/
extern const PinName digitalPin[];
-// Left Side
-#ifdef ARDUINO_BLACK_F407VE
-
-#define PE2 0
-#define PE3 1
-#define PE4 2 // BUT K0
-#define PE5 3 // BUT K1
-#define PE6 4
-#define PC13 5
-#define PC0 6 // A8
-#define PC1 7 // A9
-#define PC2 8 // A10
-#define PC3 9 // A11
-#define PA0 10 // A0/WK_UP: BUT K_UP
-#define PA1 11 // A1
-#define PA2 12 // A2
-#define PA3 13 // A3
-#define PA4 14 // A4
-#define PA5 15 // A5
-#define PA6 16 // LED D2
-#define PA7 17 // LED D3 (active LOW)
-#define PC4 18 // A12
-#define PC5 19 // A13
-#define PB0 20 // A6
-#define PB1 21 // A7
-#define PE7 22
-#define PE8 23
-#define PE9 24
-#define PE10 25
-#define PE11 26
-#define PE12 27
-#define PE13 28
-#define PE14 29
-#define PE15 30
-#define PB10 31
-#define PB11 32
-#define PB12 33
-#define PB13 34
-#define PB14 35
+#if defined(ARDUINO_BLACK_F407VE) || defined(ARDUINO_BLACK_F407VG)
// Right Side
-#define PE1 36
-#define PE0 37
-#define PB9 38
-#define PB8 39
-#define PB7 40
-#define PB6 41
-#define PB5 42
-#define PB3 43
-#define PD7 44
-#define PD6 45
-#define PD5 46
-#define PD4 47
-#define PD3 48
-#define PD2 49
-#define PD1 50
-#define PD0 51
-#define PC12 52
-#define PC11 53
-#define PC10 54
-#define PA15 55
-#define PA12 56 // USB_DP
-#define PA11 57 // USB_DM
-#define PA10 58
-#define PA9 59
-#define PA8 60
-#define PC9 61
-#define PC8 62
-#define PC7 63
-#define PC6 64
-#define PD15 65
-#define PD14 66
-#define PD13 67
-#define PD12 68
-#define PD11 69
-#define PD10 70
-#define PD9 71
-#define PD8 72
-#define PB15 73
+#define PE1 0
+#define PE0 1
+#define PB9 2
+#define PB8 3
+#define PB7 4
+#define PB6 5
+#define PB5 6
+#define PB3 7
+#define PD7 8
+#define PD6 9
+#define PD5 10
+#define PD4 11
+#define PD3 12
+#define PD2 13
+#define PD1 14
+#define PD0 15
+#define PC12 16
+#define PC11 17
+#define PC10 18
+#define PA15 19
+#define PA12 20 // USB_DP
+#define PA11 21 // USB_DM
+#define PA10 22
+#define PA9 23
+#define PA8 24
+#define PC9 25
+#define PC8 26
+#define PC7 27
+#define PC6 28
+#define PD15 29
+#define PD14 30
+#define PD13 31
+#define PD12 32
+#define PD11 33
+#define PD10 34
+#define PD9 35
+#define PD8 36
+#define PB15 37
+// Left Side
+#define PE2 38
+#define PE3 39
+#define PE4 40 // BUT K0
+#define PE5 41 // BUT K1
+#define PE6 42
+#define PC13 43
+#define PC0 44 // A0
+#define PC1 45 // A1
+#define PC2 46 // A2
+#define PC3 47 // A3
+#define PA0 48 // A4/WK_UP: BUT K_UP
+#define PA1 49 // A5
+#define PA2 50 // A6
+#define PA3 51 // A7
+#define PA4 52 // A8
+#define PA5 53 // A9
+#define PC4 54 // A10
+#define PC5 55 // A11
+#define PB0 56 // A12
+#define PB1 57 // A13
+#define PA6 58 // LED D2
+#define PA7 59 // LED D3 (active LOW)
+#define PE7 60
+#define PE8 61
+#define PE9 62
+#define PE10 63
+#define PE11 64
+#define PE12 65
+#define PE13 66
+#define PE14 67
+#define PE15 68
+#define PB10 69
+#define PB11 70
+#define PB12 71
+#define PB13 72
+#define PB14 73
#define PB4 74
// This must be a literal
-#define NUM_DIGITAL_PINS 89
+#define NUM_DIGITAL_PINS 75
// This must be a literal with a value less than or equal to MAX_ANALOG_INPUTS
#define NUM_ANALOG_INPUTS 14
-#define NUM_ANALOG_FIRST 75
+#define NUM_ANALOG_FIRST 44
// Below ADC, DAC and PWM definitions already done in the core
// Could be redefined here if needed
@@ -148,9 +147,9 @@ extern const PinName digitalPin[];
// Board specific button
#define BTN_K_UP PA0
-#endif // ARDUINO_BLACK_F407VE
+#endif // ARDUINO_BLACK_F407VE || ARDUINO_BLACK_F407VG
-#ifdef ARDUINO_BLACK_F407ZE_G
+#if defined(ARDUINO_BLACK_F407ZE) || defined(ARDUINO_BLACK_F407ZG)
// Left Side
#define PB12 0
#define PB13 1
@@ -228,28 +227,28 @@ extern const PinName digitalPin[];
#define PF14 71
#define PF11 72
#define PF12 73
-#define PB1 74
-#define PB2 75
-#define PC5 76
-#define PB0 77
-#define PA7 78
-#define PC4 79
-#define PA5 80
-#define PA6 81
-#define PA3 82
-#define PA4 83
-#define PA1 84
-#define PA2 85
-#define PC3 86
-#define PA0 87 // PA_0(WK_UP): BUT K_UP)
-#define PC1 88
-#define PC2 89
-#define PF10 90 // LED D2 (active low)
-#define PC0 91
-#define PF8 92
-#define PF9 93 // LED D1 (active low)
-#define PF6 94
-#define PF7 95
+#define PB2 74
+#define PB1 75 // A0
+#define PC5 76 // A1
+#define PB0 77 // A2
+#define PA7 78 // A3
+#define PC4 79 // A4
+#define PA5 80 // A5
+#define PA6 81 // A6
+#define PA3 82 // A7
+#define PA4 83 // A8
+#define PA1 84 // A9
+#define PA2 85 // A10
+#define PC3 86 // A11
+#define PA0 87 // A12/PA_0(WK_UP): BUT K_UP)
+#define PC1 88 // A13
+#define PC2 89 // A14
+#define PC0 90 // A15
+#define PF8 91 // A16
+#define PF6 92 // A17
+#define PF7 93 // A18
+#define PF9 94 // LED D1 (active low)
+#define PF10 95 // LED D2 (active low)
#define PF4 96
#define PF5 97
#define PF2 98
@@ -266,10 +265,10 @@ extern const PinName digitalPin[];
#define PE1 109
// This must be a literal
-#define NUM_DIGITAL_PINS 129
+#define NUM_DIGITAL_PINS 110
// This must be a literal with a value less than or equal to MAX_ANALOG_INPUTS
#define NUM_ANALOG_INPUTS 19
-#define NUM_ANALOG_FIRST 110
+#define NUM_ANALOG_FIRST 75
// On-board LED pin number
#define LED_D2 PF10
@@ -278,7 +277,7 @@ extern const PinName digitalPin[];
// Board specific button
#define BTN_WK_UP PA0
-#endif // ARDUINO_BLACK_F407ZE_G
+#endif // ARDUINO_BLACK_F407ZE || ARDUINO_BLACK_F407ZG
#define LED_BUILTIN LED_D2
#define LED_GREEN LED_D2