From 7c617d4d9410cd3567ffde1199816e85413dc5d6 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 30 Nov 2024 20:35:03 -0600 Subject: [PATCH 1/4] Platform updates Co-Authored-By: Martin Turski --- Marlin/src/HAL/STM32/MarlinSPI.cpp | 2 +- Marlin/src/HAL/STM32/MarlinSPI.h | 12 +- Marlin/src/HAL/STM32/pinsDebug.h | 47 ++++- .../STM32/platdefs/MARLIN_ARTILLERY_RUBY.h | 27 +++ .../STM32/platdefs/MARLIN_BIGTREE_BTT002.h | 27 +++ .../STM32/platdefs/MARLIN_BIGTREE_E3_RRF.h | 27 +++ .../STM32/platdefs/MARLIN_BIGTREE_GTR_V1.h | 27 +++ .../MARLIN_BIGTREE_OCTOPUS_PRO_V1_F429.h | 27 +++ .../platdefs/MARLIN_BIGTREE_OCTOPUS_V1.h | 27 +++ .../platdefs/MARLIN_BIGTREE_SKR_PRO_11.h | 27 +++ .../HAL/STM32/platdefs/MARLIN_BTT_SKR_SE_BX.h | 27 +++ Marlin/src/HAL/STM32/platdefs/MARLIN_F103Rx.h | 22 +++ .../HAL/STM32/platdefs/MARLIN_F103VE_LONGER.h | 22 +++ Marlin/src/HAL/STM32/platdefs/MARLIN_F103Vx.h | 22 +++ Marlin/src/HAL/STM32/platdefs/MARLIN_F103Zx.h | 22 +++ Marlin/src/HAL/STM32/platdefs/MARLIN_F401RC.h | 27 +++ .../STM32/platdefs/MARLIN_F401RC_CREALITY.h | 22 +++ Marlin/src/HAL/STM32/platdefs/MARLIN_F407VE.h | 40 ++++ Marlin/src/HAL/STM32/platdefs/MARLIN_F407ZE.h | 27 +++ Marlin/src/HAL/STM32/platdefs/MARLIN_F446VE.h | 22 +++ .../HAL/STM32/platdefs/MARLIN_F446Zx_TRONXY.h | 27 +++ Marlin/src/HAL/STM32/platdefs/MARLIN_F4x7Vx.h | 22 +++ .../HAL/STM32/platdefs/MARLIN_FLY_F407ZG.h | 27 +++ .../src/HAL/STM32/platdefs/MARLIN_FYSETC_S6.h | 27 +++ .../platdefs/MARLIN_FYSETC_SPIDER_KING407.h | 27 +++ Marlin/src/HAL/STM32/platdefs/MARLIN_G0B1RE.h | 27 +++ Marlin/src/HAL/STM32/platdefs/MARLIN_LERDGE.h | 27 +++ .../STM32/platdefs/MARLIN_TH3D_EZBOARD_V2.h | 22 +++ Marlin/src/core/macros.h | 29 ++- buildroot/share/PlatformIO/boards/README.md | 9 + ....cpp => variant_MARLIN_ARTILLERY_RUBY.cpp} | 0 ...iant.h => variant_MARLIN_ARTILLERY_RUBY.h} | 0 ...iant.cpp => variant_MARLIN_BTT_BTT002.cpp} | 0 ...{variant.h => variant_MARLIN_BTT_BTT002.h} | 0 .../{variant.cpp => variant_generic.cpp} | 0 .../{variant.h => variant_generic.h} | 0 ...iant.cpp => variant_MARLIN_BTT_GTR_V1.cpp} | 0 ...{variant.h => variant_MARLIN_BTT_GTR_V1.h} | 0 ...ariant_MARLIN_BTT_OCTOPUS_PRO_V1_F429.cpp} | 0 ... variant_MARLIN_BTT_OCTOPUS_PRO_V1_F429.h} | 0 ....cpp => variant_MARLIN_BTT_OCTOPUS_V1.cpp} | 0 ...iant.h => variant_MARLIN_BTT_OCTOPUS_V1.h} | 0 ....cpp => variant_MARLIN_BTT_SKR_PRO_11.cpp} | 0 ...iant.h => variant_MARLIN_BTT_SKR_PRO_11.h} | 0 ...t.cpp => variant_MARLIN_BTT_SKR_SE_BX.cpp} | 0 ...riant.h => variant_MARLIN_BTT_SKR_SE_BX.h} | 0 .../{variant.cpp => variant_generic.cpp} | 0 .../{variant.h => variant_generic.h} | 0 ...t.cpp => variant_MARLIN_F103VE_LONGER.cpp} | 0 ...riant.h => variant_MARLIN_F103VE_LONGER.h} | 18 +- .../{variant.cpp => variant_generic.cpp} | 0 .../{variant.h => variant_generic.h} | 18 +- .../{variant.cpp => variant_generic.cpp} | 0 .../{variant.h => variant_generic.h} | 0 ...32F401RC.cpp => variant_MARLIN_F401RC.cpp} | 0 ..._STM32F401RC.h => variant_MARLIN_F401RC.h} | 0 .../{variant.cpp => variant_generic.cpp} | 0 .../{variant.h => variant_generic.h} | 0 ...cpp => variant_MARLIN_F401RE_CREALITY.cpp} | 0 ...ant.h => variant_MARLIN_F401RE_CREALITY.h} | 0 .../{variant.cpp => variant_generic.cpp} | 0 .../{variant.h => variant_generic.h} | 0 .../{variant.cpp => variant_generic.cpp} | 0 .../{variant.h => variant_generic.h} | 0 .../{variant.cpp => variant_generic.cpp} | 0 .../{variant.h => variant_generic.h} | 0 ...riant.cpp => variant_MARLIN_FYSETC_S6.cpp} | 20 ++ .../{variant.h => variant_MARLIN_FYSETC_S6.h} | 0 .../{variant.cpp => variant_generic.cpp} | 0 .../{variant.h => variant_generic.h} | 0 ...32G0B1RE.cpp => variant_MARLIN_G0B1RE.cpp} | 0 ..._STM32G0B1RE.h => variant_MARLIN_G0B1RE.h} | 0 ...32G0B1VE.cpp => variant_MARLIN_G0B1VE.cpp} | 0 ..._STM32G0B1VE.h => variant_MARLIN_G0B1VE.h} | 0 ...32H723VG.cpp => variant_MARLIN_H723VG.cpp} | 0 ..._STM32H723VG.h => variant_MARLIN_H723VG.h} | 0 ...32H723ZE.cpp => variant_MARLIN_H723ZE.cpp} | 0 ..._STM32H723ZE.h => variant_MARLIN_H723ZE.h} | 0 ...32H723ZG.cpp => variant_MARLIN_H723ZG.cpp} | 0 ..._STM32H723ZG.h => variant_MARLIN_H723ZG.h} | 0 ...32H743VI.cpp => variant_MARLIN_H743VI.cpp} | 0 ..._STM32H743VI.h => variant_MARLIN_H743VI.h} | 0 ...ariant.cpp => variant_MARLIN_I3DBEEZ9.cpp} | 0 .../{variant.h => variant_MARLIN_I3DBEEZ9.h} | 0 .../{variant.cpp => variant_generic.cpp} | 0 .../{variant.h => variant_generic.h} | 0 ...iant.cpp => variant_MARLIN_MKS_ROBIN2.cpp} | 0 ...{variant.h => variant_MARLIN_MKS_ROBIN2.h} | 0 ...nt.cpp => variant_MARLIN_MKS_SKIPR_V1.cpp} | 0 ...ariant.h => variant_MARLIN_MKS_SKIPR_V1.h} | 0 .../{variant.cpp => variant_generic.cpp} | 0 .../{variant.h => variant_generic.h} | 0 buildroot/share/PlatformIO/variants/README.md | 20 ++ ini/features.ini | 2 +- ini/stm32-common.ini | 18 ++ ini/stm32f0.ini | 12 +- ini/stm32f1-maple.ini | 1 + ini/stm32f1.ini | 139 +++++++------ ini/stm32f4.ini | 183 ++++++++++-------- ini/stm32f7.ini | 6 +- 100 files changed, 977 insertions(+), 207 deletions(-) create mode 100644 Marlin/src/HAL/STM32/platdefs/MARLIN_ARTILLERY_RUBY.h create mode 100644 Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_BTT002.h create mode 100644 Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_E3_RRF.h create mode 100644 Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_GTR_V1.h create mode 100644 Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_OCTOPUS_PRO_V1_F429.h create mode 100644 Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_OCTOPUS_V1.h create mode 100644 Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_SKR_PRO_11.h create mode 100644 Marlin/src/HAL/STM32/platdefs/MARLIN_BTT_SKR_SE_BX.h create mode 100644 Marlin/src/HAL/STM32/platdefs/MARLIN_F103Rx.h create mode 100644 Marlin/src/HAL/STM32/platdefs/MARLIN_F103VE_LONGER.h create mode 100644 Marlin/src/HAL/STM32/platdefs/MARLIN_F103Vx.h create mode 100644 Marlin/src/HAL/STM32/platdefs/MARLIN_F103Zx.h create mode 100644 Marlin/src/HAL/STM32/platdefs/MARLIN_F401RC.h create mode 100644 Marlin/src/HAL/STM32/platdefs/MARLIN_F401RC_CREALITY.h create mode 100644 Marlin/src/HAL/STM32/platdefs/MARLIN_F407VE.h create mode 100644 Marlin/src/HAL/STM32/platdefs/MARLIN_F407ZE.h create mode 100644 Marlin/src/HAL/STM32/platdefs/MARLIN_F446VE.h create mode 100644 Marlin/src/HAL/STM32/platdefs/MARLIN_F446Zx_TRONXY.h create mode 100644 Marlin/src/HAL/STM32/platdefs/MARLIN_F4x7Vx.h create mode 100644 Marlin/src/HAL/STM32/platdefs/MARLIN_FLY_F407ZG.h create mode 100644 Marlin/src/HAL/STM32/platdefs/MARLIN_FYSETC_S6.h create mode 100644 Marlin/src/HAL/STM32/platdefs/MARLIN_FYSETC_SPIDER_KING407.h create mode 100644 Marlin/src/HAL/STM32/platdefs/MARLIN_G0B1RE.h create mode 100644 Marlin/src/HAL/STM32/platdefs/MARLIN_LERDGE.h create mode 100644 Marlin/src/HAL/STM32/platdefs/MARLIN_TH3D_EZBOARD_V2.h create mode 100644 buildroot/share/PlatformIO/boards/README.md rename buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/{variant.cpp => variant_MARLIN_ARTILLERY_RUBY.cpp} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/{variant.h => variant_MARLIN_ARTILLERY_RUBY.h} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_BTT_BTT002/{variant.cpp => variant_MARLIN_BTT_BTT002.cpp} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_BTT_BTT002/{variant.h => variant_MARLIN_BTT_BTT002.h} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_BTT_E3_RRF/{variant.cpp => variant_generic.cpp} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_BTT_E3_RRF/{variant.h => variant_generic.h} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_BTT_GTR_V1/{variant.cpp => variant_MARLIN_BTT_GTR_V1.cpp} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_BTT_GTR_V1/{variant.h => variant_MARLIN_BTT_GTR_V1.h} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_PRO_V1_F429/{variant.cpp => variant_MARLIN_BTT_OCTOPUS_PRO_V1_F429.cpp} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_PRO_V1_F429/{variant.h => variant_MARLIN_BTT_OCTOPUS_PRO_V1_F429.h} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_V1/{variant.cpp => variant_MARLIN_BTT_OCTOPUS_V1.cpp} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_V1/{variant.h => variant_MARLIN_BTT_OCTOPUS_V1.h} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_PRO_11/{variant.cpp => variant_MARLIN_BTT_SKR_PRO_11.cpp} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_PRO_11/{variant.h => variant_MARLIN_BTT_SKR_PRO_11.h} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/{variant.cpp => variant_MARLIN_BTT_SKR_SE_BX.cpp} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/{variant.h => variant_MARLIN_BTT_SKR_SE_BX.h} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_F103Rx/{variant.cpp => variant_generic.cpp} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_F103Rx/{variant.h => variant_generic.h} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/{variant.cpp => variant_MARLIN_F103VE_LONGER.cpp} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/{variant.h => variant_MARLIN_F103VE_LONGER.h} (97%) rename buildroot/share/PlatformIO/variants/MARLIN_F103Vx/{variant.cpp => variant_generic.cpp} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_F103Vx/{variant.h => variant_generic.h} (95%) rename buildroot/share/PlatformIO/variants/MARLIN_F103Zx/{variant.cpp => variant_generic.cpp} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_F103Zx/{variant.h => variant_generic.h} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_F401RC/{variant_MARLIN_STM32F401RC.cpp => variant_MARLIN_F401RC.cpp} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_F401RC/{variant_MARLIN_STM32F401RC.h => variant_MARLIN_F401RC.h} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_F401RC_CREALITY/{variant.cpp => variant_generic.cpp} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_F401RC_CREALITY/{variant.h => variant_generic.h} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_F401RE_CREALITY/{variant.cpp => variant_MARLIN_F401RE_CREALITY.cpp} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_F401RE_CREALITY/{variant.h => variant_MARLIN_F401RE_CREALITY.h} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_F446VE/{variant.cpp => variant_generic.cpp} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_F446VE/{variant.h => variant_generic.h} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/{variant.cpp => variant_generic.cpp} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/{variant.h => variant_generic.h} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/{variant.cpp => variant_generic.cpp} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/{variant.h => variant_generic.h} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_FYSETC_S6/{variant.cpp => variant_MARLIN_FYSETC_S6.cpp} (93%) rename buildroot/share/PlatformIO/variants/MARLIN_FYSETC_S6/{variant.h => variant_MARLIN_FYSETC_S6.h} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_FYSETC_SPIDER_KING407/{variant.cpp => variant_generic.cpp} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_FYSETC_SPIDER_KING407/{variant.h => variant_generic.h} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/{variant_MARLIN_STM32G0B1RE.cpp => variant_MARLIN_G0B1RE.cpp} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/{variant_MARLIN_STM32G0B1RE.h => variant_MARLIN_G0B1RE.h} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_G0B1VE/{variant_MARLIN_STM32G0B1VE.cpp => variant_MARLIN_G0B1VE.cpp} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_G0B1VE/{variant_MARLIN_STM32G0B1VE.h => variant_MARLIN_G0B1VE.h} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_H723VG/{variant_MARLIN_STM32H723VG.cpp => variant_MARLIN_H723VG.cpp} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_H723VG/{variant_MARLIN_STM32H723VG.h => variant_MARLIN_H723VG.h} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_H723ZE/{variant_MARLIN_STM32H723ZE.cpp => variant_MARLIN_H723ZE.cpp} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_H723ZE/{variant_MARLIN_STM32H723ZE.h => variant_MARLIN_H723ZE.h} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_H723ZG/{variant_MARLIN_STM32H723ZG.cpp => variant_MARLIN_H723ZG.cpp} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_H723ZG/{variant_MARLIN_STM32H723ZG.h => variant_MARLIN_H723ZG.h} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_H743VI/{variant_MARLIN_STM32H743VI.cpp => variant_MARLIN_H743VI.cpp} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_H743VI/{variant_MARLIN_STM32H743VI.h => variant_MARLIN_H743VI.h} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_I3DBEEZ9/{variant.cpp => variant_MARLIN_I3DBEEZ9.cpp} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_I3DBEEZ9/{variant.h => variant_MARLIN_I3DBEEZ9.h} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_LERDGE/{variant.cpp => variant_generic.cpp} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_LERDGE/{variant.h => variant_generic.h} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_MKS_ROBIN2/{variant.cpp => variant_MARLIN_MKS_ROBIN2.cpp} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_MKS_ROBIN2/{variant.h => variant_MARLIN_MKS_ROBIN2.h} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/{variant.cpp => variant_MARLIN_MKS_SKIPR_V1.cpp} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/{variant.h => variant_MARLIN_MKS_SKIPR_V1.h} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/{variant.cpp => variant_generic.cpp} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/{variant.h => variant_generic.h} (100%) create mode 100644 buildroot/share/PlatformIO/variants/README.md diff --git a/Marlin/src/HAL/STM32/MarlinSPI.cpp b/Marlin/src/HAL/STM32/MarlinSPI.cpp index f7c603d77e5c..ba99879bd1ed 100644 --- a/Marlin/src/HAL/STM32/MarlinSPI.cpp +++ b/Marlin/src/HAL/STM32/MarlinSPI.cpp @@ -26,7 +26,7 @@ #include "MarlinSPI.h" -static void spi_init(spi_t *obj, uint32_t speed, spi_mode_e mode, uint8_t msb, uint32_t dataSize) { +static void spi_init(spi_t *obj, uint32_t speed, SPIMode mode, uint8_t msb, uint32_t dataSize) { spi_init(obj, speed, mode, msb); // spi_init set 8bit always // TODO: copy the code from spi_init and handle data size, to avoid double init always!! diff --git a/Marlin/src/HAL/STM32/MarlinSPI.h b/Marlin/src/HAL/STM32/MarlinSPI.h index fbd3585ff447..caf735d4e2d9 100644 --- a/Marlin/src/HAL/STM32/MarlinSPI.h +++ b/Marlin/src/HAL/STM32/MarlinSPI.h @@ -61,7 +61,7 @@ class MarlinSPI { _spi.pin_ssel = digitalPinToPinName(_ssPin); _dataSize = DATA_SIZE_8BIT; _bitOrder = MSBFIRST; - _dataMode = SPI_MODE_0; + _dataMode = SPI_MODE0; _spi.handle.State = HAL_SPI_STATE_RESET; setClockDivider(SPI_SPEED_CLOCK_DIV2_MHZ); } @@ -80,10 +80,10 @@ class MarlinSPI { void setDataMode(uint8_t _mode) { switch (_mode) { - case SPI_MODE0: _dataMode = SPI_MODE_0; break; - case SPI_MODE1: _dataMode = SPI_MODE_1; break; - case SPI_MODE2: _dataMode = SPI_MODE_2; break; - case SPI_MODE3: _dataMode = SPI_MODE_3; break; + case SPI_MODE0: _dataMode = SPI_MODE0; break; + case SPI_MODE1: _dataMode = SPI_MODE1; break; + case SPI_MODE2: _dataMode = SPI_MODE2; break; + case SPI_MODE3: _dataMode = SPI_MODE3; break; } } @@ -96,7 +96,7 @@ class MarlinSPI { DMA_HandleTypeDef _dmaTx; DMA_HandleTypeDef _dmaRx; BitOrder _bitOrder; - spi_mode_e _dataMode; + SPIMode _dataMode; uint8_t _clockDivider; uint32_t _speed; uint32_t _dataSize; diff --git a/Marlin/src/HAL/STM32/pinsDebug.h b/Marlin/src/HAL/STM32/pinsDebug.h index 21cd2de39fef..2d21fdf4dc74 100644 --- a/Marlin/src/HAL/STM32/pinsDebug.h +++ b/Marlin/src/HAL/STM32/pinsDebug.h @@ -21,6 +21,10 @@ */ #pragma once +#ifndef PINS_DEBUGGING + #error "PINS_DEBUGGING not defined but tried to include debug header!" +#endif + /** * Pins Debugging for STM32 * @@ -47,6 +51,9 @@ // Only in ST's Arduino core (STM32duino, STM32Core) #error "Expected NUM_DIGITAL_PINS not found" #endif +#ifndef NUM_ANALOG_INPUTS + #error "Expected NUM_ANALOG_INPUTS not found" +#endif /** * Life gets complicated if you want an easy to use 'M43 I' output (in port/pin order) @@ -124,10 +131,28 @@ const XrefInfo pin_xref[] PROGMEM = { #define PORT_NUM(P) (((P) >> 4) & 0x0007) #define PORT_ALPHA(P) ('A' + ((P) >> 4)) -#if NUM_ANALOG_FIRST >= NUM_DIGITAL_PINS - #define HAS_HIGH_ANALOG_PINS 1 +/** + * Translation of routines & variables used by pinsDebug.h + */ +#ifndef __STRINGIFY + #define __STRINGIFY(x) #x +#endif +#define TOSTRING(x) __STRINGIFY(x) +#define _STM32_PLATDEFPATH(x) TOSTRING(platdefs/x.h) +#ifdef _STM32_PLATDEFS + #if __has_include(_STM32_PLATDEFPATH(_STM32_PLATDEFS)) + #include _STM32_PLATDEFPATH(_STM32_PLATDEFS) + #endif #endif -#ifndef NUM_ANALOG_LAST + +#ifndef NUM_ANALOG_FIRST + #warning "Preprocessor macro NUM_ANALOG_FIRST is not defined but PINS_DEBUGGING is enabled; ignoring analog pin debug functions." +#endif + +#ifdef NUM_ANALOG_FIRST + #if NUM_ANALOG_FIRST >= NUM_DIGITAL_PINS + #define HAS_HIGH_ANALOG_PINS 1 + #endif #define NUM_ANALOG_LAST ((NUM_ANALOG_FIRST) + (NUM_ANALOG_INPUTS) - 1) #endif #define NUMBER_PINS_TOTAL ((NUM_DIGITAL_PINS) + TERN0(HAS_HIGH_ANALOG_PINS, NUM_ANALOG_INPUTS)) @@ -186,8 +211,10 @@ bool getValidPinMode(const pin_t pin) { } int8_t digital_pin_to_analog_pin(const pin_t pin) { - if (WITHIN(pin, NUM_ANALOG_FIRST, NUM_ANALOG_LAST)) - return pin - NUM_ANALOG_FIRST; + #ifdef NUM_ANALOG_FIRST + if (WITHIN(pin, NUM_ANALOG_FIRST, NUM_ANALOG_LAST)) + return pin - NUM_ANALOG_FIRST; + #endif const int8_t ind = digitalPinToAnalogIndex(pin); return (ind < NUM_ANALOG_INPUTS) ? ind : -1; @@ -225,10 +252,12 @@ void printPinPort(const pin_t pin) { // Print number to be used with M42 int calc_p = pin; - if (pin > NUM_DIGITAL_PINS) { - calc_p -= NUM_ANALOG_FIRST; - if (calc_p > 7) calc_p += 8; - } + #ifdef NUM_ANALOG_FIRST + if (pin > NUM_DIGITAL_PINS) { + calc_p -= NUM_ANALOG_FIRST; + if (calc_p > 7) calc_p += 8; + } + #endif SERIAL_ECHOPGM(" M42 P", calc_p); SERIAL_CHAR(' '); if (calc_p < 100) { diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_ARTILLERY_RUBY.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_ARTILLERY_RUBY.h new file mode 100644 index 000000000000..0ca44d39df8b --- /dev/null +++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_ARTILLERY_RUBY.h @@ -0,0 +1,27 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#ifndef NUM_ANALOG_FIRST + #error "NUM_ANALOG_FIRST is not defined??" + #define NUM_ANALOG_FIRST 50 +#endif diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_BTT002.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_BTT002.h new file mode 100644 index 000000000000..12cd49d16b3e --- /dev/null +++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_BTT002.h @@ -0,0 +1,27 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#ifndef NUM_ANALOG_FIRST + #error "NUM_ANALOG_FIRST is not defined??" + #define NUM_ANALOG_FIRST 35 +#endif diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_E3_RRF.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_E3_RRF.h new file mode 100644 index 000000000000..12cd49d16b3e --- /dev/null +++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_E3_RRF.h @@ -0,0 +1,27 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#ifndef NUM_ANALOG_FIRST + #error "NUM_ANALOG_FIRST is not defined??" + #define NUM_ANALOG_FIRST 35 +#endif diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_GTR_V1.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_GTR_V1.h new file mode 100644 index 000000000000..12cd49d16b3e --- /dev/null +++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_GTR_V1.h @@ -0,0 +1,27 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#ifndef NUM_ANALOG_FIRST + #error "NUM_ANALOG_FIRST is not defined??" + #define NUM_ANALOG_FIRST 35 +#endif diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_OCTOPUS_PRO_V1_F429.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_OCTOPUS_PRO_V1_F429.h new file mode 100644 index 000000000000..071b5a612064 --- /dev/null +++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_OCTOPUS_PRO_V1_F429.h @@ -0,0 +1,27 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#ifndef NUM_ANALOG_FIRST + #error "NUM_ANALOG_FIRST is not defined??" + #define NUM_ANALOG_FIRST NUM_DIGITAL_PINS +#endif diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_OCTOPUS_V1.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_OCTOPUS_V1.h new file mode 100644 index 000000000000..071b5a612064 --- /dev/null +++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_OCTOPUS_V1.h @@ -0,0 +1,27 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#ifndef NUM_ANALOG_FIRST + #error "NUM_ANALOG_FIRST is not defined??" + #define NUM_ANALOG_FIRST NUM_DIGITAL_PINS +#endif diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_SKR_PRO_11.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_SKR_PRO_11.h new file mode 100644 index 000000000000..12cd49d16b3e --- /dev/null +++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_SKR_PRO_11.h @@ -0,0 +1,27 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#ifndef NUM_ANALOG_FIRST + #error "NUM_ANALOG_FIRST is not defined??" + #define NUM_ANALOG_FIRST 35 +#endif diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_BTT_SKR_SE_BX.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_BTT_SKR_SE_BX.h new file mode 100644 index 000000000000..05d9c4f97326 --- /dev/null +++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_BTT_SKR_SE_BX.h @@ -0,0 +1,27 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#ifndef NUM_ANALOG_FIRST + #error "NUM_ANALOG_FIRST is not defined??" + #define NUM_ANALOG_FIRST 108 +#endif diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_F103Rx.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_F103Rx.h new file mode 100644 index 000000000000..5f1a94e9203a --- /dev/null +++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_F103Rx.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_F103VE_LONGER.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_F103VE_LONGER.h new file mode 100644 index 000000000000..5f1a94e9203a --- /dev/null +++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_F103VE_LONGER.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_F103Vx.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_F103Vx.h new file mode 100644 index 000000000000..5f1a94e9203a --- /dev/null +++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_F103Vx.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_F103Zx.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_F103Zx.h new file mode 100644 index 000000000000..5f1a94e9203a --- /dev/null +++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_F103Zx.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_F401RC.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_F401RC.h new file mode 100644 index 000000000000..fa79c7ab5f68 --- /dev/null +++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_F401RC.h @@ -0,0 +1,27 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#ifndef NUM_ANALOG_FIRST + #error "NUM_ANALOG_FIRST is not defined??" + #define NUM_ANALOG_FIRST 192 +#endif diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_F401RC_CREALITY.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_F401RC_CREALITY.h new file mode 100644 index 000000000000..5f1a94e9203a --- /dev/null +++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_F401RC_CREALITY.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_F407VE.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_F407VE.h new file mode 100644 index 000000000000..45d85cacc238 --- /dev/null +++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_F407VE.h @@ -0,0 +1,40 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#if defined(ARDUINO_BLACK_F407VE) || defined(ARDUINO_BLACK_F407VG) + +#ifndef NUM_ANALOG_FIRST + #error "NUM_ANALOG_FIRST is not defined??" + #define NUM_ANALOG_FIRST 44 +#endif + +#endif + +#if defined(ARDUINO_BLACK_F407ZE) || defined(ARDUINO_BLACK_F407ZG) + +#ifndef NUM_ANALOG_FIRST + #error "NUM_ANALOG_FIRST is not defined??" + #define NUM_ANALOG_FIRST 75 +#endif + +#endif diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_F407ZE.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_F407ZE.h new file mode 100644 index 000000000000..071b5a612064 --- /dev/null +++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_F407ZE.h @@ -0,0 +1,27 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#ifndef NUM_ANALOG_FIRST + #error "NUM_ANALOG_FIRST is not defined??" + #define NUM_ANALOG_FIRST NUM_DIGITAL_PINS +#endif diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_F446VE.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_F446VE.h new file mode 100644 index 000000000000..5f1a94e9203a --- /dev/null +++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_F446VE.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_F446Zx_TRONXY.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_F446Zx_TRONXY.h new file mode 100644 index 000000000000..69ae8fa3f217 --- /dev/null +++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_F446Zx_TRONXY.h @@ -0,0 +1,27 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#ifndef NUM_ANALOG_FIRST + #error "NUM_ANALOG_FIRST is not defined??" + #define NUM_ANALOG_FIRST 128 +#endif diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_F4x7Vx.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_F4x7Vx.h new file mode 100644 index 000000000000..5f1a94e9203a --- /dev/null +++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_F4x7Vx.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_FLY_F407ZG.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_FLY_F407ZG.h new file mode 100644 index 000000000000..f0eedf13b079 --- /dev/null +++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_FLY_F407ZG.h @@ -0,0 +1,27 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#ifndef NUM_ANALOG_FIRST + #error "NUM_ANALOG_FIRST is not defined??" + #define NUM_ANALOG_FIRST 107 +#endif diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_FYSETC_S6.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_FYSETC_S6.h new file mode 100644 index 000000000000..5ae0ecdb5061 --- /dev/null +++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_FYSETC_S6.h @@ -0,0 +1,27 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#ifndef NUM_ANALOG_FIRST + #error "NUM_ANALOG_FIRST is not defined??" + #define NUM_ANALOG_FIRST 80 +#endif diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_FYSETC_SPIDER_KING407.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_FYSETC_SPIDER_KING407.h new file mode 100644 index 000000000000..f0eedf13b079 --- /dev/null +++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_FYSETC_SPIDER_KING407.h @@ -0,0 +1,27 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#ifndef NUM_ANALOG_FIRST + #error "NUM_ANALOG_FIRST is not defined??" + #define NUM_ANALOG_FIRST 107 +#endif diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_G0B1RE.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_G0B1RE.h new file mode 100644 index 000000000000..8523b8bf13c5 --- /dev/null +++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_G0B1RE.h @@ -0,0 +1,27 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#ifndef NUM_ANALOG_FIRST + #error "NUM_ANALOG_FIRST is not defined??" + #define NUM_ANALOG_FIRST PA0 +#endif diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_LERDGE.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_LERDGE.h new file mode 100644 index 000000000000..9a91c879a498 --- /dev/null +++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_LERDGE.h @@ -0,0 +1,27 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#ifndef NUM_ANALOG_FIRST + #error "NUM_ANALOG_FIRST is not defined??" + #define NUM_ANALOG_FIRST 75 +#endif diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_TH3D_EZBOARD_V2.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_TH3D_EZBOARD_V2.h new file mode 100644 index 000000000000..5f1a94e9203a --- /dev/null +++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_TH3D_EZBOARD_V2.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/core/macros.h b/Marlin/src/core/macros.h index e3fd9b660991..b6400b7fea61 100644 --- a/Marlin/src/core/macros.h +++ b/Marlin/src/core/macros.h @@ -380,26 +380,21 @@ #ifdef __cplusplus - #ifndef _MINMAX_H_ - #define _MINMAX_H_ - - extern "C++" { - - // C++11 solution that is standards compliant. Return type is deduced automatically - template static constexpr N _MIN(const N val) { return val; } - template static constexpr N _MAX(const N val) { return val; } - template static constexpr auto _MIN(const L lhs, const R rhs) -> decltype(lhs + rhs) { - return lhs < rhs ? lhs : rhs; - } - template static constexpr auto _MAX(const L lhs, const R rhs) -> decltype(lhs + rhs) { - return lhs > rhs ? lhs : rhs; - } - template static constexpr const T _MIN(T V, Ts... Vs) { return _MIN(V, _MIN(Vs...)); } - template static constexpr const T _MAX(T V, Ts... Vs) { return _MAX(V, _MAX(Vs...)); } + extern "C++" { + // C++11 solution that is standards compliant. Return type is deduced automatically + template static constexpr N _MIN(const N val) { return val; } + template static constexpr N _MAX(const N val) { return val; } + template static constexpr auto _MIN(const L lhs, const R rhs) -> decltype(lhs + rhs) { + return lhs < rhs ? lhs : rhs; } + template static constexpr auto _MAX(const L lhs, const R rhs) -> decltype(lhs + rhs) { + return lhs > rhs ? lhs : rhs; + } + template static constexpr const T _MIN(T V, Ts... Vs) { return _MIN(V, _MIN(Vs...)); } + template static constexpr const T _MAX(T V, Ts... Vs) { return _MAX(V, _MAX(Vs...)); } - #endif + } // Allow manipulating enumeration value like flags without ugly cast everywhere #define ENUM_FLAGS(T) \ diff --git a/buildroot/share/PlatformIO/boards/README.md b/buildroot/share/PlatformIO/boards/README.md new file mode 100644 index 000000000000..b178efc17966 --- /dev/null +++ b/buildroot/share/PlatformIO/boards/README.md @@ -0,0 +1,9 @@ +# Marlin Custom Boards + +Boards are specified in the INI files with the `board = board_name` field. If the board doesn't exist in the platform folder downloaded by PlatformIO then it should be defined in this folder. + +The board definition JSON files in this folder provide build and upload information about boards that Marlin supports but which are not defined by any platform included with PlatformIO. + +## Custom Variants + +See the `buildroot/PlatformIO/variants` folder for custom variants referred to by `build.variant` in the JSON. diff --git a/buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/variant_MARLIN_ARTILLERY_RUBY.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/variant_MARLIN_ARTILLERY_RUBY.cpp diff --git a/buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/variant_MARLIN_ARTILLERY_RUBY.h similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/variant_MARLIN_ARTILLERY_RUBY.h diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BTT_BTT002/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_BTT_BTT002/variant_MARLIN_BTT_BTT002.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_BTT_BTT002/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_BTT_BTT002/variant_MARLIN_BTT_BTT002.cpp diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BTT_BTT002/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_BTT_BTT002/variant_MARLIN_BTT_BTT002.h similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_BTT_BTT002/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_BTT_BTT002/variant_MARLIN_BTT_BTT002.h diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BTT_E3_RRF/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_BTT_E3_RRF/variant_generic.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_BTT_E3_RRF/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_BTT_E3_RRF/variant_generic.cpp diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BTT_E3_RRF/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_BTT_E3_RRF/variant_generic.h similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_BTT_E3_RRF/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_BTT_E3_RRF/variant_generic.h diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BTT_GTR_V1/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_BTT_GTR_V1/variant_MARLIN_BTT_GTR_V1.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_BTT_GTR_V1/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_BTT_GTR_V1/variant_MARLIN_BTT_GTR_V1.cpp diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BTT_GTR_V1/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_BTT_GTR_V1/variant_MARLIN_BTT_GTR_V1.h similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_BTT_GTR_V1/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_BTT_GTR_V1/variant_MARLIN_BTT_GTR_V1.h diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_PRO_V1_F429/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_PRO_V1_F429/variant_MARLIN_BTT_OCTOPUS_PRO_V1_F429.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_PRO_V1_F429/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_PRO_V1_F429/variant_MARLIN_BTT_OCTOPUS_PRO_V1_F429.cpp diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_PRO_V1_F429/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_PRO_V1_F429/variant_MARLIN_BTT_OCTOPUS_PRO_V1_F429.h similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_PRO_V1_F429/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_PRO_V1_F429/variant_MARLIN_BTT_OCTOPUS_PRO_V1_F429.h diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_V1/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_V1/variant_MARLIN_BTT_OCTOPUS_V1.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_V1/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_V1/variant_MARLIN_BTT_OCTOPUS_V1.cpp diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_V1/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_V1/variant_MARLIN_BTT_OCTOPUS_V1.h similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_V1/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_V1/variant_MARLIN_BTT_OCTOPUS_V1.h diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_PRO_11/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_PRO_11/variant_MARLIN_BTT_SKR_PRO_11.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_PRO_11/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_PRO_11/variant_MARLIN_BTT_SKR_PRO_11.cpp diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_PRO_11/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_PRO_11/variant_MARLIN_BTT_SKR_PRO_11.h similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_PRO_11/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_PRO_11/variant_MARLIN_BTT_SKR_PRO_11.h diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/variant_MARLIN_BTT_SKR_SE_BX.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/variant_MARLIN_BTT_SKR_SE_BX.cpp diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/variant_MARLIN_BTT_SKR_SE_BX.h similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/variant_MARLIN_BTT_SKR_SE_BX.h diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F103Rx/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_F103Rx/variant_generic.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_F103Rx/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_F103Rx/variant_generic.cpp diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F103Rx/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_F103Rx/variant_generic.h similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_F103Rx/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_F103Rx/variant_generic.h diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/variant_MARLIN_F103VE_LONGER.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/variant_MARLIN_F103VE_LONGER.cpp diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/variant_MARLIN_F103VE_LONGER.h similarity index 97% rename from buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/variant_MARLIN_F103VE_LONGER.h index 05ce7161db1b..0fc0599b05e4 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/variant.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/variant_MARLIN_F103VE_LONGER.h @@ -140,15 +140,15 @@ extern "C" { // Extra HAL modules #ifdef STM32F103xE -#ifndef HAL_DAC_MODULE_ENABLED - //#define HAL_DAC_MODULE_ENABLED (unused or maybe for the eeprom write?) -#endif -#ifndef HAL_SD_MODULE_ENABLED - #define HAL_SD_MODULE_ENABLED -#endif -#ifndef HAL_SRAM_MODULE_ENABLED - #define HAL_SRAM_MODULE_ENABLED -#endif + #ifndef HAL_DAC_MODULE_ENABLED + //#define HAL_DAC_MODULE_ENABLED (unused or maybe for the eeprom write?) + #endif + #ifndef HAL_SD_MODULE_ENABLED + #define HAL_SD_MODULE_ENABLED + #endif + #ifndef HAL_SRAM_MODULE_ENABLED + #define HAL_SRAM_MODULE_ENABLED + #endif #endif #ifdef __cplusplus diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F103Vx/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_F103Vx/variant_generic.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_F103Vx/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_F103Vx/variant_generic.cpp diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F103Vx/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_F103Vx/variant_generic.h similarity index 95% rename from buildroot/share/PlatformIO/variants/MARLIN_F103Vx/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_F103Vx/variant_generic.h index 8ed0025a6250..f704af879f69 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_F103Vx/variant.h +++ b/buildroot/share/PlatformIO/variants/MARLIN_F103Vx/variant_generic.h @@ -145,15 +145,15 @@ extern "C" { // Extra HAL modules #if defined(STM32F103xE) || defined(STM32F103xG) -#ifndef HAL_DAC_MODULE_ENABLED - #define HAL_DAC_MODULE_ENABLED -#endif -#ifndef HAL_SD_MODULE_ENABLED - #define HAL_SD_MODULE_ENABLED -#endif -#ifndef HAL_SRAM_MODULE_ENABLED - #define HAL_SRAM_MODULE_ENABLED -#endif + #ifndef HAL_DAC_MODULE_ENABLED + #define HAL_DAC_MODULE_ENABLED + #endif + #ifndef HAL_SD_MODULE_ENABLED + #define HAL_SD_MODULE_ENABLED + #endif + #ifndef HAL_SRAM_MODULE_ENABLED + #define HAL_SRAM_MODULE_ENABLED + #endif #endif // Default pin used for 'Serial' instance (ex: ST-Link) diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/variant_generic.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_F103Zx/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_F103Zx/variant_generic.cpp diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/variant_generic.h similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_F103Zx/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_F103Zx/variant_generic.h diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F401RC/variant_MARLIN_STM32F401RC.cpp b/buildroot/share/PlatformIO/variants/MARLIN_F401RC/variant_MARLIN_F401RC.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_F401RC/variant_MARLIN_STM32F401RC.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_F401RC/variant_MARLIN_F401RC.cpp diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F401RC/variant_MARLIN_STM32F401RC.h b/buildroot/share/PlatformIO/variants/MARLIN_F401RC/variant_MARLIN_F401RC.h similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_F401RC/variant_MARLIN_STM32F401RC.h rename to buildroot/share/PlatformIO/variants/MARLIN_F401RC/variant_MARLIN_F401RC.h diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F401RC_CREALITY/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_F401RC_CREALITY/variant_generic.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_F401RC_CREALITY/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_F401RC_CREALITY/variant_generic.cpp diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F401RC_CREALITY/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_F401RC_CREALITY/variant_generic.h similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_F401RC_CREALITY/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_F401RC_CREALITY/variant_generic.h diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F401RE_CREALITY/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_F401RE_CREALITY/variant_MARLIN_F401RE_CREALITY.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_F401RE_CREALITY/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_F401RE_CREALITY/variant_MARLIN_F401RE_CREALITY.cpp diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F401RE_CREALITY/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_F401RE_CREALITY/variant_MARLIN_F401RE_CREALITY.h similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_F401RE_CREALITY/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_F401RE_CREALITY/variant_MARLIN_F401RE_CREALITY.h diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F446VE/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_F446VE/variant_generic.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_F446VE/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_F446VE/variant_generic.cpp diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F446VE/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_F446VE/variant_generic.h similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_F446VE/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_F446VE/variant_generic.h diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant_generic.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant_generic.cpp diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant_generic.h similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant_generic.h diff --git a/buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/variant_generic.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/variant_generic.cpp diff --git a/buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/variant_generic.h similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/variant_generic.h diff --git a/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_S6/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_S6/variant_MARLIN_FYSETC_S6.cpp similarity index 93% rename from buildroot/share/PlatformIO/variants/MARLIN_FYSETC_S6/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_FYSETC_S6/variant_MARLIN_FYSETC_S6.cpp index 7e3df41f1bf0..78ca9018e5e7 100644 --- a/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_S6/variant.cpp +++ b/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_S6/variant_MARLIN_FYSETC_S6.cpp @@ -115,6 +115,26 @@ const PinName digitalPin[] = { PC_4 //D86/A6 }; +// Analog (Ax) pin number array +const uint32_t analogInputPin[] = { + 3, //D3 //A0 + 4, //D4 //A1 + 32, //D32 //A2 + 33, //D33 //A3 + 34, //D34 //A4 + 35, //D35 //A5 + 36, //D36 //A6 + 0, //D0 //A7 + 1, //D1 //A8 + 2, //D2 //A9 + 5, //D5 //A10 + 6, //D6 //A11 + 7, //D7 //A12 + 16, //D16 //A13 + 17, //D17 //A14 + 37 //D37 //A15 +}; + #ifdef __cplusplus } #endif diff --git a/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_S6/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_S6/variant_MARLIN_FYSETC_S6.h similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_FYSETC_S6/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_FYSETC_S6/variant_MARLIN_FYSETC_S6.h diff --git a/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_SPIDER_KING407/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_SPIDER_KING407/variant_generic.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_FYSETC_SPIDER_KING407/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_FYSETC_SPIDER_KING407/variant_generic.cpp diff --git a/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_SPIDER_KING407/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_SPIDER_KING407/variant_generic.h similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_FYSETC_SPIDER_KING407/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_FYSETC_SPIDER_KING407/variant_generic.h diff --git a/buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/variant_MARLIN_STM32G0B1RE.cpp b/buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/variant_MARLIN_G0B1RE.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/variant_MARLIN_STM32G0B1RE.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/variant_MARLIN_G0B1RE.cpp diff --git a/buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/variant_MARLIN_STM32G0B1RE.h b/buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/variant_MARLIN_G0B1RE.h similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/variant_MARLIN_STM32G0B1RE.h rename to buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/variant_MARLIN_G0B1RE.h diff --git a/buildroot/share/PlatformIO/variants/MARLIN_G0B1VE/variant_MARLIN_STM32G0B1VE.cpp b/buildroot/share/PlatformIO/variants/MARLIN_G0B1VE/variant_MARLIN_G0B1VE.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_G0B1VE/variant_MARLIN_STM32G0B1VE.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_G0B1VE/variant_MARLIN_G0B1VE.cpp diff --git a/buildroot/share/PlatformIO/variants/MARLIN_G0B1VE/variant_MARLIN_STM32G0B1VE.h b/buildroot/share/PlatformIO/variants/MARLIN_G0B1VE/variant_MARLIN_G0B1VE.h similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_G0B1VE/variant_MARLIN_STM32G0B1VE.h rename to buildroot/share/PlatformIO/variants/MARLIN_G0B1VE/variant_MARLIN_G0B1VE.h diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H723VG/variant_MARLIN_STM32H723VG.cpp b/buildroot/share/PlatformIO/variants/MARLIN_H723VG/variant_MARLIN_H723VG.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_H723VG/variant_MARLIN_STM32H723VG.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_H723VG/variant_MARLIN_H723VG.cpp diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H723VG/variant_MARLIN_STM32H723VG.h b/buildroot/share/PlatformIO/variants/MARLIN_H723VG/variant_MARLIN_H723VG.h similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_H723VG/variant_MARLIN_STM32H723VG.h rename to buildroot/share/PlatformIO/variants/MARLIN_H723VG/variant_MARLIN_H723VG.h diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H723ZE/variant_MARLIN_STM32H723ZE.cpp b/buildroot/share/PlatformIO/variants/MARLIN_H723ZE/variant_MARLIN_H723ZE.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_H723ZE/variant_MARLIN_STM32H723ZE.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_H723ZE/variant_MARLIN_H723ZE.cpp diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H723ZE/variant_MARLIN_STM32H723ZE.h b/buildroot/share/PlatformIO/variants/MARLIN_H723ZE/variant_MARLIN_H723ZE.h similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_H723ZE/variant_MARLIN_STM32H723ZE.h rename to buildroot/share/PlatformIO/variants/MARLIN_H723ZE/variant_MARLIN_H723ZE.h diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H723ZG/variant_MARLIN_STM32H723ZG.cpp b/buildroot/share/PlatformIO/variants/MARLIN_H723ZG/variant_MARLIN_H723ZG.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_H723ZG/variant_MARLIN_STM32H723ZG.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_H723ZG/variant_MARLIN_H723ZG.cpp diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H723ZG/variant_MARLIN_STM32H723ZG.h b/buildroot/share/PlatformIO/variants/MARLIN_H723ZG/variant_MARLIN_H723ZG.h similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_H723ZG/variant_MARLIN_STM32H723ZG.h rename to buildroot/share/PlatformIO/variants/MARLIN_H723ZG/variant_MARLIN_H723ZG.h diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H743VI/variant_MARLIN_STM32H743VI.cpp b/buildroot/share/PlatformIO/variants/MARLIN_H743VI/variant_MARLIN_H743VI.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_H743VI/variant_MARLIN_STM32H743VI.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_H743VI/variant_MARLIN_H743VI.cpp diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H743VI/variant_MARLIN_STM32H743VI.h b/buildroot/share/PlatformIO/variants/MARLIN_H743VI/variant_MARLIN_H743VI.h similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_H743VI/variant_MARLIN_STM32H743VI.h rename to buildroot/share/PlatformIO/variants/MARLIN_H743VI/variant_MARLIN_H743VI.h diff --git a/buildroot/share/PlatformIO/variants/MARLIN_I3DBEEZ9/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_I3DBEEZ9/variant_MARLIN_I3DBEEZ9.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_I3DBEEZ9/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_I3DBEEZ9/variant_MARLIN_I3DBEEZ9.cpp diff --git a/buildroot/share/PlatformIO/variants/MARLIN_I3DBEEZ9/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_I3DBEEZ9/variant_MARLIN_I3DBEEZ9.h similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_I3DBEEZ9/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_I3DBEEZ9/variant_MARLIN_I3DBEEZ9.h diff --git a/buildroot/share/PlatformIO/variants/MARLIN_LERDGE/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_LERDGE/variant_generic.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_LERDGE/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_LERDGE/variant_generic.cpp diff --git a/buildroot/share/PlatformIO/variants/MARLIN_LERDGE/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_LERDGE/variant_generic.h similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_LERDGE/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_LERDGE/variant_generic.h diff --git a/buildroot/share/PlatformIO/variants/MARLIN_MKS_ROBIN2/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_MKS_ROBIN2/variant_MARLIN_MKS_ROBIN2.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_MKS_ROBIN2/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_MKS_ROBIN2/variant_MARLIN_MKS_ROBIN2.cpp diff --git a/buildroot/share/PlatformIO/variants/MARLIN_MKS_ROBIN2/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_MKS_ROBIN2/variant_MARLIN_MKS_ROBIN2.h similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_MKS_ROBIN2/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_MKS_ROBIN2/variant_MARLIN_MKS_ROBIN2.h diff --git a/buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/variant_MARLIN_MKS_SKIPR_V1.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/variant_MARLIN_MKS_SKIPR_V1.cpp diff --git a/buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/variant_MARLIN_MKS_SKIPR_V1.h similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/variant_MARLIN_MKS_SKIPR_V1.h diff --git a/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/variant_generic.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/variant_generic.cpp diff --git a/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/variant_generic.h similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/variant_generic.h diff --git a/buildroot/share/PlatformIO/variants/README.md b/buildroot/share/PlatformIO/variants/README.md new file mode 100644 index 000000000000..9f0225b116af --- /dev/null +++ b/buildroot/share/PlatformIO/variants/README.md @@ -0,0 +1,20 @@ +# Marlin Custom Variants + +This folder contains Marlin custom variants for both generic and custom boards. + +There are two ways that Marlin can specify a board variant: +- With the `board_build.variant = VARIANT_MAME` field, specifying the variant subfolder name. +- With the `board = board_name` field set to a custom board with a `build.variant` field. + +## Variant File Naming + +With the latest STM32 platform the full names of the `variant.h` and `variant.cpp` files are based on the name of the board. If the variant is based on a generic board definition, not a Marlin custom board, then `variant_generic.h`/`.cpp` should be used. Otherwise, the capitalized name of the `board` should be used. + +| board | board file | variant | Variant Files | +|-------|------------|---------|---------------| +|`genericSTM32F103VE`|n/a|`MARLIN_F103Vx`|`variants/MARLIN_F103Vx/variant_generic.*`| +|`marlin_STM32F407ZE`|`marlin_STM32F407ZE.json`|`MARLIN_F407ZE`|`variants/MARLIN_F407ZE/variant_MARLIN_F407ZE.*`| + +## Custom Boards + +See the `buildroot/PlatformIO/boards` folder for Marlin custom boards. diff --git a/ini/features.ini b/ini/features.ini index b2e9d6884e75..d940f246722d 100644 --- a/ini/features.ini +++ b/ini/features.ini @@ -374,7 +374,7 @@ IS_SCARA = build_src_filter=+ + MORGAN_SCARA = build_src_filter=+ HAS_MICROSTEPS = build_src_filter=+ -(ESP3D_)?WIFISUPPORT = AsyncTCP, ESP Async WebServer +(ESP3D_)?WIFISUPPORT = AsyncTCP, ESP Async WebServer=https://github.com/har-in-air/ESPAsyncWebServer.git ESP3DLib=https://github.com/luc-github/ESP3DLib/archive/dc0f3d96c6.zip arduinoWebSockets=links2004/WebSockets@2.3.4 luc-github/ESP32SSDP@1.1.1 diff --git a/ini/stm32-common.ini b/ini/stm32-common.ini index ec058d108709..d7cca462a3ac 100644 --- a/ini/stm32-common.ini +++ b/ini/stm32-common.ini @@ -9,6 +9,7 @@ # #################################### +# For Compatibility. Should be set to version that is last known to work across all boards. [common_stm32] platform = ststm32@~12.1 board_build.core = stm32 @@ -26,6 +27,19 @@ custom_marlin.HAS_SPI_TFT = build_src_filter=+ custom_marlin.TFT_TOUCH_DEVICE_GT911 = build_src_filter=+ +# +# Use the latest release of platformio/platform-ststm32 +# from https://github.com/platformio/platform-ststm32/releases +# for all boards where it will build and run. +# Only bump the common_stm32 platform to a tested and stable version. +# +[common_stm32_latest] +extends = common_stm32 +platform = ststm32@~17.6.0 +build_flags = ${common_stm32.build_flags} + -std=gnu++2a +build_unflags = -std=gnu++14 + # # STM32 board based on a variant. # @@ -35,6 +49,10 @@ extra_scripts = ${common_stm32.extra_scripts} pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py buildroot/share/PlatformIO/scripts/offset_and_rename.py +[stm32_variant_latest] +extends = common_stm32_latest +extra_scripts = ${stm32_variant.extra_scripts} + # # USB Flash Drive mix-ins for STM32 # diff --git a/ini/stm32f0.ini b/ini/stm32f0.ini index d23ee2a6038e..34c5c6311b12 100644 --- a/ini/stm32f0.ini +++ b/ini/stm32f0.ini @@ -23,9 +23,9 @@ # Malyan M200 v2 (STM32F070RB) # [env:STM32F070RB_malyan] -extends = common_stm32 +extends = common_stm32_latest board = marlin_malyanM200v2 -build_flags = ${common_stm32.build_flags} -DHAL_PCD_MODULE_ENABLED +build_flags = ${common_stm32_latest.build_flags} -DHAL_PCD_MODULE_ENABLED -O2 -ffreestanding -fsigned-char -fno-move-loop-invariants -fno-strict-aliasing -DCUSTOM_STARTUP_FILE @@ -33,9 +33,9 @@ build_flags = ${common_stm32.build_flags} -DHAL_PCD_MODULE_ENABLED # Malyan M200 v2 (STM32F070CB) # [env:STM32F070CB_malyan] -extends = common_stm32 +extends = common_stm32_latest board = malyanm200_f070cb -build_flags = ${common_stm32.build_flags} +build_flags = ${common_stm32_latest.build_flags} -DHAL_PCD_MODULE_ENABLED -DDISABLE_GENERIC_SERIALUSB -DHAL_UART_MODULE_ENABLED -DCUSTOM_STARTUP_FILE @@ -43,9 +43,9 @@ build_flags = ${common_stm32.build_flags} # Malyan M300 (STM32F070CB) # [env:malyan_M300] -extends = common_stm32 +extends = common_stm32_latest board = malyanm300_f070cb -build_flags = ${common_stm32.build_flags} +build_flags = ${common_stm32_latest.build_flags} -DHAL_PCD_MODULE_ENABLED -DDISABLE_GENERIC_SERIALUSB -DHAL_UART_MODULE_ENABLED build_src_filter = ${common.default_src_filter} + - diff --git a/ini/stm32f1-maple.ini b/ini/stm32f1-maple.ini index b2f14a61644b..e3ab5f232451 100644 --- a/ini/stm32f1-maple.ini +++ b/ini/stm32f1-maple.ini @@ -413,6 +413,7 @@ build_flags = ${STM32F1_maple.build_flags} -DMCU_STM32F103VE -DARDUINO_GENERIC_STM32F103V -DARDUINO_ARCH_STM32F1 -DDEBUG_LEVEL=DEBUG_NONE -DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1 -DSS_TIMER=4 + -D_STM32_PLATDEFS=MARLIN_F103Vx -DNO_MAPLE_WARNING board_build.variant = MARLIN_F103Vx board_build.ldscript = eryone_ery32_mini.ld diff --git a/ini/stm32f1.ini b/ini/stm32f1.ini index 0978b19476a2..41a655d233fa 100644 --- a/ini/stm32f1.ini +++ b/ini/stm32f1.ini @@ -20,17 +20,17 @@ ################################# [common_STM32F103RC_variant] -extends = stm32_variant +extends = stm32_variant_latest board = genericSTM32F103RC -board_build.variant = MARLIN_F103Rx -build_flags = ${stm32_variant.build_flags} -DDEBUG_LEVEL=0 +build_flags = ${stm32_variant_latest.build_flags} + -DDEBUG_LEVEL=0 -D_STM32_PLATDEFS=MARLIN_F103Rx monitor_speed = 115200 # # STM32F103RE # [env:STM32F103RE] -extends = common_stm32 +extends = common_stm32_latest board = genericSTM32F103RE monitor_speed = 115200 @@ -38,7 +38,7 @@ monitor_speed = 115200 # STM32F103VE # [env:STM32F103VE] -extends = common_stm32 +extends = common_stm32_latest board = genericSTM32F103VE monitor_speed = 115200 @@ -46,7 +46,7 @@ monitor_speed = 115200 # STM32F103ZE # [env:STM32F103ZE] -extends = common_stm32 +extends = common_stm32_latest board = genericSTM32F103ZE monitor_speed = 115200 @@ -66,6 +66,7 @@ board_upload.offset_address = 0x08007000 [env:STM32F103RC_btt_USB] extends = env:STM32F103RC_btt platform_packages = ${stm_flash_drive.platform_packages} +board_build.variant = MARLIN_F103Rx build_flags = ${env:STM32F103RC_btt.build_flags} -DUSE_USB_FS -DUSBD_IRQ_PRIO=5 @@ -90,14 +91,14 @@ lib_deps = markyue/Panda_SoftMasterI2C@1.0.3 # Uses HAL STM32 to support Marlin UI for TFT screen with optional touch panel # [env:mks_robin] -extends = stm32_variant +extends = stm32_variant_latest board = genericSTM32F103ZE -board_build.variant = MARLIN_F103Zx board_build.encrypt_mks = Robin.bin board_build.offset = 0x7000 -build_flags = ${stm32_variant.build_flags} +build_flags = ${stm32_variant_latest.build_flags} -DENABLE_HWSERIAL3 -DTIMER_SERIAL=TIM5 -build_unflags = ${stm32_variant.build_unflags} + -D_STM32_PLATDEFS=MARLIN_F103Zx +build_unflags = ${stm32_variant_latest.build_unflags} -DUSBCON -DUSBD_USE_CDC # @@ -118,16 +119,16 @@ debug_tool = stlink # Creality (STM32F103Rx) # [STM32F103Rx_creality] -extends = stm32_variant -board_build.variant = MARLIN_F103Rx +extends = stm32_variant_latest board_build.offset = 0x7000 board_build.rename = firmware-{date}-{time}.bin board_upload.offset_address = 0x08007000 -build_flags = ${stm32_variant.build_flags} +build_flags = ${stm32_variant_latest.build_flags} -DMCU_STM32F103RE -DHAL_SD_MODULE_ENABLED -DSS_TIMER=4 -DTIMER_SERVO=TIM5 -DENABLE_HWSERIAL3 -DTRANSFER_CLOCK_DIV=8 -build_unflags = ${stm32_variant.build_unflags} + -D_STM32_PLATDEFS=MARLIN_F103Rx +build_unflags = ${stm32_variant_latest.build_unflags} -DUSBCON -DUSBD_USE_CDC monitor_speed = 115200 debug_tool = jlink @@ -203,6 +204,7 @@ board_build.variant = MARLIN_F103Vx build_flags = ${STM32F103Rx_creality.build_flags} -DSS_TIMER=4 -DTIMER_SERVO=TIM5 -DENABLE_HWSERIAL3 -DTRANSFER_CLOCK_DIV=8 + -D_STM32_PLATDEFS=MARLIN_F103Vx # # BigTreeTech SKR Mini E3 V2.0 & DIP / SKR CR6 (STM32F103RET6 ARM Cortex-M3) # @@ -210,15 +212,15 @@ build_flags = ${STM32F103Rx_creality.build_flags} # STM32F103RE_btt_USB ......... RET6 with USB Media Share Support # [env:STM32F103RE_btt] -extends = stm32_variant +extends = stm32_variant_latest board = genericSTM32F103RE -board_build.variant = MARLIN_F103Rx board_build.offset = 0x7000 board_upload.offset_address = 0x08007000 -build_flags = ${stm32_variant.build_flags} +build_flags = ${stm32_variant_latest.build_flags} -DMCU_STM32F103RE -DHAL_SD_MODULE_ENABLED -DSS_TIMER=4 -DTIMER_SERVO=TIM5 -DENABLE_HWSERIAL3 -DTRANSFER_CLOCK_DIV=8 + -D_STM32_PLATDEFS=MARLIN_F103Rx monitor_speed = 115200 debug_tool = jlink upload_protocol = jlink @@ -226,6 +228,7 @@ upload_protocol = jlink [env:STM32F103RE_btt_USB] extends = env:STM32F103RE_btt platform_packages = ${stm_flash_drive.platform_packages} +board_build.variant = MARLIN_F103Rx build_flags = ${env:STM32F103RE_btt.build_flags} -DUSE_USB_FS -DUSBD_IRQ_PRIO=5 -DUSBD_IRQ_SUBPRIO=6 -DUSBD_USE_CDC_MSC @@ -235,47 +238,49 @@ build_unflags = ${env:STM32F103RE_btt.build_unflags} -DUSBD_USE_CDC # Mingda MPX_ARM_MINI # [env:mingda_mpx_arm_mini] -extends = stm32_variant +extends = stm32_variant_latest board = genericSTM32F103ZE -board_build.variant = MARLIN_F103Zx board_build.offset = 0x10000 -build_flags = ${stm32_variant.build_flags} +build_flags = ${stm32_variant_latest.build_flags} -DENABLE_HWSERIAL3 -DTIMER_SERIAL=TIM5 -build_unflags = ${stm32_variant.build_unflags} + -D_STM32_PLATDEFS=MARLIN_F103Zx +build_unflags = ${stm32_variant_latest.build_unflags} -DUSBCON -DUSBD_USE_CDC # # Malyan M200 (STM32F103CB) # [env:STM32F103CB_malyan] -extends = common_stm32 +extends = common_stm32_latest board = malyanm200_f103cb -build_flags = ${common_stm32.build_flags} +build_flags = ${common_stm32_latest.build_flags} -DHAL_PCD_MODULE_ENABLED -DDISABLE_GENERIC_SERIALUSB -DHAL_UART_MODULE_ENABLED -build_src_filter = ${common_stm32.build_src_filter} + - +build_src_filter = ${common_stm32_latest.build_src_filter} + - # # FLYmaker FLY Mini (STM32F103RCT6) # [env:FLY_MINI] -extends = stm32_variant +extends = stm32_variant_latest board = genericSTM32F103RC -board_build.variant = MARLIN_F103Rx board_build.offset = 0x5000 board_upload.offset_address = 0x08005000 -build_flags = ${stm32_variant.build_flags} -DSS_TIMER=4 +build_flags = ${stm32_variant_latest.build_flags} + -DSS_TIMER=4 + -D_STM32_PLATDEFS=MARLIN_F103Rx # # (STM32F103VE_robin) # [STM32F103VE_robin] -extends = stm32_variant +extends = stm32_variant_latest board = genericSTM32F103VE board_build.variant = MARLIN_F103Vx board_build.offset = 0x7000 board_upload.offset_address = 0x08007000 -build_flags = ${stm32_variant.build_flags} -DMCU_STM32F103VE -DTIMER_TONE=TIM3 -DTIMER_SERVO=TIM2 -DSS_TIMER=4 +build_flags = ${stm32_variant_latest.build_flags} -DMCU_STM32F103VE -DTIMER_TONE=TIM3 -DTIMER_SERVO=TIM2 -DSS_TIMER=4 + -D_STM32_PLATDEFS=MARLIN_F103Vx [mks_robin_nano_v1v2_common] extends = STM32F103VE_robin @@ -330,12 +335,13 @@ build_unflags = ${STM32F103VE_robin.build_unflags} -DUSBCON -DUSBD # MKS Robin Lite/Lite2 (STM32F103RCT6) # [env:mks_robin_lite] -extends = stm32_variant +extends = stm32_variant_latest board = genericSTM32F103RC -board_build.variant = MARLIN_F103Rx board_build.encrypt_mks = mksLite.bin board_build.offset = 0x5000 board_upload.offset_address = 0x08005000 +build_flags = ${stm32_variant_latest.build_flags} + -D_STM32_PLATDEFS=MARLIN_F103Rx # # MKS ROBIN LITE3 (STM32F103RCT6) @@ -355,14 +361,14 @@ board_build.encrypt_mks = Robin_pro.bin # JGAurora A5S A1 (STM32F103ZET6) # [env:jgaurora_a5s_a1] -extends = stm32_variant +extends = stm32_variant_latest board = genericSTM32F103ZE -board_build.variant = MARLIN_F103Zx board_build.offset = 0xA000 board_upload.offset_address = 0x0800A000 -build_flags = ${stm32_variant.build_flags} +build_flags = ${stm32_variant_latest.build_flags} -DSTM32F1xx -DSTM32_XL_DENSITY -extra_scripts = ${stm32_variant.extra_scripts} + -D_STM32_PLATDEFS=MARLIN_F103Zx +extra_scripts = ${stm32_variant_latest.extra_scripts} buildroot/share/PlatformIO/scripts/jgaurora_a5s_a1_with_bootloader.py # @@ -381,17 +387,18 @@ upload_protocol = serial # Longer 3D board in Alfawise U20 (STM32F103VET6) # [env:STM32F103VE_longer] -extends = stm32_variant +extends = stm32_variant_latest lib_deps = ${common.lib_deps} https://github.com/tpruvot/STM32_Servo_OpenDrain/archive/2.0.zip board = genericSTM32F103VE -board_build.variant = MARLIN_F103VE_LONGER board_build.rename = project.bin board_build.offset = 0x10000 board_upload.offset_address = 0x08010000 -build_flags = ${stm32_variant.build_flags} -DMCU_STM32F103VE -DU20 -DTS_V12 -build_unflags = ${stm32_variant.build_unflags} -DUSBCON -DUSBD_USE_CDC -DHAL_PCD_MODULE_ENABLED -extra_scripts = ${stm32_variant.extra_scripts} +build_flags = ${stm32_variant_latest.build_flags} + -DMCU_STM32F103VE -DU20 -DTS_V12 + -D_STM32_PLATDEFS=MARLIN_F103VE_LONGER +build_unflags = ${stm32_variant_latest.build_unflags} -DUSBCON -DUSBD_USE_CDC -DHAL_PCD_MODULE_ENABLED +extra_scripts = ${stm32_variant_latest.extra_scripts} monitor_speed = 250000 debug_tool = stlink @@ -399,12 +406,12 @@ debug_tool = stlink # TRIGORILLA PRO (STM32F103ZET6) # [env:trigorilla_pro] -extends = stm32_variant +extends = stm32_variant_latest board = genericSTM32F103ZE -board_build.variant = MARLIN_F103Zx -build_flags = ${stm32_variant.build_flags} +build_flags = ${stm32_variant_latest.build_flags} -DENABLE_HWSERIAL3 -DTIMER_SERIAL=TIM5 -build_unflags = ${stm32_variant.build_unflags} + -D_STM32_PLATDEFS=MARLIN_F103Zx +build_unflags = ${stm32_variant_latest.build_unflags} -DUSBCON -DUSBD_USE_CDC # @@ -412,16 +419,16 @@ build_unflags = ${stm32_variant.build_unflags} # Builds for Trigorilla to update from SD # [env:trigorilla_pro_disk] -extends = stm32_variant +extends = stm32_variant_latest board = genericSTM32F103ZE board_build.crypt_chitu = update.zw -board_build.variant = MARLIN_F103Zx board_build.offset = 0x8800 -build_flags = ${stm32_variant.build_flags} +build_flags = ${stm32_variant_latest.build_flags} -DENABLE_HWSERIAL3 -DTIMER_SERIAL=TIM5 -build_unflags = ${stm32_variant.build_unflags} + -D_STM32_PLATDEFS=MARLIN_F103Zx +build_unflags = ${stm32_variant_latest.build_unflags} -DUSBCON -DUSBD_USE_CDC -extra_scripts = ${stm32_variant.extra_scripts} +extra_scripts = ${stm32_variant_latest.extra_scripts} buildroot/share/PlatformIO/scripts/chitu_crypt.py @@ -429,15 +436,15 @@ extra_scripts = ${stm32_variant.extra_scripts} # Chitu boards like Tronxy X5s (STM32F103ZET6) # [env:chitu_f103] -extends = stm32_variant +extends = stm32_variant_latest board = genericSTM32F103ZE board_build.crypt_chitu = update.cbd -board_build.variant = MARLIN_F103Zx board_build.offset = 0x8800 -build_flags = ${stm32_variant.build_flags} +build_flags = ${stm32_variant_latest.build_flags} -DSTM32F1xx -build_unflags = ${stm32_variant.build_unflags} -extra_scripts = ${stm32_variant.extra_scripts} + -D_STM32_PLATDEFS=MARLIN_F103Zx +build_unflags = ${stm32_variant_latest.build_unflags} +extra_scripts = ${stm32_variant_latest.extra_scripts} buildroot/share/PlatformIO/scripts/chitu_crypt.py # @@ -456,53 +463,59 @@ build_flags = ${env:chitu_f103.build_flags} -DCHITU_V5_Z_MIN_BUGFIX # STM32F103VE_ZM3E4V2_USB ......... VET6 with 512K # [ZONESTAR_ZM3E] -extends = stm32_variant +extends = stm32_variant_latest platform_packages = ${stm_flash_drive.platform_packages} board_upload.offset_address = 0x08005000 board_build.offset = 0x5000 board_upload.maximum_size = 237568 -extra_scripts = ${stm32_variant.extra_scripts} -build_flags = ${stm32_variant.build_flags} - -DSS_TIMER=4 -DTIMER_SERVO=TIM5 -DUSE_USB_FS -DUSBD_IRQ_PRIO=5 -DUSBD_IRQ_SUBPRIO=6 -DUSBD_USE_CDC_MSC -build_unflags = ${stm32_variant.build_unflags} -DUSBD_USE_CDC +extra_scripts = ${stm32_variant_latest.extra_scripts} +build_flags = ${stm32_variant_latest.build_flags} + -DSS_TIMER=4 -DTIMER_SERVO=TIM5 + -DUSE_USB_FS -DUSBD_IRQ_PRIO=5 -DUSBD_IRQ_SUBPRIO=6 + -DUSBD_USE_CDC_MSC +build_unflags = ${stm32_variant_latest.build_unflags} -DUSBD_USE_CDC [env:STM32F103RC_ZM3E2_USB] extends = ZONESTAR_ZM3E board = genericSTM32F103RC board_build.variant = MARLIN_F103Rx +build_flags = ${ZONESTAR_ZM3E.build_flags} + -D_STM32_PLATDEFS=MARLIN_F103Rx [env:STM32F103VC_ZM3E4_USB] extends = ZONESTAR_ZM3E board = genericSTM32F103VC board_build.variant = MARLIN_F103Vx build_flags = ${ZONESTAR_ZM3E.build_flags} -DTIMER_TONE=TIM1 + -D_STM32_PLATDEFS=MARLIN_F103Vx [env:STM32F103VE_ZM3E4V2_USB] extends = ZONESTAR_ZM3E board = genericSTM32F103VE board_build.variant = MARLIN_F103Vx build_flags = ${ZONESTAR_ZM3E.build_flags} -DTIMER_TONE=TIM1 + -D_STM32_PLATDEFS=MARLIN_F103Vx board_upload.maximum_size = 499712 # # Mingda D2 DZ301 V1.0 (STM32F103ZE) # [env:mingda_d301] -extends = stm32_variant +extends = stm32_variant_latest board = genericSTM32F103ZE board_build.variant = MARLIN_F103Zx board_build.offset = 0x7000 board_upload.offset_address = 0x08007000 -build_flags = ${stm32_variant.build_flags} -DSTM32F1xx +build_flags = ${stm32_variant_latest.build_flags} -DSTM32F1xx # # ORCA 3D SPRINGER Modular Controller (STM32F103VCT6) # [env:STM32F103VC_orca3d] -extends = stm32_variant +extends = stm32_variant_latest board = genericSTM32F103VC board_build.variant = MARLIN_F103Vx -build_flags = ${stm32_variant.build_flags} -DDEBUG_LEVEL=0 +build_flags = ${stm32_variant_latest.build_flags} -DDEBUG_LEVEL=0 monitor_speed = 115200 board_build.offset = 0x8000 board_upload.offset_address = 0x08008000 diff --git a/ini/stm32f4.ini b/ini/stm32f4.ini index 7fdbc6980477..ad3271d8bdc0 100644 --- a/ini/stm32f4.ini +++ b/ini/stm32f4.ini @@ -23,30 +23,30 @@ # ARMED (STM32) # [env:ARMED] -extends = common_stm32 +extends = common_stm32_latest board = armed_v1 -build_flags = ${common_stm32.build_flags} +build_flags = ${common_stm32_latest.build_flags} -O2 -ffreestanding -fsigned-char -fno-move-loop-invariants -fno-strict-aliasing # # STM32F401RC # [env:FYSETC_CHEETAH_V20] -extends = stm32_variant +extends = stm32_variant_latest platform_packages = platformio/tool-dfuutil@~1.11.0 board = marlin_FYSETC_CHEETAH_V20 board_build.offset = 0x8000 -build_flags = ${stm32_variant.build_flags} -DSTM32F401xC +build_flags = ${stm32_variant_latest.build_flags} -DSTM32F401xC upload_command = dfu-util -a 0 -s 0x08008000:leave -D "$SOURCE" # # STM32F446RC nobootloader # [env:FYSETC_CHEETAH_V30] -extends = stm32_variant +extends = stm32_variant_latest platform_packages = platformio/tool-dfuutil@~1.11.0 board = marlin_FYSETC_CHEETAH_V30 -build_flags = ${stm32_variant.build_flags} -DHAL_PCD_MODULE_ENABLED +build_flags = ${stm32_variant_latest.build_flags} -DHAL_PCD_MODULE_ENABLED debug_tool = stlink upload_protocol = dfu upload_command = dfu-util -a 0 -s 0x08000000:leave -D "$SOURCE" @@ -55,23 +55,25 @@ upload_command = dfu-util -a 0 -s 0x08000000:leave -D "$SOURCE" # FLYF407ZG # [env:FLYF407ZG] -extends = stm32_variant +extends = stm32_variant_latest platform_packages = platformio/tool-dfuutil@~1.11.0 board = marlin_STM32F407ZGT6 board_build.variant = MARLIN_FLY_F407ZG board_build.offset = 0x8000 +build_flags = ${stm32_variant_latest.build_flags} + -D_STM32_PLATDEFS=MARLIN_FLY_F407ZG upload_protocol = dfu # # FYSETC S6 (STM32F446RET6 ARM Cortex-M4) # [env:FYSETC_S6] -extends = stm32_variant +extends = stm32_variant_latest platform_packages = platformio/tool-dfuutil@~1.11.0 board = marlin_fysetc_s6 board_build.offset = 0x10000 board_upload.offset_address = 0x08010000 -build_flags = ${stm32_variant.build_flags} -DHAL_PCD_MODULE_ENABLED +build_flags = ${stm32_variant_latest.build_flags} -DHAL_PCD_MODULE_ENABLED debug_tool = stlink upload_protocol = dfu upload_command = dfu-util -a 0 -s 0x08010000:leave -D "$SOURCE" @@ -90,11 +92,13 @@ upload_command = dfu-util -a 0 -s 0x08008000:leave -D "$SOURCE" # FYSETC SPIDER KING407 (STM32F407ZGT6 ARM Cortex-M4) # [env:FYSETC_SPIDER_KING407] -extends = stm32_variant +extends = stm32_variant_latest platform_packages = platformio/tool-dfuutil@~1.11.0 board = marlin_STM32F407ZGT6 board_build.variant = MARLIN_FYSETC_SPIDER_KING407 board_build.offset = 0x8000 +build_flags = ${stm32_variant_latest.build_flags} + -D_STM32_PLATDEFS=MARLIN_FYSETC_SPIDER_KING407 upload_protocol = dfu # @@ -103,43 +107,44 @@ upload_protocol = dfu # Shield - https://github.com/jmz52/Hardware # [env:STM32F407VE_black] -extends = stm32_variant +extends = stm32_variant_latest board = marlin_blackSTM32F407VET6 -build_flags = ${stm32_variant.build_flags} +build_flags = ${stm32_variant_latest.build_flags} -DUSBD_USE_CDC_COMPOSITE -DUSE_USB_FS # # STM32F407VET6 Opulo Lumen REV3 # [env:Opulo_Lumen_REV3] -extends = stm32_variant +extends = stm32_variant_latest board = marlin_opulo_lumen_rev3 -build_flags = ${stm32_variant.build_flags} +build_flags = ${stm32_variant_latest.build_flags} -DARDUINO_BLACK_F407VE -DUSBD_USE_CDC_COMPOSITE -DUSE_USB_FS -DHAS_STM32_UID -extra_scripts = ${stm32_variant.extra_scripts} +extra_scripts = ${stm32_variant_latest.extra_scripts} # # STM32F407VET6 Opulo Lumen REV4 # [env:Opulo_Lumen_REV4] -extends = stm32_variant +extends = stm32_variant_latest board = marlin_opulo_lumen_rev4 -build_flags = ${stm32_variant.build_flags} +build_flags = ${stm32_variant_latest.build_flags} -DARDUINO_BLACK_F407VE -DUSBD_USE_CDC_COMPOSITE -DUSE_USB_FS -DHAS_STM32_UID -extra_scripts = ${stm32_variant.extra_scripts} +extra_scripts = ${stm32_variant_latest.extra_scripts} # # Anet ET4-MB_V1.x/ET4P-MB_V1.x (STM32F407VGT6 ARM Cortex-M4) # [Anet_ET4] -extends = stm32_variant +extends = stm32_variant_latest board = marlin_STM32F407VGT6_CCM board_build.variant = MARLIN_F4x7Vx -build_flags = ${stm32_variant.build_flags} +build_flags = ${stm32_variant_latest.build_flags} -DHAL_SD_MODULE_ENABLED -DHAL_SRAM_MODULE_ENABLED -build_unflags = ${stm32_variant.build_unflags} + -D_STM32_PLATDEFS=MARLIN_F4x7Vx +build_unflags = ${stm32_variant_latest.build_unflags} -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483 # @@ -165,10 +170,10 @@ extra_scripts = ${Anet_ET4.extra_scripts} # BigTreeTech SKR Pro (STM32F407ZGT6 ARM Cortex-M4) # [env:BTT_SKR_PRO] -extends = stm32_variant +extends = stm32_variant_latest board = marlin_BTT_SKR_Pro board_build.offset = 0x8000 -build_flags = ${stm32_variant.build_flags} -DSTM32F407_5ZX +build_flags = ${stm32_variant_latest.build_flags} -DSTM32F407_5ZX debug_tool = stlink upload_protocol = stlink @@ -185,14 +190,15 @@ build_unflags = ${env:BTT_SKR_PRO.build_unflags} -DUSBCON -DUSBD_USE_CDC # BigTreeTech E3 RRF (STM32F407VGT6 ARM Cortex-M4) # [env:BTT_E3_RRF] -extends = stm32_variant +extends = stm32_variant_latest board = marlin_STM32F407VGT6_CCM board_build.variant = MARLIN_BTT_E3_RRF board_build.offset = 0x8000 -build_flags = ${stm32_variant.build_flags} +build_flags = ${stm32_variant_latest.build_flags} -DSTM32F407_5VX -DMF_RX_BUFFER_SIZE=255 -DMF_TX_BUFFER_SIZE=255 + -D_STM32_PLATDEFS=MARLIN_BIGTREE_E3_RRF # # Mellow/Fly RRF E3 V1 (STM32F407VGT6 ARM Cortex-M4) @@ -211,10 +217,10 @@ build_flags = ${stm32_variant.build_flags} # Bigtreetech GTR V1.0 (STM32F407IGT6 ARM Cortex-M4) # [env:BTT_GTR_V1_0] -extends = stm32_variant +extends = stm32_variant_latest board = marlin_BTT_GTR_v1 board_build.offset = 0x8000 -build_flags = ${stm32_variant.build_flags} -DSTM32F407IX +build_flags = ${stm32_variant_latest.build_flags} -DSTM32F407IX # # Bigtreetech GTR V1.0 (STM32F407IGT6 ARM Cortex-M4) with USB Flash Drive Support @@ -229,10 +235,10 @@ build_unflags = ${env:BTT_GTR_V1_0.build_unflags} -DUSBCON -DUSBD_USE_CDC # BigTreeTech BTT002 V1.0 (STM32F407VGT6 ARM Cortex-M4) # [env:BTT_BTT002] -extends = stm32_variant +extends = stm32_variant_latest board = marlin_BTT_BTT002 board_build.offset = 0x8000 -build_flags = ${stm32_variant.build_flags} +build_flags = ${stm32_variant_latest.build_flags} -DSTM32F407_5VX -DHAVE_HWSERIAL2 -DHAVE_HWSERIAL3 @@ -250,7 +256,7 @@ board = marlin_BTT_BTT002_VET6 # BigTreeTech SKR V2.0 (STM32F407VGT6 ARM Cortex-M4) with USB Flash Drive Support # [env:STM32F407VG_btt] -extends = stm32_variant +extends = stm32_variant_latest platform_packages = ${stm_flash_drive.platform_packages} board = marlin_STM32F407VGT6_CCM board_build.variant = MARLIN_F4x7Vx @@ -261,6 +267,7 @@ build_flags = ${stm_flash_drive.build_flags} -DUSBD_IRQ_PRIO=5 -DUSBD_IRQ_SUBPRIO=6 -DHSE_VALUE=8000000U -DHAL_SD_MODULE_ENABLED -DPIN_SERIAL3_RX=PD_9 -DPIN_SERIAL3_TX=PD_8 + -D_STM32_PLATDEFS=MARLIN_F4x7Vx upload_protocol = stlink # @@ -300,13 +307,13 @@ build_unflags = ${env:STM32F429VG_btt_USB.build_unflags} -Os -NDEBUG # BigTreeTech Octopus V1.0/1.1 / Octopus Pro V1.0 (STM32F446ZET6 ARM Cortex-M4) # [env:STM32F446ZE_btt] -extends = stm32_variant +extends = stm32_variant_latest board = marlin_BTT_Octopus_v1 board_build.offset = 0x8000 board_upload.offset_address = 0x08008000 debug_tool = stlink upload_protocol = stlink -build_flags = ${stm32_variant.build_flags} +build_flags = ${stm32_variant_latest.build_flags} -DSTM32F446_5VX -DUSE_USB_HS_IN_FS # @@ -326,13 +333,13 @@ build_flags = ${stm_flash_drive.build_flags} # BigTreeTech Octopus V1.1 / Octopus Pro V1.0 (STM32F429ZGT6 ARM Cortex-M4) # [env:STM32F429ZG_btt] -extends = stm32_variant +extends = stm32_variant_latest board = marlin_BTT_Octopus_Pro_v1_F429 board_build.offset = 0x8000 board_upload.offset_address = 0x08008000 debug_tool = stlink upload_protocol = stlink -build_flags = ${stm32_variant.build_flags} +build_flags = ${stm32_variant_latest.build_flags} -DUSE_USB_HS_IN_FS # @@ -351,10 +358,10 @@ build_flags = ${stm_flash_drive.build_flags} # BigTreeTech Octopus / Octopus Pro (STM32F407ZET6 ARM Cortex-M4) # [env:STM32F407ZE_btt] -extends = stm32_variant +extends = stm32_variant_latest board = marlin_STM32F407ZE board_build.offset = 0x8000 -build_flags = ${stm32_variant.build_flags} +build_flags = ${stm32_variant_latest.build_flags} -DUSE_USB_HS_IN_FS # @@ -373,16 +380,17 @@ build_flags = ${stm_flash_drive.build_flags} # Lerdge base # [lerdge_common] -extends = stm32_variant +extends = stm32_variant_latest board = marlin_STM32F407ZGT6 board_build.variant = MARLIN_LERDGE board_build.crypt_lerdge = firmware.bin board_build.offset = 0x10000 -build_flags = ${stm32_variant.build_flags} +build_flags = ${stm32_variant_latest.build_flags} -DSTM32F4 -DSTM32F4xx -DTARGET_STM32F4 -DDISABLE_GENERIC_SERIALUSB -DARDUINO_ARCH_STM32 -DLERDGE_TFT35 -build_unflags = ${stm32_variant.build_unflags} -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483 -extra_scripts = ${stm32_variant.extra_scripts} + -D_STM32_PLATDEFS=MARLIN_LERDGE +build_unflags = ${stm32_variant_latest.build_unflags} -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483 +extra_scripts = ${stm32_variant_latest.extra_scripts} buildroot/share/PlatformIO/scripts/lerdge.py # @@ -435,16 +443,17 @@ build_flags = ${stm_flash_drive.build_flags} ${lerdge_common.build_flags} # RUMBA32 # [env:rumba32] -extends = stm32_variant +extends = stm32_variant_latest platform_packages = platformio/tool-dfuutil@~1.11.0 board = rumba32_f446ve board_build.variant = MARLIN_F446VE board_build.offset = 0x0000 -build_flags = ${stm32_variant.build_flags} +build_flags = ${stm32_variant_latest.build_flags} -Os -DHAL_PCD_MODULE_ENABLED -DDISABLE_GENERIC_SERIALUSB -DHAL_UART_MODULE_ENABLED -DTIMER_SERIAL=TIM9 + -D_STM32_PLATDEFS=MARLIN_F446VE monitor_speed = 500000 upload_protocol = dfu @@ -452,12 +461,12 @@ upload_protocol = dfu # STM32F407ZET6 ARM Cortex-M4 # [env:mks_robin2] -extends = stm32_variant +extends = stm32_variant_latest board = marlin_MKS_ROBIN2 board_build.offset = 0xC000 board_upload.offset_address = 0x0800C000 board_build.encrypt_mks = Robin2.bin -build_flags = ${stm32_variant.build_flags} +build_flags = ${stm32_variant_latest.build_flags} -DTARGET_STM32F4 -DSTM32F407_5ZX -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483 -DUSBD_PID=0x3748 -DUSB_PRODUCT=\"MKS_Robin2\" @@ -465,14 +474,15 @@ build_flags = ${stm32_variant.build_flags} # MKS Robin Pro V2 (No bootloader!) # [env:mks_robin_pro2] -extends = stm32_variant +extends = stm32_variant_latest platform_packages = ${stm_flash_drive.platform_packages} board = genericSTM32F407VET6 board_build.variant = MARLIN_F4x7Vx board_build.offset = 0x0000 board_upload.offset_address = 0x08000000 build_flags = ${stm_flash_drive.build_flags} -build_unflags = ${stm32_variant.build_unflags} -DUSBCON -DUSBD_USE_CDC + -D_STM32_PLATDEFS=MARLIN_F4x7Vx +build_unflags = ${stm32_variant_latest.build_unflags} -DUSBCON -DUSBD_USE_CDC debug_tool = jlink upload_protocol = jlink @@ -486,14 +496,15 @@ build_flags = -DPIN_WIRE_SCL=PB6 -DPIN_WIRE_SDA=PB7 # MKS Robin Nano V3 # [env:mks_robin_nano_v3] -extends = stm32_variant +extends = stm32_variant_latest board = marlin_STM32F407VGT6_CCM board_build.variant = MARLIN_F4x7Vx board_build.offset = 0xC000 board_upload.offset_address = 0x0800C000 board_build.rename = Robin_nano_v3.bin -build_flags = ${stm32_variant.build_flags} ${stm32f4_I2C1.build_flags} +build_flags = ${stm32_variant_latest.build_flags} ${stm32f4_I2C1.build_flags} -DHAL_PCD_MODULE_ENABLED + -D_STM32_PLATDEFS=MARLIN_F4x7Vx debug_tool = jlink upload_protocol = jlink @@ -545,15 +556,16 @@ board = marlin_STM32F407VET6_CCM # 5 TMC2209 uart mode on board # [env:mks_eagle] -extends = stm32_variant +extends = stm32_variant_latest board = marlin_STM32F407VGT6_CCM board_build.variant = MARLIN_F4x7Vx board_build.offset = 0xC000 board_upload.offset_address = 0x0800C000 board_build.rename = mks_eagle.bin -build_flags = ${stm32_variant.build_flags} ${stm32f4_I2C1.build_flags} +build_flags = ${stm32_variant_latest.build_flags} ${stm32f4_I2C1.build_flags} -DHAL_PCD_MODULE_ENABLED -DSTM32_FLASH_SIZE=512 + -D_STM32_PLATDEFS=MARLIN_F4x7Vx debug_tool = jlink upload_protocol = jlink @@ -588,15 +600,16 @@ build_flags = -DPIN_WIRE_SCL=PB8 -DPIN_WIRE_SDA=PB9 # MKS Monster8 V1 / V2 (STM32F407VET6 ARM Cortex-M4) # [env:mks_monster8] -extends = stm32_variant +extends = stm32_variant_latest board = marlin_STM32F407VGT6_CCM board_build.variant = MARLIN_F4x7Vx board_build.offset = 0xC000 board_upload.offset_address = 0x0800C000 board_build.rename = mks_monster8.bin -build_flags = ${stm32_variant.build_flags} ${stm32f4_I2C1_CAN.build_flags} +build_flags = ${stm32_variant_latest.build_flags} ${stm32f4_I2C1_CAN.build_flags} -DHAL_PCD_MODULE_ENABLED -DTIMER_SERIAL=TIM4 -DSTM32_FLASH_SIZE=512 + -D_STM32_PLATDEFS=MARLIN_F4x7Vx debug_tool = jlink upload_protocol = jlink @@ -625,10 +638,11 @@ build_unflags = -DUSBD_USE_CDC # TH3D EZBoard v2.0 (STM32F405RGT6 ARM Cortex-M4) # [TH3D_EZBoard_V2] -extends = stm32_variant +extends = stm32_variant_latest board = genericSTM32F405RG board_build.variant = MARLIN_TH3D_EZBOARD_V2 -build_flags = ${stm32_variant.build_flags} -DHSE_VALUE=12000000U -O0 +build_flags = ${stm32_variant_latest.build_flags} -DHSE_VALUE=12000000U -O0 + -D_STM32_PLATDEFS=MARLIN_TH3D_EZBOARD_V2 # # TH3D EZBoard v2.0 directly flashed via ST-Link @@ -650,12 +664,14 @@ extra_scripts = ${TH3D_EZBoard_V2.extra_scripts} buildroot/share/PlatformIO/scripts/openblt.py [mks_robin_nano_v1_3_f4_common] -extends = stm32_variant +extends = stm32_variant_latest board = marlin_STM32F407VGT6_CCM board_build.variant = MARLIN_F4x7Vx board_build.offset = 0x8000 board_upload.offset_address = 0x08008000 board_build.rename = Robin_nano35.bin +build_flags = ${stm32_variant_latest.build_flags} + -D_STM32_PLATDEFS=MARLIN_F4x7Vx debug_tool = jlink upload_protocol = jlink @@ -688,27 +704,28 @@ build_flags = ${mks_robin_nano_v1_3_f4_common.build_flags} # Artillery Ruby # [env:Artillery_Ruby] -extends = common_stm32 +extends = common_stm32_latest board = marlin_Artillery_Ruby -build_flags = ${common_stm32.build_flags} +build_flags = ${common_stm32_latest.build_flags} -DSTM32F401xC -DTARGET_STM32F4 -DDISABLE_GENERIC_SERIALUSB -DARDUINO_ARCH_STM32 -DUSBD_USE_CDC_COMPOSITE -DUSE_USB_FS -DUSB_PRODUCT=\"Artillery_3D_Printer\" -DFLASH_DATA_SECTOR=1U -DFLASH_BASE_ADDRESS=0x08004000 -extra_scripts = ${common_stm32.extra_scripts} +extra_scripts = ${common_stm32_latest.extra_scripts} pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py # # Ender-3 S1 STM32F401RC_creality # [STM32F401RC_creality_base] -extends = stm32_variant +extends = stm32_variant_latest board = genericSTM32F401RC board_build.variant = MARLIN_F401RC_CREALITY -build_flags = ${stm32_variant.build_flags} -DMCU_STM32F401RC -DSTM32F4 +build_flags = ${stm32_variant_latest.build_flags} -DMCU_STM32F401RC -DSTM32F4 -DSS_TIMER=4 -DTIMER_SERVO=TIM5 -DENABLE_HWSERIAL3 -DTRANSFER_CLOCK_DIV=8 -build_unflags = ${stm32_variant.build_unflags} -DUSBCON -DUSBD_USE_CDC + -D_STM32_PLATDEFS=MARLIN_F401RC_CREALITY +build_unflags = ${stm32_variant_latest.build_unflags} -DUSBCON -DUSBD_USE_CDC monitor_speed = 115200 [env:STM32F401RC_creality] @@ -738,13 +755,13 @@ upload_protocol = stlink # Ender-5 S1 STM32F401RE_creality (CR4NS200141C13 with STM32F401RET6) # [env:STM32F401RE_creality] -extends = stm32_variant +extends = stm32_variant_latest board = marlin_STM32F401RE_creality board_build.offset = 0x10000 board_upload.offset_address = 0x08010000 board_build.rename = firmware-{date}-{time}.bin -build_flags = ${stm32_variant.build_flags} -DSTM32F401xE -DSTM32F4 -DSTM32F4_UPDATE_FOLDER -build_unflags = ${stm32_variant.build_unflags} -DUSBCON -DUSBD_USE_CDC +build_flags = ${stm32_variant_latest.build_flags} -DSTM32F401xE -DSTM32F4 -DSTM32F4_UPDATE_FOLDER +build_unflags = ${stm32_variant_latest.build_unflags} -DUSBCON -DUSBD_USE_CDC monitor_speed = 115200 [env:STM32F401RE_creality_jlink] @@ -761,15 +778,15 @@ upload_protocol = stlink # STM32F401RE_freeruns Creality E3 Free-runs Silent Motherboard # [env:STM32F401RE_freeruns] -extends = stm32_variant +extends = stm32_variant_latest board = marlin_STM32F401RE_freeruns board_build.offset = 0x10000 board_upload.offset_address = 0x08010000 board_build.rename = firmware-{date}-{time}.bin -build_flags = ${stm32_variant.build_flags} -DSTM32F401xE +build_flags = ${stm32_variant_latest.build_flags} -DSTM32F401xE -DSS_TIMER=4 -DTIMER_SERVO=TIM5 -DTRANSFER_CLOCK_DIV=8 -build_unflags = ${stm32_variant.build_unflags} -DUSBCON -DUSBD_USE_CDC +build_unflags = ${stm32_variant_latest.build_unflags} -DUSBCON -DUSBD_USE_CDC monitor_speed = 115200 [env:STM32F401RE_freeruns_jlink] @@ -786,14 +803,14 @@ upload_protocol = stlink # BigTree SKR mini E3 V3.0.1 (STM32F401RCT6 ARM Cortex-M4) # [env:STM32F401RC_btt] -extends = stm32_variant +extends = stm32_variant_latest platform = ststm32@~14.1.0 platform_packages = framework-arduinoststm32@~4.20600.231001 toolchain-gccarmnoneeabi@1.100301.220327 board = marlin_STM32F401RC board_build.offset = 0x4000 board_upload.offset_address = 0x08004000 -build_flags = ${stm32_variant.build_flags} +build_flags = ${stm32_variant_latest.build_flags} -DPIN_SERIAL6_RX=PC_7 -DPIN_SERIAL6_TX=PC_6 -DSERIAL_RX_BUFFER_SIZE=1024 -DSERIAL_TX_BUFFER_SIZE=1024 -DTIMER_SERVO=TIM3 -DTIMER_TONE=TIM4 @@ -819,7 +836,7 @@ upload_protocol = custom # MKS SKIPR v1.0 all-in-one board (STM32F407VE) # [env:mks_skipr_v1] -extends = stm32_variant +extends = stm32_variant_latest board = marlin_MKS_SKIPR_V1 board_build.rename = mks_skipr.bin @@ -836,17 +853,17 @@ upload_command = dfu-util -a 0 -s 0x08000000:leave -D "$SOURCE" # TRONXY_CXY_446_V10 (STM32F446ZET6 ARM Cortex-M4) # [env:TRONXY_CXY_446_V10] -extends = stm32_variant +extends = stm32_variant_latest board = marlin_STM32F446ZET_tronxy board_build.ldscript = buildroot/share/PlatformIO/variants/MARLIN_F446Zx_TRONXY/ldscript.ld board_build.offset = 0x10000 -build_flags = ${stm32_variant.build_flags} +build_flags = ${stm32_variant_latest.build_flags} -DSTM32F4xx -DUSE_USB_HS -DUSE_USB_HS_IN_FS -build_unflags = ${stm32_variant.build_unflags} -fno-rtti +build_unflags = ${stm32_variant_latest.build_unflags} -fno-rtti -fno-threadsafe-statics -fno-exceptions -DUSBD_USE_CDC -DUSBCON -extra_scripts = ${stm32_variant.extra_scripts} +extra_scripts = ${stm32_variant_latest.extra_scripts} buildroot/share/PlatformIO/scripts/tronxy_cxy_446_v10.py # @@ -860,8 +877,8 @@ platform_packages = ${stm_flash_drive.platform_packages} # Blackpill # [env:STM32F401CD_blackpill_stlink] -platform = ${common_stm32.platform} -extends = common_stm32 +platform = ${common_stm32_latest.platform} +extends = common_stm32_latest board = blackpill_f401cc upload_protocol = stlink monitor_speed = 115200 @@ -870,10 +887,10 @@ monitor_speed = 115200 # I3Dbeez9 (STM32F407ZGT6 ARM Cortex-M4) # [env:I3DBEEZ9_V1] -extends = stm32_variant +extends = stm32_variant_latest board = marlin_I3DBEEZ9 board_build.offset = 0x8000 -build_flags = ${stm32_variant.build_flags} -DSTM32F407_5ZX +build_flags = ${stm32_variant_latest.build_flags} -DSTM32F407_5ZX debug_tool = stlink upload_protocol = stlink @@ -883,10 +900,10 @@ upload_protocol = stlink [env:BLACKBEEZMINI_V1] platform = ststm32 platform_packages = platformio/tool-dfuutil@~1.11.0 -extends = common_stm32 +extends = common_stm32_latest board = blackpill_f401cc board_build.offset = 0x0000 -build_flags = ${common_stm32.build_flags} +build_flags = ${common_stm32_latest.build_flags} -Os -DHAL_PCD_MODULE_ENABLED -DHAL_UART_MODULE_ENABLED monitor_speed = 250000 @@ -896,12 +913,12 @@ upload_protocol = dfu # Mellow Fly E3 V2 (STM32F407VGT6 ARM Cortex-M4) # [env:FLY_E3_V2] -extends = stm32_variant +extends = stm32_variant_latest board = marlin_STM32F407VGT6_CCM board_build.variant = MARLIN_F4x7Vx board_build.offset = 0x8000 board_upload.offset_address = 0x08008000 -build_flags = ${stm32_variant.build_flags} +build_flags = ${stm32_variant_latest.build_flags} -DHAVE_HWSERIAL1 -DHAVE_HWSERIAL3 -DPIN_SERIAL1_RX=PA_10 -DPIN_SERIAL1_TX=PA_9 -DPIN_SERIAL3_RX=PD_9 -DPIN_SERIAL3_TX=PD_8 @@ -915,7 +932,7 @@ upload_protocol = stlink # XTLW3D Climber-8th-F4 (STM32F407VGT6 ARM Cortex-M4) # [env:XTLW_CLIMBER_8TH] -extends = stm32_variant +extends = stm32_variant_latest platform_packages = ${stm_flash_drive.platform_packages} board = marlin_STM32F407VGT6_CCM board_build.variant = MARLIN_F4x7Vx diff --git a/ini/stm32f7.ini b/ini/stm32f7.ini index 62755c846d47..32c71f9b5b78 100644 --- a/ini/stm32f7.ini +++ b/ini/stm32f7.ini @@ -25,13 +25,13 @@ # being readily available based on STM32F7 MCUs # [env:NUCLEO_F767ZI] -extends = common_stm32 +extends = common_stm32_latest board = nucleo_f767zi -build_flags = ${common_stm32.build_flags} -DTIMER_SERIAL=TIM9 +build_flags = ${common_stm32_latest.build_flags} -DTIMER_SERIAL=TIM9 # # REMRAM_V1 # [env:REMRAM_V1] -extends = common_stm32 +extends = common_stm32_latest board = remram_v1 From 504fad7c82daf506de303c988514c715081393e9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 30 Nov 2024 21:09:01 -0600 Subject: [PATCH 2/4] need variant? --- ini/stm32f1.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/ini/stm32f1.ini b/ini/stm32f1.ini index 41a655d233fa..2862cb7de0ea 100644 --- a/ini/stm32f1.ini +++ b/ini/stm32f1.ini @@ -200,7 +200,6 @@ board = genericSTM32F103RC [env:STM32F103VE_creality] extends = STM32F103Rx_creality board = genericSTM32F103VE -board_build.variant = MARLIN_F103Vx build_flags = ${STM32F103Rx_creality.build_flags} -DSS_TIMER=4 -DTIMER_SERVO=TIM5 -DENABLE_HWSERIAL3 -DTRANSFER_CLOCK_DIV=8 From 8952aedbbe6dbfa35742764fdf85524fd98c4c00 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 15 Mar 2025 18:15:46 -0500 Subject: [PATCH 3/4] post merge cleanup --- Marlin/src/core/macros.h | 29 +-- .../MARLIN_F446VE_FYSETC/variant_generic.cpp | 201 ++++++++++++++++++ .../MARLIN_F446VE_FYSETC/variant_generic.h | 184 ++++++++++++++++ .../{variant.cpp => variant_generic.cpp} | 0 .../{variant.h => variant_generic.h} | 0 ...p => variant_MARLIN_STM32F407VGT6_CCM.cpp} | 0 ...t.h => variant_MARLIN_STM32F407VGT6_CCM.h} | 0 ini/features.ini | 3 +- ini/stm32-common.ini | 3 +- ini/stm32f4.ini | 42 ++-- 10 files changed, 426 insertions(+), 36 deletions(-) create mode 100644 buildroot/share/PlatformIO/variants/MARLIN_F446VE_FYSETC/variant_generic.cpp create mode 100644 buildroot/share/PlatformIO/variants/MARLIN_F446VE_FYSETC/variant_generic.h rename buildroot/share/PlatformIO/variants/MARLIN_F446Zx_TRONXY/{variant.cpp => variant_generic.cpp} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_F446Zx_TRONXY/{variant.h => variant_generic.h} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_FLY_CDY_V3/{variant.cpp => variant_MARLIN_STM32F407VGT6_CCM.cpp} (100%) rename buildroot/share/PlatformIO/variants/MARLIN_FLY_CDY_V3/{variant.h => variant_MARLIN_STM32F407VGT6_CCM.h} (100%) diff --git a/Marlin/src/core/macros.h b/Marlin/src/core/macros.h index 3147c4fd17ef..21d9929bc5fe 100644 --- a/Marlin/src/core/macros.h +++ b/Marlin/src/core/macros.h @@ -383,21 +383,26 @@ #ifdef __cplusplus - extern "C++" { + #ifndef _MINMAX_H_ + #define _MINMAX_H_ + + extern "C++" { + + // C++11 solution that is standards compliant. Return type is deduced automatically + template static constexpr N _MIN(const N val) { return val; } + template static constexpr N _MAX(const N val) { return val; } + template static constexpr auto _MIN(const L lhs, const R rhs) -> decltype(lhs + rhs) { + return lhs < rhs ? lhs : rhs; + } + template static constexpr auto _MAX(const L lhs, const R rhs) -> decltype(lhs + rhs) { + return lhs > rhs ? lhs : rhs; + } + template static constexpr const T _MIN(T V, Ts... Vs) { return _MIN(V, _MIN(Vs...)); } + template static constexpr const T _MAX(T V, Ts... Vs) { return _MAX(V, _MAX(Vs...)); } - // C++11 solution that is standards compliant. Return type is deduced automatically - template static constexpr N _MIN(const N val) { return val; } - template static constexpr N _MAX(const N val) { return val; } - template static constexpr auto _MIN(const L lhs, const R rhs) -> decltype(lhs + rhs) { - return lhs < rhs ? lhs : rhs; } - template static constexpr auto _MAX(const L lhs, const R rhs) -> decltype(lhs + rhs) { - return lhs > rhs ? lhs : rhs; - } - template static constexpr const T _MIN(T V, Ts... Vs) { return _MIN(V, _MIN(Vs...)); } - template static constexpr const T _MAX(T V, Ts... Vs) { return _MAX(V, _MAX(Vs...)); } - } + #endif // Allow manipulating enumeration value like flags without ugly cast everywhere #define ENUM_FLAGS(T) \ diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F446VE_FYSETC/variant_generic.cpp b/buildroot/share/PlatformIO/variants/MARLIN_F446VE_FYSETC/variant_generic.cpp new file mode 100644 index 000000000000..7e3df41f1bf0 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MARLIN_F446VE_FYSETC/variant_generic.cpp @@ -0,0 +1,201 @@ +/* + Copyright (c) 2011 Arduino. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "pins_arduino.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// Pin number +const PinName digitalPin[] = { + PA_0, //D0 + PA_1, //D1 + PA_2, //D2 + PA_3, //D3 + PA_4, //D4 + PA_5, //D5 + PA_6, //D6 + PA_7, //D7 + PA_8, //D8 + PA_9, //D9 + PA_10, //D10 + PA_11, //D11 + PA_12, //D12 + PA_13, //D13 + PA_14, //D14 + PA_15, //D15 + PB_0, //D16 + PB_1, //D17 + PB_2, //D18 + PB_3, //D19 + PB_4, //D20 + PB_5, //D21 + PB_6, //D22 + PB_7, //D23 + PB_8, //D24 + PB_9, //D25 + PB_10, //D26 + PB_11, //D27 + PB_12, //D28 + PB_13, //D29 + PB_14, //D30 + PB_15, //D31 + PC_0, //D32 + PC_1, //D33 + PC_2, //D34 + PC_3, //D35 + PC_4, //D36 + PC_5, //D37 + PC_6, //D38 + PC_7, //D39 + PC_8, //D40 + PC_9, //D41 + PC_10, //D42 + PC_11, //D43 + PC_12, //D44 + PC_13, //D45 + PC_14, //D46 + PC_15, //D47 + PD_0, //D48 + PD_1, //D49 + PD_2, //D50 + PD_3, //D51 + PD_4, //D52 + PD_5, //D53 + PD_6, //D54 + PD_7, //D55 + PD_8, //D56 + PD_9, //D57 + PD_10, //D58 + PD_11, //D59 + PD_12, //D60 + PD_13, //D61 + PD_14, //D62 + PD_15, //D63 + PE_0, //D64 + PE_1, //D65 + PE_2, //D66 + PE_3, //D67 + PE_4, //D68 + PE_5, //D69 + PE_6, //D70 + PE_7, //D71 + PE_8, //D72 + PE_9, //D73 + PE_10, //D74 + PE_11, //D75 + PE_12, //D76 + PE_13, //D77 + PE_14, //D78 + PE_15, //D79 + + //Duplicated ADC Pins + PA_3, //D80/A0 + PA_4, //D81/A1 + PC_0, //D82/A2 + PC_1, //D83/A3 + PC_2, //D84/A4 + PC_3, //D85/A5 + PC_4 //D86/A6 +}; + +#ifdef __cplusplus +} +#endif + +// ---------------------------------------------------------------------------- + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief System Clock Configuration + * The system Clock is configured as follow : + * System Clock source = PLL (HSE) + * SYSCLK(Hz) = 180000000 + * HCLK(Hz) = 180000000 + * AHB Prescaler = 1 + * APB1 Prescaler = 4 + * APB2 Prescaler = 2 + * HSE Frequency(Hz) = 12000000 + * PLL_M = 6 + * PLL_N = 180 + * PLL_P = 2 + * PLL_Q = 7 + * VDD(V) = 3.3 + * Main regulator output voltage = Scale1 mode + * Flash Latency(WS) = 5 + * @param None + * @retval None + */ +WEAK void SystemClock_Config(void) +{ + RCC_ClkInitTypeDef RCC_ClkInitStruct; + RCC_OscInitTypeDef RCC_OscInitStruct; + RCC_PeriphCLKInitTypeDef PeriphClkInitStruct; + + + /* Enable Power Control clock */ + __HAL_RCC_PWR_CLK_ENABLE(); + +#ifdef HAL_PWR_MODULE_ENABLED + /* The voltage scaling allows optimizing the power consumption when the device is + clocked below the maximum system frequency, to update the voltage scaling value + regarding system frequency refer to product datasheet. */ + __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); +#endif + + /* Enable HSE Oscillator and activate PLL with HSE as source */ + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + RCC_OscInitStruct.HSEState = RCC_HSE_ON; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; + RCC_OscInitStruct.PLL.PLLM = 6; + RCC_OscInitStruct.PLL.PLLN = 180; + RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; + RCC_OscInitStruct.PLL.PLLQ = 7; + RCC_OscInitStruct.PLL.PLLR = 2; + HAL_RCC_OscConfig(&RCC_OscInitStruct); + + HAL_PWREx_EnableOverDrive(); + + /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 + clocks dividers */ + RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | + RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLRCLK; + RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; + HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5); + + PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_CLK48; + PeriphClkInitStruct.PLLSAI.PLLSAIM = 6; + PeriphClkInitStruct.PLLSAI.PLLSAIN = 96; + PeriphClkInitStruct.PLLSAI.PLLSAIQ = 2; + PeriphClkInitStruct.PLLSAI.PLLSAIP = RCC_PLLSAIP_DIV4; + PeriphClkInitStruct.PLLSAIDivQ = 1; + PeriphClkInitStruct.Clk48ClockSelection = RCC_CLK48CLKSOURCE_PLLSAIP; + HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); +} + +#ifdef __cplusplus +} +#endif diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F446VE_FYSETC/variant_generic.h b/buildroot/share/PlatformIO/variants/MARLIN_F446VE_FYSETC/variant_generic.h new file mode 100644 index 000000000000..f64bbacc4566 --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MARLIN_F446VE_FYSETC/variant_generic.h @@ -0,0 +1,184 @@ +/* + Copyright (c) 2011 Arduino. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _VARIANT_ARDUINO_STM32_ +#define _VARIANT_ARDUINO_STM32_ + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +/*---------------------------------------------------------------------------- + * Pins + *----------------------------------------------------------------------------*/ + +#define PA0 0 +#define PA1 1 +#define PA2 2 +#define PA3 3 +#define PA4 4 +#define PA5 5 +#define PA6 6 +#define PA7 7 +#define PA8 8 +#define PA9 9 +#define PA10 10 +#define PA11 11 +#define PA12 12 +#define PA13 13 +#define PA14 14 +#define PA15 15 +#define PB0 16 +#define PB1 17 +#define PB2 18 +#define PB3 19 +#define PB4 20 +#define PB5 21 +#define PB6 22 +#define PB7 23 +#define PB8 24 +#define PB9 25 +#define PB10 26 +#define PB11 27 +#define PB12 28 +#define PB13 29 +#define PB14 30 +#define PB15 31 +#define PC0 32 +#define PC1 33 +#define PC2 34 +#define PC3 35 +#define PC4 36 +#define PC5 37 +#define PC6 38 +#define PC7 39 +#define PC8 40 +#define PC9 41 +#define PC10 42 +#define PC11 43 +#define PC12 44 +#define PC13 45 +#define PC14 46 +#define PC15 47 +#define PD0 48 +#define PD1 49 +#define PD2 50 +#define PD3 51 +#define PD4 52 +#define PD5 53 +#define PD6 54 +#define PD7 55 +#define PD8 56 +#define PD9 57 +#define PD10 58 +#define PD11 59 +#define PD12 60 +#define PD13 61 +#define PD14 62 +#define PD15 63 +#define PE0 64 +#define PE1 65 +#define PE2 66 +#define PE3 67 +#define PE4 68 +#define PE5 69 +#define PE6 70 +#define PE7 71 +#define PE8 72 +#define PE9 73 +#define PE10 74 +#define PE11 75 +#define PE12 76 +#define PE13 77 +#define PE14 78 +#define PE15 79 + +// This must be a literal with the same value as PEND +#define NUM_DIGITAL_PINS 87 +// This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS +#define NUM_ANALOG_INPUTS 7 +#define NUM_ANALOG_FIRST 80 + +//#define ADC_RESOLUTION 12 + +// PWM resolution +//#define PWM_RESOLUTION 12 +#define PWM_FREQUENCY 20000 // >= 20 Khz => inaudible noise for fans +#define PWM_MAX_DUTY_CYCLE 255 + +// SPI Definitions +#define PIN_SPI_SS PA4 +#define PIN_SPI_MOSI PA7 +#define PIN_SPI_MISO PA6 +#define PIN_SPI_SCK PA5 + +// I2C Definitions +#define PIN_WIRE_SDA PB9 +#define PIN_WIRE_SCL PB8 + +// Timer Definitions +// Do not use timer used by PWM pin. See PinMap_PWM. +#define TIMER_TONE TIM6 // TIMER_TONE must be defined in this file +#define TIMER_SERVO TIM5 // TIMER_SERVO must be defined in this file +#define TIMER_SERIAL TIM7 // TIMER_SERIAL must be defined in this file + +// UART Definitions +//#define SERIAL_UART_INSTANCE 1 // Connected to EXP3 header +/* Enable Serial 3 */ +#define HAVE_HWSERIAL1 +#define HAVE_HWSERIAL3 + +// Default pin used for 'Serial' instance (ex: ST-Link) +// Mandatory for Firmata +#define PIN_SERIAL_RX PA10 +#define PIN_SERIAL_TX PA9 + +/* HAL configuration */ +#define HSE_VALUE 12000000U + +#define FLASH_PAGE_SIZE (4U * 1024U) + +#ifdef __cplusplus +} // extern "C" +#endif + +/*---------------------------------------------------------------------------- + * Arduino objects - C++ only + *----------------------------------------------------------------------------*/ + +#ifdef __cplusplus +// These serial port names are intended to allow libraries and architecture-neutral +// sketches to automatically default to the correct port name for a particular type +// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, +// the first hardware serial port whose RX/TX pins are not dedicated to another use. +// +// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor +// +// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial +// +// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library +// +// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. +// +// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX +// pins are NOT connected to anything by default. +#define SERIAL_PORT_MONITOR Serial +#define SERIAL_PORT_HARDWARE_OPEN Serial +#endif + +#endif /* _VARIANT_ARDUINO_STM32_ */ diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F446Zx_TRONXY/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_F446Zx_TRONXY/variant_generic.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_F446Zx_TRONXY/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_F446Zx_TRONXY/variant_generic.cpp diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F446Zx_TRONXY/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_F446Zx_TRONXY/variant_generic.h similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_F446Zx_TRONXY/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_F446Zx_TRONXY/variant_generic.h diff --git a/buildroot/share/PlatformIO/variants/MARLIN_FLY_CDY_V3/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_FLY_CDY_V3/variant_MARLIN_STM32F407VGT6_CCM.cpp similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_FLY_CDY_V3/variant.cpp rename to buildroot/share/PlatformIO/variants/MARLIN_FLY_CDY_V3/variant_MARLIN_STM32F407VGT6_CCM.cpp diff --git a/buildroot/share/PlatformIO/variants/MARLIN_FLY_CDY_V3/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_FLY_CDY_V3/variant_MARLIN_STM32F407VGT6_CCM.h similarity index 100% rename from buildroot/share/PlatformIO/variants/MARLIN_FLY_CDY_V3/variant.h rename to buildroot/share/PlatformIO/variants/MARLIN_FLY_CDY_V3/variant_MARLIN_STM32F407VGT6_CCM.h diff --git a/ini/features.ini b/ini/features.ini index 07202eae5d8c..b2bcd7fea394 100644 --- a/ini/features.ini +++ b/ini/features.ini @@ -374,7 +374,8 @@ IS_SCARA = build_src_filter=+ + MORGAN_SCARA = build_src_filter=+ HAS_MICROSTEPS = build_src_filter=+ -(ESP3D_)?WIFISUPPORT = AsyncTCP, ESP Async WebServer=https://github.com/har-in-air/ESPAsyncWebServer.git +(ESP3D_)?WIFISUPPORT = AsyncTCP, ESP Async + WebServer=https://github.com/har-in-air/ESPAsyncWebServer.git ESP3DLib=https://github.com/luc-github/ESP3DLib/archive/dc0f3d96c6.zip arduinoWebSockets=links2004/WebSockets@2.3.4 luc-github/ESP32SSDP@1.1.1 diff --git a/ini/stm32-common.ini b/ini/stm32-common.ini index d7cca462a3ac..507296ed1057 100644 --- a/ini/stm32-common.ini +++ b/ini/stm32-common.ini @@ -59,6 +59,5 @@ extra_scripts = ${stm32_variant.extra_scripts} [stm_flash_drive] # Arduino_Core_STM32 uses usb-host-msc-cdc-msc-3 branch platform_packages = framework-arduinoststm32@https://github.com/rhapsodyv/Arduino_Core_STM32/archive/39f37d6d6a.zip -build_flags = ${common_stm32.build_flags} - -DHAL_PCD_MODULE_ENABLED -DHAL_HCD_MODULE_ENABLED +build_flags = -DHAL_PCD_MODULE_ENABLED -DHAL_HCD_MODULE_ENABLED -DUSBHOST -DUSBH_IRQ_PRIO=3 -DUSBH_IRQ_SUBPRIO=4 diff --git a/ini/stm32f4.ini b/ini/stm32f4.ini index c980655f619f..dbb07a3c6547 100644 --- a/ini/stm32f4.ini +++ b/ini/stm32f4.ini @@ -224,7 +224,7 @@ upload_protocol = stlink [env:BTT_SKR_PRO_usb_flash_drive] extends = env:BTT_SKR_PRO platform_packages = ${stm_flash_drive.platform_packages} -build_flags = ${stm_flash_drive.build_flags} -DSTM32F407_5ZX +build_flags = ${env:BTT_SKR_PRO.build_flags} ${stm_flash_drive.build_flags} -DSTM32F407_5ZX build_unflags = ${env:BTT_SKR_PRO.build_unflags} -DUSBCON -DUSBD_USE_CDC # @@ -246,12 +246,12 @@ build_flags = ${stm32_variant_latest.build_flags} # Mellow/Fly RRF E3 V1 (STM32F407VGT6 ARM Cortex-M4) # [env:FLY_RRF_E3_V1] -extends = stm32_variant +extends = stm32_variant_latest board = marlin_STM32F407VGT6_CCM #board_build.variant = MARLIN_BTT_E3_RRF board_build.offset = 0x8000 board_build.offset_address = 0x08008000 -build_flags = ${stm32_variant.build_flags} +build_flags = ${stm32_variant_latest.build_flags} -DSTM32F407_5VX -DMF_RX_BUFFER_SIZE=255 -DMF_TX_BUFFER_SIZE=255 @@ -272,7 +272,7 @@ build_flags = ${stm32_variant_latest.build_flags} -DSTM32F407IX [env:BTT_GTR_V1_0_usb_flash_drive] extends = env:BTT_GTR_V1_0 platform_packages = ${stm_flash_drive.platform_packages} -build_flags = ${stm_flash_drive.build_flags} -DSTM32F407IX +build_flags = ${env:BTT_GTR_V1_0.build_flags} ${stm_flash_drive.build_flags} -DSTM32F407IX build_unflags = ${env:BTT_GTR_V1_0.build_unflags} -DUSBCON -DUSBD_USE_CDC # @@ -310,7 +310,7 @@ board = marlin_STM32F407VGT6_CCM board_build.variant = MARLIN_F4x7Vx board_build.offset = 0x8000 board_upload.offset_address = 0x08008000 -build_flags = ${stm_flash_drive.build_flags} ${USB_HS_IN_FS.build_flags} +build_flags = ${stm32_variant_latest.build_flags} ${stm_flash_drive.build_flags} ${USB_HS_IN_FS.build_flags} -DHSE_VALUE=8000000U -DHAL_SD_MODULE_ENABLED -DPIN_SERIAL3_RX=PD_9 -DPIN_SERIAL3_TX=PD_8 -D_STM32_PLATDEFS=MARLIN_F4x7Vx @@ -369,7 +369,7 @@ build_flags = ${stm32_variant_latest.build_flags} extends = env:STM32F446ZE_btt platform_packages = ${stm_flash_drive.platform_packages} build_unflags = -DUSBD_USE_CDC -build_flags = ${stm_flash_drive.build_flags} -DSTM32F446_5VX +build_flags = ${env:STM32F446ZE_btt.build_flags} ${stm_flash_drive.build_flags} -DSTM32F446_5VX ${USB_HS_IN_FS.build_flags} -DUSBD_USE_CDC_MSC # @@ -392,7 +392,7 @@ build_flags = ${stm32_variant_latest.build_flags} extends = env:STM32F429ZG_btt platform_packages = ${stm_flash_drive.platform_packages} build_unflags = -DUSBD_USE_CDC -build_flags = ${stm_flash_drive.build_flags} +build_flags = ${env:STM32F429ZG_btt.build_flags} ${stm_flash_drive.build_flags} ${USB_HS_IN_FS.build_flags} -DUSBD_USE_CDC_MSC # @@ -413,7 +413,7 @@ build_flags = ${stm32_variant_latest.build_flags} extends = env:STM32F407ZE_btt platform_packages = ${stm_flash_drive.platform_packages} build_unflags = -DUSBD_USE_CDC -build_flags = ${stm_flash_drive.build_flags} ${USB_HS_IN_FS.build_flags} -DUSBD_USE_CDC_MSC +build_flags = ${env:STM32F407ZE_btt.build_flags} ${stm_flash_drive.build_flags} ${USB_HS_IN_FS.build_flags} -DUSBD_USE_CDC_MSC # # Lerdge base @@ -446,7 +446,7 @@ board_build.crypt_lerdge = Lerdge_X_firmware_force.bin [env:LERDGEX_usb_flash_drive] extends = env:LERDGEX platform_packages = ${stm_flash_drive.platform_packages} -build_flags = ${stm_flash_drive.build_flags} ${lerdge_common.build_flags} +build_flags = ${env:LERDGEX.build_flags} ${stm_flash_drive.build_flags} ${lerdge_common.build_flags} # # Lerdge S (STM32F407ZG) @@ -461,7 +461,7 @@ board_build.crypt_lerdge = Lerdge_firmware_force.bin [env:LERDGES_usb_flash_drive] extends = env:LERDGES platform_packages = ${stm_flash_drive.platform_packages} -build_flags = ${stm_flash_drive.build_flags} ${lerdge_common.build_flags} +build_flags = ${env:LERDGES.build_flags} ${stm_flash_drive.build_flags} ${lerdge_common.build_flags} # # Lerdge K (STM32F407ZG) @@ -477,7 +477,7 @@ build_flags = ${lerdge_common.build_flags} -DLERDGEK [env:LERDGEK_usb_flash_drive] extends = env:LERDGEK platform_packages = ${stm_flash_drive.platform_packages} -build_flags = ${stm_flash_drive.build_flags} ${lerdge_common.build_flags} +build_flags = ${env:LERDGEK.build_flags} ${stm_flash_drive.build_flags} ${lerdge_common.build_flags} # # RUMBA32 @@ -521,7 +521,7 @@ board = genericSTM32F407VET6 board_build.variant = MARLIN_F4x7Vx board_build.offset = 0x0000 board_upload.offset_address = 0x08000000 -build_flags = ${stm_flash_drive.build_flags} +build_flags = ${stm32_variant_latest.build_flags} ${stm_flash_drive.build_flags} -D_STM32_PLATDEFS=MARLIN_F4x7Vx build_unflags = ${stm32_variant_latest.build_unflags} -DUSBCON -DUSBD_USE_CDC debug_tool = jlink @@ -555,7 +555,7 @@ upload_protocol = jlink [env:mks_robin_nano_v3_usb_flash_drive] extends = env:mks_robin_nano_v3 platform_packages = ${stm_flash_drive.platform_packages} -build_flags = ${stm_flash_drive.build_flags} ${stm32f4_I2C1.build_flags} ${USB_HS_IN_FS.build_flags} +build_flags = ${env:mks_robin_nano_v3.build_flags} ${stm_flash_drive.build_flags} ${stm32f4_I2C1.build_flags} ${USB_HS_IN_FS.build_flags} # # MKS Robin Nano V3 with USB Flash Drive Support and Shared Media @@ -612,7 +612,7 @@ upload_protocol = jlink [env:mks_eagle_usb_flash_drive] extends = env:mks_eagle platform_packages = ${stm_flash_drive.platform_packages} -build_flags = ${stm_flash_drive.build_flags} ${stm32f4_I2C1.build_flags} ${USB_HS_IN_FS.build_flags} +build_flags = ${env:mks_eagle.build_flags} ${stm_flash_drive.build_flags} ${stm32f4_I2C1.build_flags} ${USB_HS_IN_FS.build_flags} # # MKS Eagle with USB Flash Drive Support and Shared Media @@ -652,7 +652,7 @@ upload_protocol = jlink [env:mks_monster8_usb_flash_drive] extends = env:mks_monster8 platform_packages = ${stm_flash_drive.platform_packages} -build_flags = ${stm_flash_drive.build_flags} ${stm32f4_I2C1_CAN.build_flags} ${USB_HS_IN_FS.build_flags} +build_flags = ${env:mks_monster8.build_flags} ${stm_flash_drive.build_flags} ${stm32f4_I2C1_CAN.build_flags} ${USB_HS_IN_FS.build_flags} # # MKS Monster8 V1 / V2 (STM32F407VET6 ARM Cortex-M4) with USB Flash Drive Support and Shared Media @@ -708,14 +708,14 @@ upload_protocol = jlink # MKS Neptune X # [env:mks_neptune_x] -extends = stm32_variant +extends = stm32_variant_latest board = marlin_STM32F407VGT6_CCM board_build.variant = MARLIN_F4x7Vx board_build.offset = 0xC000 board_upload.offset_address = 0x0800C000 board_build.rename = elegoo.bin platform_packages = ${stm_flash_drive.platform_packages} -build_flags = ${stm32_variant.build_flags} ${stm32f4_I2C1.build_flags} +build_flags = ${stm32_variant_latest.build_flags} ${stm32f4_I2C1.build_flags} ${stm_flash_drive.build_flags} ${USB_HS_IN_FS.build_flags} -DHAL_PCD_MODULE_ENABLED -DHAL_SD_MODULE_ENABLED -DHAL_SRAM_MODULE_ENABLED -DMCU_STM32F407VE -DSS_TIMER=4 -DENABLE_HWSERIAL3 @@ -728,19 +728,19 @@ upload_protocol = jlink # MKS Neptune 3 # [env:mks_neptune_3] -extends = stm32_variant +extends = stm32_variant_latest board = marlin_STM32F407VGT6_CCM board_build.variant = MARLIN_F4x7Vx board_build.offset = 0xC000 board_upload.offset_address = 0x0800C000 board_build.rename = ZNP_ROBIN_NANO.bin platform_packages = ${stm_flash_drive.platform_packages} -build_flags = ${stm32_variant.build_flags} +build_flags = ${stm32_variant_latest.build_flags} -DMCU_STM32F407VE -DSS_TIMER=4 -DENABLE_HWSERIAL3 -DSTM32_FLASH_SIZE=512 -DTIMER_TONE=TIM3 -DTIMER_SERVO=TIM2 -DHAL_SD_MODULE_ENABLED -DHAL_SRAM_MODULE_ENABLED -build_unflags = ${stm32_variant.build_unflags} +build_unflags = ${stm32_variant_latest.build_unflags} -DUSBCON -DUSBD_USE_CDC debug_tool = jlink upload_protocol = jlink @@ -1014,6 +1014,6 @@ board = marlin_STM32F407VGT6_CCM board_build.variant = MARLIN_F4x7Vx board_build.offset = 0x8000 board_upload.offset_address = 0x08008000 -build_flags = ${stm_flash_drive.build_flags} ${USB_HS_IN_FS.build_flags} +build_flags = ${stm32_variant_latest.build_flags} ${stm_flash_drive.build_flags} ${USB_HS_IN_FS.build_flags} -DHSE_VALUE=8000000U -DHAL_SD_MODULE_ENABLED -DPIN_SERIAL3_RX=PD_9 -DPIN_SERIAL3_TX=PD_8 From bdd92073d12af8c6a46362c446fd0da57e925dae Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 5 May 2025 20:37:52 -0500 Subject: [PATCH 4/4] Allow ovverride of stm32_variant --- ini/stm32-common.ini | 21 +++-- ini/stm32f0.ini | 12 +-- ini/stm32f1.ini | 102 +++++++++++----------- ini/stm32f4.ini | 204 +++++++++++++++++++++---------------------- ini/stm32f7.ini | 6 +- 5 files changed, 178 insertions(+), 167 deletions(-) diff --git a/ini/stm32-common.ini b/ini/stm32-common.ini index 507296ed1057..cccd487e6864 100644 --- a/ini/stm32-common.ini +++ b/ini/stm32-common.ini @@ -10,7 +10,7 @@ #################################### # For Compatibility. Should be set to version that is last known to work across all boards. -[common_stm32] +[common_stm32_stable] platform = ststm32@~12.1 board_build.core = stm32 build_flags = ${common.build_flags} -std=gnu++14 @@ -41,11 +41,11 @@ build_flags = ${common_stm32.build_flags} build_unflags = -std=gnu++14 # -# STM32 board based on a variant. +# STM32 boards based on variants (copied from buildroot/share/PlatformIO/variants) # -[stm32_variant] -extends = common_stm32 -extra_scripts = ${common_stm32.extra_scripts} +[stm32_variant_stable] +extends = common_stm32_stable +extra_scripts = ${common_stm32_stable.extra_scripts} pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py buildroot/share/PlatformIO/scripts/offset_and_rename.py @@ -53,6 +53,17 @@ extra_scripts = ${common_stm32.extra_scripts} extends = common_stm32_latest extra_scripts = ${stm32_variant.extra_scripts} +# +# Change 'extends' here to use the stable or latest STM32 platform +# +[common_stm32] +extends = common_stm32_stable +#extends = common_stm32_latest + +[stm32_variant] +extends = stm32_variant_stable +#extends = stm32_variant_latest + # # USB Flash Drive mix-ins for STM32 # diff --git a/ini/stm32f0.ini b/ini/stm32f0.ini index 3b8bad2cccb1..a684b98871d6 100644 --- a/ini/stm32f0.ini +++ b/ini/stm32f0.ini @@ -23,9 +23,9 @@ # Malyan M200 v2 (STM32F070RB) # [env:STM32F070RB_malyan] -extends = common_stm32_latest +extends = common_stm32 board = marlin_malyanM200v2 -build_flags = ${common_stm32_latest.build_flags} -DHAL_PCD_MODULE_ENABLED +build_flags = ${common_stm32.build_flags} -DHAL_PCD_MODULE_ENABLED -O2 -ffreestanding -fsigned-char -fno-move-loop-invariants -fno-strict-aliasing -DCUSTOM_STARTUP_FILE @@ -33,9 +33,9 @@ build_flags = ${common_stm32_latest.build_flags} -DHAL_PCD_MODULE_ENABLED # Malyan M200 v2 (STM32F070CB) # [env:STM32F070CB_malyan] -extends = common_stm32_latest +extends = common_stm32 board = malyanm200_f070cb -build_flags = ${common_stm32_latest.build_flags} +build_flags = ${common_stm32.build_flags} -DHAL_PCD_MODULE_ENABLED -DDISABLE_GENERIC_SERIALUSB -DHAL_UART_MODULE_ENABLED -DCUSTOM_STARTUP_FILE @@ -43,9 +43,9 @@ build_flags = ${common_stm32_latest.build_flags} # Malyan M300 (STM32F070CB) # [env:malyan_M300] -extends = common_stm32_latest +extends = common_stm32 board = malyanm300_f070cb -build_flags = ${common_stm32_latest.build_flags} +build_flags = ${common_stm32.build_flags} -DHAL_PCD_MODULE_ENABLED -DDISABLE_GENERIC_SERIALUSB -DHAL_UART_MODULE_ENABLED build_src_filter = ${common.default_src_filter} + - diff --git a/ini/stm32f1.ini b/ini/stm32f1.ini index b00b48bae2cf..8c142541b9ff 100644 --- a/ini/stm32f1.ini +++ b/ini/stm32f1.ini @@ -20,9 +20,9 @@ ################################# [common_STM32F103RC_variant] -extends = stm32_variant_latest +extends = stm32_variant board = genericSTM32F103RC -build_flags = ${stm32_variant_latest.build_flags} +build_flags = ${stm32_variant.build_flags} -DDEBUG_LEVEL=0 -D_STM32_PLATDEFS=MARLIN_F103Rx monitor_speed = 115200 @@ -30,7 +30,7 @@ monitor_speed = 115200 # STM32F103RE # [env:STM32F103RE] -extends = common_stm32_latest +extends = common_stm32 board = genericSTM32F103RE monitor_speed = 115200 @@ -38,7 +38,7 @@ monitor_speed = 115200 # STM32F103VE # [env:STM32F103VE] -extends = common_stm32_latest +extends = common_stm32 board = genericSTM32F103VE monitor_speed = 115200 @@ -46,7 +46,7 @@ monitor_speed = 115200 # STM32F103ZE # [env:STM32F103ZE] -extends = common_stm32_latest +extends = common_stm32 board = genericSTM32F103ZE monitor_speed = 115200 @@ -91,15 +91,15 @@ lib_deps = markyue/Panda_SoftMasterI2C@1.0.3 # Uses HAL STM32 to support Marlin UI for TFT screen with optional touch panel # [env:mks_robin] -extends = stm32_variant_latest +extends = stm32_variant board = genericSTM32F103ZE board_build.encrypt_mks = Robin.bin board_build.offset = 0x7000 board_build.offset_address = 0x08007000 -build_flags = ${stm32_variant_latest.build_flags} +build_flags = ${stm32_variant.build_flags} -DENABLE_HWSERIAL3 -DTIMER_SERIAL=TIM5 -D_STM32_PLATDEFS=MARLIN_F103Zx -build_unflags = ${stm32_variant_latest.build_unflags} +build_unflags = ${stm32_variant.build_unflags} -DUSBCON -DUSBD_USE_CDC # @@ -120,16 +120,16 @@ debug_tool = stlink # Creality (STM32F103Rx) # [STM32F103Rx_creality] -extends = stm32_variant_latest +extends = stm32_variant board_build.offset = 0x7000 board_upload.offset_address = 0x08007000 board_build.rename = firmware-{date}-{time}.bin -build_flags = ${stm32_variant_latest.build_flags} +build_flags = ${stm32_variant.build_flags} -DMCU_STM32F103RE -DHAL_SD_MODULE_ENABLED -DSS_TIMER=4 -DTIMER_SERVO=TIM5 -DENABLE_HWSERIAL3 -DTRANSFER_CLOCK_DIV=8 -D_STM32_PLATDEFS=MARLIN_F103Rx -build_unflags = ${stm32_variant_latest.build_unflags} +build_unflags = ${stm32_variant.build_unflags} -DUSBCON -DUSBD_USE_CDC monitor_speed = 115200 debug_tool = jlink @@ -212,11 +212,11 @@ build_flags = ${STM32F103Rx_creality.build_flags} # STM32F103RE_btt_USB ......... RET6 with USB Media Share Support # [env:STM32F103RE_btt] -extends = stm32_variant_latest +extends = stm32_variant board = genericSTM32F103RE board_build.offset = 0x7000 board_upload.offset_address = 0x08007000 -build_flags = ${stm32_variant_latest.build_flags} +build_flags = ${stm32_variant.build_flags} -DMCU_STM32F103RE -DHAL_SD_MODULE_ENABLED -DSS_TIMER=4 -DTIMER_SERVO=TIM5 -DENABLE_HWSERIAL3 -DTRANSFER_CLOCK_DIV=8 @@ -243,47 +243,47 @@ board_build.encrypt_mks = elegoo.bin # Mingda MPX_ARM_MINI # [env:mingda_mpx_arm_mini] -extends = stm32_variant_latest +extends = stm32_variant board = genericSTM32F103ZE board_build.offset = 0x10000 board_build.offset_address = 0x08010000 -build_flags = ${stm32_variant_latest.build_flags} +build_flags = ${stm32_variant.build_flags} -DENABLE_HWSERIAL3 -DTIMER_SERIAL=TIM5 -D_STM32_PLATDEFS=MARLIN_F103Zx -build_unflags = ${stm32_variant_latest.build_unflags} +build_unflags = ${stm32_variant.build_unflags} -DUSBCON -DUSBD_USE_CDC # # Malyan M200 (STM32F103CB) # [env:STM32F103CB_malyan] -extends = common_stm32_latest +extends = common_stm32 board = malyanm200_f103cb -build_flags = ${common_stm32_latest.build_flags} +build_flags = ${common_stm32.build_flags} -DHAL_PCD_MODULE_ENABLED -DDISABLE_GENERIC_SERIALUSB -DHAL_UART_MODULE_ENABLED -build_src_filter = ${common_stm32_latest.build_src_filter} + - +build_src_filter = ${common_stm32.build_src_filter} + - # # FLYmaker FLY Mini (STM32F103RCT6) # [env:FLY_MINI] -extends = stm32_variant_latest +extends = stm32_variant board = genericSTM32F103RC board_build.offset = 0x5000 board_upload.offset_address = 0x08005000 -build_flags = ${stm32_variant_latest.build_flags} -DSS_TIMER=4 -DSTM32_FLASH_SIZE=256 -D_STM32_PLATDEFS=MARLIN_F103Rx +build_flags = ${stm32_variant.build_flags} -DSS_TIMER=4 -DSTM32_FLASH_SIZE=256 -D_STM32_PLATDEFS=MARLIN_F103Rx # # (STM32F103VE_robin) # [STM32F103VE_robin] -extends = stm32_variant_latest +extends = stm32_variant board = genericSTM32F103VE board_build.variant = MARLIN_F103Vx board_build.offset = 0x7000 board_upload.offset_address = 0x08007000 -build_flags = ${stm32_variant_latest.build_flags} -DMCU_STM32F103VE -DTIMER_TONE=TIM3 -DTIMER_SERVO=TIM2 -DSS_TIMER=4 +build_flags = ${stm32_variant.build_flags} -DMCU_STM32F103VE -DTIMER_TONE=TIM3 -DTIMER_SERVO=TIM2 -DSS_TIMER=4 -D_STM32_PLATDEFS=MARLIN_F103Vx [mks_robin_nano_v1v2_common] @@ -339,12 +339,12 @@ build_unflags = ${STM32F103VE_robin.build_unflags} -DUSBCON -DUSBD # MKS Robin Lite/Lite2 (STM32F103RCT6) # [env:mks_robin_lite] -extends = stm32_variant_latest +extends = stm32_variant board = genericSTM32F103RC board_build.encrypt_mks = mksLite.bin board_build.offset = 0x5000 board_upload.offset_address = 0x08005000 -build_flags = ${stm32_variant_latest.build_flags} +build_flags = ${stm32_variant.build_flags} -D_STM32_PLATDEFS=MARLIN_F103Rx # @@ -365,16 +365,16 @@ board_build.encrypt_mks = Robin_pro.bin # JGAurora A5S A1 (STM32F103ZET6) # [env:jgaurora_a5s_a1] -extends = stm32_variant_latest +extends = stm32_variant board = genericSTM32F103ZE board_build.offset = 0xA000 board_upload.offset_address = 0x0800A000 -build_flags = ${stm32_variant_latest.build_flags} +build_flags = ${stm32_variant.build_flags} -DSTM32F1xx -DSTM32_XL_DENSITY -D_STM32_PLATDEFS=MARLIN_F103Zx -build_unflags = ${stm32_variant_latest.build_unflags} +build_unflags = ${stm32_variant.build_unflags} -DUSBCON -DUSBD_USE_CDC -extra_scripts = ${stm32_variant_latest.extra_scripts} +extra_scripts = ${stm32_variant.extra_scripts} buildroot/share/PlatformIO/scripts/jgaurora_a5s_a1_with_bootloader.py # @@ -393,18 +393,18 @@ upload_protocol = serial # Longer 3D board in Alfawise U20 (STM32F103VET6) # [env:STM32F103VE_longer] -extends = stm32_variant_latest +extends = stm32_variant lib_deps = ${common.lib_deps} https://github.com/tpruvot/STM32_Servo_OpenDrain/archive/2.0.zip board = genericSTM32F103VE board_build.rename = project.bin board_build.offset = 0x10000 board_upload.offset_address = 0x08010000 -build_flags = ${stm32_variant_latest.build_flags} +build_flags = ${stm32_variant.build_flags} -DMCU_STM32F103VE -DU20 -DTS_V12 -D_STM32_PLATDEFS=MARLIN_F103VE_LONGER -build_unflags = ${stm32_variant_latest.build_unflags} -DUSBCON -DUSBD_USE_CDC -DHAL_PCD_MODULE_ENABLED -extra_scripts = ${stm32_variant_latest.extra_scripts} +build_unflags = ${stm32_variant.build_unflags} -DUSBCON -DUSBD_USE_CDC -DHAL_PCD_MODULE_ENABLED +extra_scripts = ${stm32_variant.extra_scripts} monitor_speed = 250000 debug_tool = stlink @@ -412,13 +412,13 @@ debug_tool = stlink # TRIGORILLA PRO (STM32F103ZET6) # [env:trigorilla_pro] -extends = stm32_variant_latest +extends = stm32_variant board = genericSTM32F103ZE board_build.variant = MARLIN_F103Zx -build_flags = ${stm32_variant_latest.build_flags} +build_flags = ${stm32_variant.build_flags} -DENABLE_HWSERIAL3 -DTIMER_SERIAL=TIM5 -DSTM32_FLASH_SIZE=512 -D_STM32_PLATDEFS=MARLIN_F103Zx -build_unflags = ${stm32_variant_latest.build_unflags} +build_unflags = ${stm32_variant.build_unflags} -DUSBCON -DUSBD_USE_CDC # @@ -426,17 +426,17 @@ build_unflags = ${stm32_variant_latest.build_unflags} # Builds for Trigorilla to update from SD # [env:trigorilla_pro_disk] -extends = stm32_variant_latest +extends = stm32_variant board = genericSTM32F103ZE board_build.crypt_chitu = update.zw board_build.offset = 0x8800 board_build.offset_address = 0x08008800 -build_flags = ${stm32_variant_latest.build_flags} +build_flags = ${stm32_variant.build_flags} -DENABLE_HWSERIAL3 -DTIMER_SERIAL=TIM5 -D_STM32_PLATDEFS=MARLIN_F103Zx -build_unflags = ${stm32_variant_latest.build_unflags} +build_unflags = ${stm32_variant.build_unflags} -DUSBCON -DUSBD_USE_CDC -extra_scripts = ${stm32_variant_latest.extra_scripts} +extra_scripts = ${stm32_variant.extra_scripts} buildroot/share/PlatformIO/scripts/chitu_crypt.py @@ -444,16 +444,16 @@ extra_scripts = ${stm32_variant_latest.extra_scripts} # Chitu boards like Tronxy X5s (STM32F103ZET6) # [env:chitu_f103] -extends = stm32_variant_latest +extends = stm32_variant board = genericSTM32F103ZE board_build.crypt_chitu = update.cbd board_build.offset = 0x8800 board_build.offset_address = 0x08008800 -build_flags = ${stm32_variant_latest.build_flags} +build_flags = ${stm32_variant.build_flags} -DSTM32F1xx -DSTM32_FLASH_SIZE=512 -D_STM32_PLATDEFS=MARLIN_F103Zx -build_unflags = ${stm32_variant_latest.build_unflags} -extra_scripts = ${stm32_variant_latest.extra_scripts} +build_unflags = ${stm32_variant.build_unflags} +extra_scripts = ${stm32_variant.extra_scripts} buildroot/share/PlatformIO/scripts/chitu_crypt.py # @@ -472,13 +472,13 @@ build_flags = ${env:chitu_f103.build_flags} -DCHITU_V5_Z_MIN_BUGFIX # STM32F103VE_ZM3E4V2_USB ......... VET6 with 512K # [ZONESTAR_ZM3E] -extends = stm32_variant_latest +extends = stm32_variant platform_packages = ${stm_flash_drive.platform_packages} board_build.offset = 0x5000 board_upload.offset_address = 0x08005000 board_upload.maximum_size = 237568 -extra_scripts = ${stm32_variant_latest.extra_scripts} -build_flags = ${stm32_variant_latest.build_flags} ${USBD_CDC_MSC.build_flags} +extra_scripts = ${stm32_variant.extra_scripts} +build_flags = ${stm32_variant.build_flags} ${USBD_CDC_MSC.build_flags} -DSS_TIMER=4 -DTIMER_SERVO=TIM5 build_unflags = ${stm32_variant.build_unflags} ${USBD_CDC_MSC.build_unflags} @@ -508,21 +508,21 @@ board_upload.maximum_size = 499712 # Mingda D2 DZ301 V1.0 (STM32F103ZE) # [env:mingda_d301] -extends = stm32_variant_latest +extends = stm32_variant board = genericSTM32F103ZE board_build.variant = MARLIN_F103Zx board_build.offset = 0x7000 board_upload.offset_address = 0x08007000 -build_flags = ${stm32_variant_latest.build_flags} -DSTM32F1xx -DSTM32_FLASH_SIZE=512 +build_flags = ${stm32_variant.build_flags} -DSTM32F1xx -DSTM32_FLASH_SIZE=512 # # ORCA 3D SPRINGER Modular Controller (STM32F103VCT6) # [env:STM32F103VC_orca3d] -extends = stm32_variant_latest +extends = stm32_variant board = genericSTM32F103VC board_build.variant = MARLIN_F103Vx -build_flags = ${stm32_variant_latest.build_flags} -DDEBUG_LEVEL=0 +build_flags = ${stm32_variant.build_flags} -DDEBUG_LEVEL=0 monitor_speed = 115200 board_build.offset = 0x8000 board_upload.offset_address = 0x08008000 diff --git a/ini/stm32f4.ini b/ini/stm32f4.ini index dbb07a3c6547..5ee35354e923 100644 --- a/ini/stm32f4.ini +++ b/ini/stm32f4.ini @@ -23,31 +23,31 @@ # ARMED (STM32) # [env:ARMED] -extends = common_stm32_latest +extends = common_stm32 board = armed_v1 -build_flags = ${common_stm32_latest.build_flags} +build_flags = ${common_stm32.build_flags} -O2 -ffreestanding -fsigned-char -fno-move-loop-invariants -fno-strict-aliasing # # STM32F401RC # [env:FYSETC_CHEETAH_V20] -extends = stm32_variant_latest +extends = stm32_variant platform_packages = platformio/tool-dfuutil@~1.11.0 board = marlin_FYSETC_CHEETAH_V20 board_build.offset = 0x8000 board_build.offset_address = 0x08008000 -build_flags = ${stm32_variant_latest.build_flags} -DSTM32F401xC +build_flags = ${stm32_variant.build_flags} -DSTM32F401xC upload_command = dfu-util -a 0 -s 0x08008000:leave -D "$SOURCE" # # STM32F446RC nobootloader # [env:FYSETC_CHEETAH_V30] -extends = stm32_variant_latest +extends = stm32_variant platform_packages = platformio/tool-dfuutil@~1.11.0 board = marlin_FYSETC_CHEETAH_V30 -build_flags = ${stm32_variant_latest.build_flags} -DHAL_PCD_MODULE_ENABLED +build_flags = ${stm32_variant.build_flags} -DHAL_PCD_MODULE_ENABLED debug_tool = stlink upload_protocol = dfu upload_command = dfu-util -a 0 -s 0x08000000:leave -D "$SOURCE" @@ -56,13 +56,13 @@ upload_command = dfu-util -a 0 -s 0x08000000:leave -D "$SOURCE" # FLYF407ZG # [env:FLYF407ZG] -extends = stm32_variant_latest +extends = stm32_variant platform_packages = platformio/tool-dfuutil@~1.11.0 board = marlin_STM32F407ZGT6 board_build.variant = MARLIN_FLY_F407ZG board_build.offset = 0x8000 board_build.offset_address = 0x08008000 -build_flags = ${stm32_variant_latest.build_flags} +build_flags = ${stm32_variant.build_flags} -D_STM32_PLATDEFS=MARLIN_FLY_F407ZG upload_protocol = dfu @@ -70,7 +70,7 @@ upload_protocol = dfu # FLY_D8 # [env:FLY_D8] -extends = stm32_variant_latest +extends = stm32_variant platform_packages = platformio/tool-dfuutil@~1.11.0 board = marlin_STM32F407VGT6_CCM board_build.variant = MARLIN_FLY_D8 @@ -82,7 +82,7 @@ board_upload.offset_address = 0x08000000 # FLY SUPER8 # [env:FLY_SUPER8] -extends = stm32_variant_latest +extends = stm32_variant platform_packages = platformio/tool-dfuutil@~1.11.0 board = marlin_STM32F407ZGT6 board_build.variant = MARLIN_FLY_SUPER8 @@ -93,7 +93,7 @@ upload_protocol = dfu # FLY CDY V3 # [env:FLY_CDY_V3] -extends = stm32_variant_latest +extends = stm32_variant platform_packages = platformio/tool-dfuutil@~1.11.0 board = marlin_STM32F407VGT6_CCM board_build.variant = MARLIN_FLY_CDY_V3 @@ -104,12 +104,12 @@ upload_protocol = dfu # FYSETC S6 / Spider V1.x/2.x/3.x with 64k bootloader (STM32F446VET6 ARM Cortex-M4) # [env:STM32F446VE_fysetc] -extends = stm32_variant_latest +extends = stm32_variant platform_packages = platformio/tool-dfuutil@~1.11.0 board = marlin_STM32F446VE_fysetc board_build.offset = 0x10000 board_upload.offset_address = 0x08010000 -build_flags = ${stm32_variant_latest.build_flags} -DHAL_PCD_MODULE_ENABLED +build_flags = ${stm32_variant.build_flags} -DHAL_PCD_MODULE_ENABLED debug_tool = stlink upload_protocol = dfu upload_command = dfu-util -a 0 -s 0x08010000:leave -D "$SOURCE" @@ -131,13 +131,13 @@ upload_command = dfu-util -a 0 -s 0x08008000:leave -D "$SOURCE" # FYSETC SPIDER KING407 (STM32F407ZGT6 ARM Cortex-M4) # [env:FYSETC_SPIDER_KING407] -extends = stm32_variant_latest +extends = stm32_variant platform_packages = platformio/tool-dfuutil@~1.11.0 board = marlin_STM32F407ZGT6 board_build.variant = MARLIN_FYSETC_SPIDER_KING407 board_build.offset = 0x8000 board_build.offset_address = 0x08008000 -build_flags = ${stm32_variant_latest.build_flags} +build_flags = ${stm32_variant.build_flags} -D_STM32_PLATDEFS=MARLIN_FYSETC_SPIDER_KING407 upload_protocol = dfu @@ -147,44 +147,44 @@ upload_protocol = dfu # Shield - https://github.com/jmz52/Hardware # [env:STM32F407VE_black] -extends = stm32_variant_latest +extends = stm32_variant board = marlin_blackSTM32F407VET6 -build_flags = ${stm32_variant_latest.build_flags} +build_flags = ${stm32_variant.build_flags} -DUSBD_USE_CDC_COMPOSITE -DUSE_USB_FS # # STM32F407VET6 Opulo Lumen REV3 # [env:Opulo_Lumen_REV3] -extends = stm32_variant_latest +extends = stm32_variant board = marlin_opulo_lumen_rev3 -build_flags = ${stm32_variant_latest.build_flags} +build_flags = ${stm32_variant.build_flags} -DARDUINO_BLACK_F407VE -DUSBD_USE_CDC_COMPOSITE -DUSE_USB_FS -DHAS_STM32_UID -extra_scripts = ${stm32_variant_latest.extra_scripts} +extra_scripts = ${stm32_variant.extra_scripts} # # STM32F407VET6 Opulo Lumen REV4 # [env:Opulo_Lumen_REV4] -extends = stm32_variant_latest +extends = stm32_variant board = marlin_opulo_lumen_rev4 -build_flags = ${stm32_variant_latest.build_flags} +build_flags = ${stm32_variant.build_flags} -DARDUINO_BLACK_F407VE -DUSBD_USE_CDC_COMPOSITE -DUSE_USB_FS -DHAS_STM32_UID -extra_scripts = ${stm32_variant_latest.extra_scripts} +extra_scripts = ${stm32_variant.extra_scripts} # # Anet ET4-MB_V1.x/ET4P-MB_V1.x (STM32F407VGT6 ARM Cortex-M4) # [Anet_ET4] -extends = stm32_variant_latest +extends = stm32_variant board = marlin_STM32F407VGT6_CCM board_build.variant = MARLIN_F4x7Vx -build_flags = ${stm32_variant_latest.build_flags} +build_flags = ${stm32_variant.build_flags} -DHAL_SD_MODULE_ENABLED -DHAL_SRAM_MODULE_ENABLED -D_STM32_PLATDEFS=MARLIN_F4x7Vx -build_unflags = ${stm32_variant_latest.build_unflags} +build_unflags = ${stm32_variant.build_unflags} -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483 # @@ -210,11 +210,11 @@ extra_scripts = ${Anet_ET4.extra_scripts} # BigTreeTech SKR Pro (STM32F407ZGT6 ARM Cortex-M4) # [env:BTT_SKR_PRO] -extends = stm32_variant_latest +extends = stm32_variant board = marlin_BTT_SKR_Pro board_build.offset = 0x8000 board_build.offset_address = 0x08008000 -build_flags = ${stm32_variant_latest.build_flags} -DSTM32F407_5ZX +build_flags = ${stm32_variant.build_flags} -DSTM32F407_5ZX debug_tool = stlink upload_protocol = stlink @@ -231,12 +231,12 @@ build_unflags = ${env:BTT_SKR_PRO.build_unflags} -DUSBCON -DUSBD_USE_CDC # BigTreeTech E3 RRF (STM32F407VGT6 ARM Cortex-M4) # [env:BTT_E3_RRF] -extends = stm32_variant_latest +extends = stm32_variant board = marlin_STM32F407VGT6_CCM board_build.variant = MARLIN_BTT_E3_RRF board_build.offset = 0x8000 board_build.offset_address = 0x08008000 -build_flags = ${stm32_variant_latest.build_flags} +build_flags = ${stm32_variant.build_flags} -DSTM32F407_5VX -DMF_RX_BUFFER_SIZE=255 -DMF_TX_BUFFER_SIZE=255 @@ -246,12 +246,12 @@ build_flags = ${stm32_variant_latest.build_flags} # Mellow/Fly RRF E3 V1 (STM32F407VGT6 ARM Cortex-M4) # [env:FLY_RRF_E3_V1] -extends = stm32_variant_latest +extends = stm32_variant board = marlin_STM32F407VGT6_CCM #board_build.variant = MARLIN_BTT_E3_RRF board_build.offset = 0x8000 board_build.offset_address = 0x08008000 -build_flags = ${stm32_variant_latest.build_flags} +build_flags = ${stm32_variant.build_flags} -DSTM32F407_5VX -DMF_RX_BUFFER_SIZE=255 -DMF_TX_BUFFER_SIZE=255 @@ -260,11 +260,11 @@ build_flags = ${stm32_variant_latest.build_flags} # Bigtreetech GTR V1.0 (STM32F407IGT6 ARM Cortex-M4) # [env:BTT_GTR_V1_0] -extends = stm32_variant_latest +extends = stm32_variant board = marlin_BTT_GTR_v1 board_build.offset = 0x8000 board_build.offset_address = 0x08008000 -build_flags = ${stm32_variant_latest.build_flags} -DSTM32F407IX +build_flags = ${stm32_variant.build_flags} -DSTM32F407IX # # Bigtreetech GTR V1.0 (STM32F407IGT6 ARM Cortex-M4) with USB Flash Drive Support @@ -279,11 +279,11 @@ build_unflags = ${env:BTT_GTR_V1_0.build_unflags} -DUSBCON -DUSBD_USE_CDC # BigTreeTech BTT002 V1.0 (STM32F407VGT6 ARM Cortex-M4) # [env:BTT_BTT002] -extends = stm32_variant_latest +extends = stm32_variant board = marlin_BTT_BTT002 board_build.offset = 0x8000 board_build.offset_address = 0x08008000 -build_flags = ${stm32_variant_latest.build_flags} +build_flags = ${stm32_variant.build_flags} -DSTM32F407_5VX -DHAVE_HWSERIAL2 -DHAVE_HWSERIAL3 @@ -304,13 +304,13 @@ build_flags = -DUSE_USBHOST_HS -DUSE_USB_HS_IN_FS -DUSBD_IRQ_PRIO=5 -DUSBD_IRQ_S # BigTreeTech SKR V2.0 (STM32F407VGT6 ARM Cortex-M4) with USB Flash Drive Support # [env:STM32F407VG_btt] -extends = stm32_variant_latest +extends = stm32_variant platform_packages = ${stm_flash_drive.platform_packages} board = marlin_STM32F407VGT6_CCM board_build.variant = MARLIN_F4x7Vx board_build.offset = 0x8000 board_upload.offset_address = 0x08008000 -build_flags = ${stm32_variant_latest.build_flags} ${stm_flash_drive.build_flags} ${USB_HS_IN_FS.build_flags} +build_flags = ${stm32_variant.build_flags} ${stm_flash_drive.build_flags} ${USB_HS_IN_FS.build_flags} -DHSE_VALUE=8000000U -DHAL_SD_MODULE_ENABLED -DPIN_SERIAL3_RX=PD_9 -DPIN_SERIAL3_TX=PD_8 -D_STM32_PLATDEFS=MARLIN_F4x7Vx @@ -353,13 +353,13 @@ build_unflags = ${env:STM32F429VG_btt_USB.build_unflags} -Os -NDEBUG # BigTreeTech Octopus V1.0/1.1 / Octopus Pro V1.0 (STM32F446ZET6 ARM Cortex-M4) # [env:STM32F446ZE_btt] -extends = stm32_variant_latest +extends = stm32_variant board = marlin_BTT_Octopus_v1 board_build.offset = 0x8000 board_upload.offset_address = 0x08008000 debug_tool = stlink upload_protocol = stlink -build_flags = ${stm32_variant_latest.build_flags} +build_flags = ${stm32_variant.build_flags} -DSTM32F446_5VX -DUSE_USB_HS_IN_FS # @@ -376,13 +376,13 @@ build_flags = ${env:STM32F446ZE_btt.build_flags} ${stm_flash_drive.build_f # BigTreeTech Octopus V1.1 / Octopus Pro V1.0 (STM32F429ZGT6 ARM Cortex-M4) # [env:STM32F429ZG_btt] -extends = stm32_variant_latest +extends = stm32_variant board = marlin_BTT_Octopus_Pro_v1_F429 board_build.offset = 0x8000 board_upload.offset_address = 0x08008000 debug_tool = stlink upload_protocol = stlink -build_flags = ${stm32_variant_latest.build_flags} +build_flags = ${stm32_variant.build_flags} -DUSE_USB_HS_IN_FS # @@ -399,11 +399,11 @@ build_flags = ${env:STM32F429ZG_btt.build_flags} ${stm_flash_drive.build_f # BigTreeTech Octopus / Octopus Pro (STM32F407ZET6 ARM Cortex-M4) # [env:STM32F407ZE_btt] -extends = stm32_variant_latest +extends = stm32_variant board = marlin_STM32F407ZE board_build.offset = 0x8000 board_build.offset_address = 0x08008000 -build_flags = ${stm32_variant_latest.build_flags} +build_flags = ${stm32_variant.build_flags} -DUSE_USB_HS_IN_FS # @@ -419,18 +419,18 @@ build_flags = ${env:STM32F407ZE_btt.build_flags} ${stm_flash_drive.build_f # Lerdge base # [lerdge_common] -extends = stm32_variant_latest +extends = stm32_variant board = marlin_STM32F407ZGT6 board_build.variant = MARLIN_LERDGE board_build.crypt_lerdge = firmware.bin board_build.offset = 0x10000 board_build.offset_address = 0x08010000 -build_flags = ${stm32_variant_latest.build_flags} +build_flags = ${stm32_variant.build_flags} -DSTM32F4 -DSTM32F4xx -DTARGET_STM32F4 -DDISABLE_GENERIC_SERIALUSB -DARDUINO_ARCH_STM32 -DLERDGE_TFT35 -D_STM32_PLATDEFS=MARLIN_LERDGE -build_unflags = ${stm32_variant_latest.build_unflags} -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483 -extra_scripts = ${stm32_variant_latest.extra_scripts} +build_unflags = ${stm32_variant.build_unflags} -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483 +extra_scripts = ${stm32_variant.extra_scripts} buildroot/share/PlatformIO/scripts/lerdge.py # @@ -446,7 +446,7 @@ board_build.crypt_lerdge = Lerdge_X_firmware_force.bin [env:LERDGEX_usb_flash_drive] extends = env:LERDGEX platform_packages = ${stm_flash_drive.platform_packages} -build_flags = ${env:LERDGEX.build_flags} ${stm_flash_drive.build_flags} ${lerdge_common.build_flags} +build_flags = ${env:LERDGEX.build_flags} ${stm_flash_drive.build_flags} # # Lerdge S (STM32F407ZG) @@ -461,7 +461,7 @@ board_build.crypt_lerdge = Lerdge_firmware_force.bin [env:LERDGES_usb_flash_drive] extends = env:LERDGES platform_packages = ${stm_flash_drive.platform_packages} -build_flags = ${env:LERDGES.build_flags} ${stm_flash_drive.build_flags} ${lerdge_common.build_flags} +build_flags = ${env:LERDGES.build_flags} ${stm_flash_drive.build_flags} # # Lerdge K (STM32F407ZG) @@ -477,19 +477,19 @@ build_flags = ${lerdge_common.build_flags} -DLERDGEK [env:LERDGEK_usb_flash_drive] extends = env:LERDGEK platform_packages = ${stm_flash_drive.platform_packages} -build_flags = ${env:LERDGEK.build_flags} ${stm_flash_drive.build_flags} ${lerdge_common.build_flags} +build_flags = ${env:LERDGEK.build_flags} ${stm_flash_drive.build_flags} # # RUMBA32 # [env:rumba32] -extends = stm32_variant_latest +extends = stm32_variant platform_packages = platformio/tool-dfuutil@~1.11.0 board = rumba32_f446ve board_build.variant = MARLIN_F446VE board_build.offset = 0x0000 board_build.offset_address = 0x08000000 -build_flags = ${stm32_variant_latest.build_flags} +build_flags = ${stm32_variant.build_flags} -Os -DHAL_PCD_MODULE_ENABLED -DDISABLE_GENERIC_SERIALUSB -DHAL_UART_MODULE_ENABLED @@ -502,12 +502,12 @@ upload_protocol = dfu # STM32F407ZET6 ARM Cortex-M4 # [env:mks_robin2] -extends = stm32_variant_latest +extends = stm32_variant board = marlin_MKS_ROBIN2 board_build.offset = 0xC000 board_upload.offset_address = 0x0800C000 board_build.encrypt_mks = Robin2.bin -build_flags = ${stm32_variant_latest.build_flags} +build_flags = ${stm32_variant.build_flags} -DTARGET_STM32F4 -DSTM32F407_5ZX -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483 -DUSBD_PID=0x3748 -DUSB_PRODUCT=\"MKS_Robin2\" @@ -515,15 +515,15 @@ build_flags = ${stm32_variant_latest.build_flags} # MKS Robin Pro V2 (No bootloader!) # [env:mks_robin_pro2] -extends = stm32_variant_latest +extends = stm32_variant platform_packages = ${stm_flash_drive.platform_packages} board = genericSTM32F407VET6 board_build.variant = MARLIN_F4x7Vx board_build.offset = 0x0000 board_upload.offset_address = 0x08000000 -build_flags = ${stm32_variant_latest.build_flags} ${stm_flash_drive.build_flags} +build_flags = ${stm32_variant.build_flags} ${stm_flash_drive.build_flags} -D_STM32_PLATDEFS=MARLIN_F4x7Vx -build_unflags = ${stm32_variant_latest.build_unflags} -DUSBCON -DUSBD_USE_CDC +build_unflags = ${stm32_variant.build_unflags} -DUSBCON -DUSBD_USE_CDC debug_tool = jlink upload_protocol = jlink @@ -537,13 +537,13 @@ build_flags = -DPIN_WIRE_SCL=PB6 -DPIN_WIRE_SDA=PB7 # MKS Robin Nano V3 # [env:mks_robin_nano_v3] -extends = stm32_variant_latest +extends = stm32_variant board = marlin_STM32F407VGT6_CCM board_build.variant = MARLIN_F4x7Vx board_build.offset = 0xC000 board_upload.offset_address = 0x0800C000 board_build.rename = Robin_nano_v3.bin -build_flags = ${stm32_variant_latest.build_flags} ${stm32f4_I2C1.build_flags} +build_flags = ${stm32_variant.build_flags} ${stm32f4_I2C1.build_flags} -DHAL_PCD_MODULE_ENABLED -D_STM32_PLATDEFS=MARLIN_F4x7Vx debug_tool = jlink @@ -593,13 +593,13 @@ board = marlin_STM32F407VET6_CCM # 5 TMC2209 uart mode on board # [env:mks_eagle] -extends = stm32_variant_latest +extends = stm32_variant board = marlin_STM32F407VGT6_CCM board_build.variant = MARLIN_F4x7Vx board_build.offset = 0xC000 board_upload.offset_address = 0x0800C000 board_build.rename = mks_eagle.bin -build_flags = ${stm32_variant_latest.build_flags} ${stm32f4_I2C1.build_flags} +build_flags = ${stm32_variant.build_flags} ${stm32f4_I2C1.build_flags} -DHAL_PCD_MODULE_ENABLED -DSTM32_FLASH_SIZE=512 -D_STM32_PLATDEFS=MARLIN_F4x7Vx @@ -633,13 +633,13 @@ build_flags = -DPIN_WIRE_SCL=PB8 -DPIN_WIRE_SDA=PB9 # MKS Monster8 V1 / V2 (STM32F407VET6 ARM Cortex-M4) # [env:mks_monster8] -extends = stm32_variant_latest +extends = stm32_variant board = marlin_STM32F407VGT6_CCM board_build.variant = MARLIN_F4x7Vx board_build.offset = 0xC000 board_upload.offset_address = 0x0800C000 board_build.rename = mks_monster8.bin -build_flags = ${stm32_variant_latest.build_flags} ${stm32f4_I2C1_CAN.build_flags} +build_flags = ${stm32_variant.build_flags} ${stm32f4_I2C1_CAN.build_flags} -DHAL_PCD_MODULE_ENABLED -DTIMER_SERIAL=TIM4 -DSTM32_FLASH_SIZE=512 -D_STM32_PLATDEFS=MARLIN_F4x7Vx @@ -667,10 +667,10 @@ build_unflags = -DUSBD_USE_CDC # TH3D EZBoard v2.0 (STM32F405RGT6 ARM Cortex-M4) # [TH3D_EZBoard_V2] -extends = stm32_variant_latest +extends = stm32_variant board = genericSTM32F405RG board_build.variant = MARLIN_TH3D_EZBOARD_V2 -build_flags = ${stm32_variant_latest.build_flags} -DHSE_VALUE=12000000U -O0 +build_flags = ${stm32_variant.build_flags} -DHSE_VALUE=12000000U -O0 -D_STM32_PLATDEFS=MARLIN_TH3D_EZBOARD_V2 # @@ -693,13 +693,13 @@ extra_scripts = ${TH3D_EZBoard_V2.extra_scripts} buildroot/share/PlatformIO/scripts/openblt.py [mks_robin_nano_v1_3_f4_common] -extends = stm32_variant_latest +extends = stm32_variant board = marlin_STM32F407VGT6_CCM board_build.variant = MARLIN_F4x7Vx board_build.offset = 0x8000 board_upload.offset_address = 0x08008000 board_build.rename = Robin_nano35.bin -build_flags = ${stm32_variant_latest.build_flags} +build_flags = ${stm32_variant.build_flags} -D_STM32_PLATDEFS=MARLIN_F4x7Vx debug_tool = jlink upload_protocol = jlink @@ -708,14 +708,14 @@ upload_protocol = jlink # MKS Neptune X # [env:mks_neptune_x] -extends = stm32_variant_latest +extends = stm32_variant board = marlin_STM32F407VGT6_CCM board_build.variant = MARLIN_F4x7Vx board_build.offset = 0xC000 board_upload.offset_address = 0x0800C000 board_build.rename = elegoo.bin platform_packages = ${stm_flash_drive.platform_packages} -build_flags = ${stm32_variant_latest.build_flags} ${stm32f4_I2C1.build_flags} +build_flags = ${stm32_variant.build_flags} ${stm32f4_I2C1.build_flags} ${stm_flash_drive.build_flags} ${USB_HS_IN_FS.build_flags} -DHAL_PCD_MODULE_ENABLED -DHAL_SD_MODULE_ENABLED -DHAL_SRAM_MODULE_ENABLED -DMCU_STM32F407VE -DSS_TIMER=4 -DENABLE_HWSERIAL3 @@ -728,19 +728,19 @@ upload_protocol = jlink # MKS Neptune 3 # [env:mks_neptune_3] -extends = stm32_variant_latest +extends = stm32_variant board = marlin_STM32F407VGT6_CCM board_build.variant = MARLIN_F4x7Vx board_build.offset = 0xC000 board_upload.offset_address = 0x0800C000 board_build.rename = ZNP_ROBIN_NANO.bin platform_packages = ${stm_flash_drive.platform_packages} -build_flags = ${stm32_variant_latest.build_flags} +build_flags = ${stm32_variant.build_flags} -DMCU_STM32F407VE -DSS_TIMER=4 -DENABLE_HWSERIAL3 -DSTM32_FLASH_SIZE=512 -DTIMER_TONE=TIM3 -DTIMER_SERVO=TIM2 -DHAL_SD_MODULE_ENABLED -DHAL_SRAM_MODULE_ENABLED -build_unflags = ${stm32_variant_latest.build_unflags} +build_unflags = ${stm32_variant.build_unflags} -DUSBCON -DUSBD_USE_CDC debug_tool = jlink upload_protocol = jlink @@ -781,28 +781,28 @@ board_build.rename = elegoo.bin # Artillery Ruby # [env:Artillery_Ruby] -extends = common_stm32_latest +extends = common_stm32 board = marlin_Artillery_Ruby -build_flags = ${common_stm32_latest.build_flags} +build_flags = ${common_stm32.build_flags} -DSTM32F401xC -DTARGET_STM32F4 -DDISABLE_GENERIC_SERIALUSB -DARDUINO_ARCH_STM32 -DUSBD_USE_CDC_COMPOSITE -DUSE_USB_FS -DUSB_PRODUCT=\"Artillery_3D_Printer\" -DFLASH_DATA_SECTOR=1U -DFLASH_BASE_ADDRESS=0x08004000 -extra_scripts = ${common_stm32_latest.extra_scripts} +extra_scripts = ${common_stm32.extra_scripts} pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py # # Ender-3 S1 STM32F401RC_creality # [STM32F401RC_creality_base] -extends = stm32_variant_latest +extends = stm32_variant board = genericSTM32F401RC board_build.variant = MARLIN_F401RC_CREALITY -build_flags = ${stm32_variant_latest.build_flags} -DMCU_STM32F401RC -DSTM32F4 +build_flags = ${stm32_variant.build_flags} -DMCU_STM32F401RC -DSTM32F4 -DSS_TIMER=4 -DTIMER_SERVO=TIM5 -DENABLE_HWSERIAL3 -DTRANSFER_CLOCK_DIV=8 -D_STM32_PLATDEFS=MARLIN_F401RC_CREALITY -build_unflags = ${stm32_variant_latest.build_unflags} -DUSBCON -DUSBD_USE_CDC +build_unflags = ${stm32_variant.build_unflags} -DUSBCON -DUSBD_USE_CDC monitor_speed = 115200 [env:STM32F401RC_creality] @@ -832,13 +832,13 @@ upload_protocol = stlink # Ender-5 S1 STM32F401RE_creality (CR4NS200141C13 with STM32F401RET6) # [env:STM32F401RE_creality] -extends = stm32_variant_latest +extends = stm32_variant board = marlin_STM32F401RE_creality board_build.offset = 0x10000 board_upload.offset_address = 0x08010000 board_build.rename = firmware-{date}-{time}.bin -build_flags = ${stm32_variant_latest.build_flags} -DSTM32F401xE -DSTM32F4 -DSTM32F4_UPDATE_FOLDER -build_unflags = ${stm32_variant_latest.build_unflags} -DUSBCON -DUSBD_USE_CDC +build_flags = ${stm32_variant.build_flags} -DSTM32F401xE -DSTM32F4 -DSTM32F4_UPDATE_FOLDER +build_unflags = ${stm32_variant.build_unflags} -DUSBCON -DUSBD_USE_CDC monitor_speed = 115200 [env:STM32F401RE_creality_jlink] @@ -855,15 +855,15 @@ upload_protocol = stlink # STM32F401RE_freeruns Creality E3 Free-runs Silent Motherboard # [env:STM32F401RE_freeruns] -extends = stm32_variant_latest +extends = stm32_variant board = marlin_STM32F401RE_freeruns board_build.offset = 0x10000 board_upload.offset_address = 0x08010000 board_build.rename = firmware-{date}-{time}.bin -build_flags = ${stm32_variant_latest.build_flags} -DSTM32F401xE +build_flags = ${stm32_variant.build_flags} -DSTM32F401xE -DSS_TIMER=4 -DTIMER_SERVO=TIM5 -DTRANSFER_CLOCK_DIV=8 -build_unflags = ${stm32_variant_latest.build_unflags} -DUSBCON -DUSBD_USE_CDC +build_unflags = ${stm32_variant.build_unflags} -DUSBCON -DUSBD_USE_CDC monitor_speed = 115200 [env:STM32F401RE_freeruns_jlink] @@ -880,14 +880,14 @@ upload_protocol = stlink # BigTree SKR mini E3 V3.0.1 (STM32F401RCT6 ARM Cortex-M4) # [env:STM32F401RC_btt] -extends = stm32_variant_latest +extends = stm32_variant platform = ststm32@~14.1.0 platform_packages = framework-arduinoststm32@~4.20600.231001 toolchain-gccarmnoneeabi@1.100301.220327 board = marlin_STM32F401RC board_build.offset = 0x4000 board_upload.offset_address = 0x08004000 -build_flags = ${stm32_variant_latest.build_flags} +build_flags = ${stm32_variant.build_flags} -DPIN_SERIAL6_RX=PC_7 -DPIN_SERIAL6_TX=PC_6 -DSERIAL_RX_BUFFER_SIZE=1024 -DSERIAL_TX_BUFFER_SIZE=1024 -DTIMER_SERVO=TIM3 -DTIMER_TONE=TIM4 @@ -913,7 +913,7 @@ upload_protocol = custom # MKS SKIPR v1.0 all-in-one board (STM32F407VE) # [env:mks_skipr_v1] -extends = stm32_variant_latest +extends = stm32_variant board = marlin_MKS_SKIPR_V1 board_build.rename = mks_skipr.bin @@ -930,17 +930,17 @@ upload_command = dfu-util -a 0 -s 0x08000000:leave -D "$SOURCE" # TRONXY_CXY_446_V10 (STM32F446ZET6 ARM Cortex-M4) # [env:TRONXY_CXY_446_V10] -extends = stm32_variant_latest +extends = stm32_variant board = marlin_STM32F446ZET_tronxy board_build.ldscript = buildroot/share/PlatformIO/variants/MARLIN_F446Zx_TRONXY/ldscript.ld board_build.offset = 0x10000 board_build.offset_address = 0x08010000 -build_flags = ${stm32_variant_latest.build_flags} -DSTM32F4xx +build_flags = ${stm32_variant.build_flags} -DSTM32F4xx -DUSE_USB_HS -DUSE_USB_HS_IN_FS -build_unflags = ${stm32_variant_latest.build_unflags} -fno-rtti +build_unflags = ${stm32_variant.build_unflags} -fno-rtti -fno-threadsafe-statics -fno-exceptions -DUSBD_USE_CDC -DUSBCON -extra_scripts = ${stm32_variant_latest.extra_scripts} +extra_scripts = ${stm32_variant.extra_scripts} buildroot/share/PlatformIO/scripts/tronxy_cxy_446_v10.py # @@ -954,8 +954,8 @@ platform_packages = ${stm_flash_drive.platform_packages} # Blackpill # [env:STM32F401CD_blackpill_stlink] -platform = ${common_stm32_latest.platform} -extends = common_stm32_latest +platform = ${common_stm32.platform} +extends = common_stm32 board = blackpill_f401cc upload_protocol = stlink monitor_speed = 115200 @@ -964,11 +964,11 @@ monitor_speed = 115200 # I3Dbeez9 (STM32F407ZGT6 ARM Cortex-M4) # [env:I3DBEEZ9_V1] -extends = stm32_variant_latest +extends = stm32_variant board = marlin_I3DBEEZ9 board_build.offset = 0x8000 board_build.offset_address = 0x08008000 -build_flags = ${stm32_variant_latest.build_flags} -DSTM32F407_5ZX +build_flags = ${stm32_variant.build_flags} -DSTM32F407_5ZX debug_tool = stlink upload_protocol = stlink @@ -976,12 +976,12 @@ upload_protocol = stlink # BlackBeezMini (blackpill_f401cc) # [env:BLACKBEEZMINI_V1] -extends = common_stm32_latest +extends = common_stm32 platform_packages = platformio/tool-dfuutil@~1.11.0 board = blackpill_f401cc board_build.offset = 0x0000 board_build.offset_address = 0x08000000 -build_flags = ${common_stm32_latest.build_flags} +build_flags = ${common_stm32.build_flags} -Os -DHAL_PCD_MODULE_ENABLED -DHAL_UART_MODULE_ENABLED monitor_speed = 250000 @@ -991,12 +991,12 @@ upload_protocol = dfu # Mellow Fly E3 V2 (STM32F407VGT6 ARM Cortex-M4) # [env:FLY_E3_V2] -extends = stm32_variant_latest +extends = stm32_variant board = marlin_STM32F407VGT6_CCM board_build.variant = MARLIN_F4x7Vx board_build.offset = 0x8000 board_upload.offset_address = 0x08008000 -build_flags = ${stm32_variant_latest.build_flags} ${USB_HS_IN_FS.build_flags} +build_flags = ${stm32_variant.build_flags} ${USB_HS_IN_FS.build_flags} -DHAVE_HWSERIAL1 -DHAVE_HWSERIAL3 -DPIN_SERIAL1_RX=PA_10 -DPIN_SERIAL1_TX=PA_9 -DPIN_SERIAL3_RX=PD_9 -DPIN_SERIAL3_TX=PD_8 @@ -1008,12 +1008,12 @@ upload_protocol = stlink # XTLW3D Climber-8th-F4 (STM32F407VGT6 ARM Cortex-M4) # [env:XTLW_CLIMBER_8TH] -extends = stm32_variant_latest +extends = stm32_variant platform_packages = ${stm_flash_drive.platform_packages} board = marlin_STM32F407VGT6_CCM board_build.variant = MARLIN_F4x7Vx board_build.offset = 0x8000 board_upload.offset_address = 0x08008000 -build_flags = ${stm32_variant_latest.build_flags} ${stm_flash_drive.build_flags} ${USB_HS_IN_FS.build_flags} +build_flags = ${stm32_variant.build_flags} ${stm_flash_drive.build_flags} ${USB_HS_IN_FS.build_flags} -DHSE_VALUE=8000000U -DHAL_SD_MODULE_ENABLED -DPIN_SERIAL3_RX=PD_9 -DPIN_SERIAL3_TX=PD_8 diff --git a/ini/stm32f7.ini b/ini/stm32f7.ini index 32c71f9b5b78..62755c846d47 100644 --- a/ini/stm32f7.ini +++ b/ini/stm32f7.ini @@ -25,13 +25,13 @@ # being readily available based on STM32F7 MCUs # [env:NUCLEO_F767ZI] -extends = common_stm32_latest +extends = common_stm32 board = nucleo_f767zi -build_flags = ${common_stm32_latest.build_flags} -DTIMER_SERIAL=TIM9 +build_flags = ${common_stm32.build_flags} -DTIMER_SERIAL=TIM9 # # REMRAM_V1 # [env:REMRAM_V1] -extends = common_stm32_latest +extends = common_stm32 board = remram_v1