From d949cbf29a39ba69170d49f7bfa97114ad728b9e Mon Sep 17 00:00:00 2001 From: Filip Ayazi Date: Sun, 18 Jul 2021 04:53:57 +0100 Subject: [PATCH] Add example stm32 bluepill setup --- platformio.ini | 10 +++++++++- src/boards.h | 18 ++++++++++++++---- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/platformio.ini b/platformio.ini index 4fe113c..c24ad32 100644 --- a/platformio.ini +++ b/platformio.ini @@ -39,4 +39,12 @@ build_flags = -D MCU_PICO platform = ststm32 board = bluepill_f103c8 upload_protocol = stlink -build_flags = -D MCU_BLUEPILL \ No newline at end of file +build_flags = + -D MCU_BLUEPILL + -D PIO_FRAMEWORK_ARDUINO_ENABLE_CDC + -D USBCON + -D USBD_VID=0x0483 + -D USBD_PID=0x5740 + -D USB_MANUFACTURER="Unknown" + -D USB_PRODUCT="\"BLUEPILL_F103C8\"" + -D HAL_PCD_MODULE_ENABLED \ No newline at end of file diff --git a/src/boards.h b/src/boards.h index f4da46e..4286234 100644 --- a/src/boards.h +++ b/src/boards.h @@ -1,10 +1,12 @@ #ifdef BOARD_AUTO #ifdef MCU_LEONARDO #define BOARD_SANGABOARDv3 - #define BOARD_STRING "Sangaboard v0.3" - #elif defined(MCU_NANO) || defined(MCU_PICO) || defined(MCU_BLUEPILL) + #elif defined(MCU_NANO) #define BOARD_SANGABOARDv2 - #define BOARD_STRING "Sangaboard v0.2" + #elif defined(MCU_BLUEPILL) + #define BOARD_CUSTOM_BLUEPILL + #elif defined(MCU_PICO) + #define BOARD_CUSTOM #else #error "Invalid build config - must specify MCU type" #endif @@ -28,8 +30,16 @@ #define ENDSTOPS_PULLUPS true #define WIRING_ENDSTOPS_MIN {A0,A1,A2} #define WIRING_ENDSTOPS_MAX {A3,A4,A5} +#elif defined(BOARD_CUSTOM_BLUEPILL) + #define BOARD_STRING "Custom Bluepill board" + #define WIRING_MOTOR_X PB11, PB10, PB1, PB0 + #define WIRING_MOTOR_Y PA7, PA6, PA5, PA4 + #define WIRING_MOTOR_Z PA3, PA2, PA1, PA0 + #define ENDSTOPS_INVERT false + #define ENDSTOPS_PULLUPS true + #define WIRING_ENDSTOPS_MIN {A0,A1,A2} + #define WIRING_ENDSTOPS_MAX {A3,A4,A5} #else - //custom board #define BOARD_STRING "Custom board" #define WIRING_MOTOR_X 13, 12, 11, 10 #define WIRING_MOTOR_Y 9, 8, 7, 6