From 50ba20fe1f27cdcb0f0f98f11cb42248dbc186f7 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Thu, 29 Oct 2020 04:01:25 -0300 Subject: [PATCH] PIO env for MKS Nano boards in STM32 (#19905) --- .../src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h | 2 +- platformio.ini | 32 ++++++++++++++++--- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h index b1e49f4d9f..fbd12fb59c 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h @@ -25,7 +25,7 @@ * MKS Robin nano (STM32F130VET6) board pin assignments */ -#if NOT_TARGET(__STM32F1__) +#if NOT_TARGET(__STM32F1__, STM32F1) #error "Oops! Select an STM32F1 board in 'Tools > Board.'" #elif HOTENDS > 2 || E_STEPPERS > 2 #error "MKS Robin nano supports up to 2 hotends / E-steppers. Comment out this line to continue." diff --git a/platformio.ini b/platformio.ini index 3e565e6c4e..b052a26b58 100644 --- a/platformio.ini +++ b/platformio.ini @@ -1310,17 +1310,39 @@ build_flags = ${lerdge_common.build_flags} # RUMBA32 # [env:rumba32] -platform = ${common_stm32.platform} -extends = common_stm32 -build_flags = ${common_stm32.build_flags} +platform = ${common_stm32.platform} +extends = common_stm32 +build_flags = ${common_stm32.build_flags} -Os -DHAL_PCD_MODULE_ENABLED -DDISABLE_GENERIC_SERIALUSB -DHAL_UART_MODULE_ENABLED -DTIMER_SERIAL=TIM9 -board = rumba32_f446ve +board = rumba32_f446ve upload_protocol = dfu -monitor_speed = 500000 +monitor_speed = 500000 + +# +# MKS Robin Nano V1.2 and V2 using hal STM32 +# +[env:mks_robin_nano35_stm32] +platform = ${common_stm32.platform} +extends = common_stm32 +build_flags = ${common_stm32.build_flags} -DMCU_STM32F103VE -DSS_TIMER=4 -DENABLE_HWSERIAL3 -DTRANSFER_CLOCK_DIV=8 +board = genericSTM32F103VE +board_build.core = stm32 +board_build.variant = MARLIN_F103Vx +board_build.ldscript = ldscript.ld +board_build.offset = 0x7000 +board_build.firmware = Robin_nano35.bin +board_upload.offset_address = 0x08007000 +build_unflags = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC +debug_tool = jlink +upload_protocol = jlink +extra_scripts = ${common.extra_scripts} + pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py + buildroot/share/PlatformIO/scripts/stm32_bootloader.py + buildroot/share/PlatformIO/scripts/mks_encrypt.py ################################# # #