From 9fb7f75bfbace5790e866c065f768181e896685d Mon Sep 17 00:00:00 2001 From: Sergey Date: Fri, 17 Sep 2021 17:40:48 +0300 Subject: [PATCH] Robin Nano v1.3 fix --- Marlin/src/module/mks_wifi/mks_wifi_sd.cpp | 7 +++++++ ini/stm32f4.ini | 13 +++++++++---- platformio.ini | 2 +- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Marlin/src/module/mks_wifi/mks_wifi_sd.cpp b/Marlin/src/module/mks_wifi/mks_wifi_sd.cpp index 5f868048b4..58df40f01d 100644 --- a/Marlin/src/module/mks_wifi/mks_wifi_sd.cpp +++ b/Marlin/src/module/mks_wifi/mks_wifi_sd.cpp @@ -201,6 +201,10 @@ void mks_wifi_start_file_upload(ESP_PROTOC_FRAME *packet){ #endif #ifdef STM32F4 + + RCC->APB1ENR &= ~RCC_APB1ENR_TIM5EN; + RCC->APB2ENR &= ~RCC_APB2ENR_TIM10EN; + DMA2_Stream5->CR = 0; DMA2->HIFCR=DMA_S5_CLEAR; @@ -356,6 +360,9 @@ void mks_wifi_start_file_upload(ESP_PROTOC_FRAME *packet){ #endif #ifdef STM32F4 + RCC->APB1ENR |= RCC_APB1ENR_TIM5EN; + RCC->APB2ENR |= RCC_APB2ENR_TIM10EN; + SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk; #endif diff --git a/ini/stm32f4.ini b/ini/stm32f4.ini index 40b465c47b..d152b6e6d6 100644 --- a/ini/stm32f4.ini +++ b/ini/stm32f4.ini @@ -358,17 +358,22 @@ build_flags = -DPIN_WIRE_SCL=PB6 -DPIN_WIRE_SDA=PB7 [env:mks_robin_nano_v1_3] platform = ${common_stm32.platform} extends = stm32_variant -board = marlin_STM32F407VE -board_build.variant = MARLIN_F4_FSMC_SDIO +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.build_flags} - -DHAL_PCD_MODULE_ENABLED -DHAL_SD_MODULE_ENABLED -DHAL_SRAM_MODULE_ENABLED + -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} + -DUSBCON -DUSBD_USE_CDC debug_tool = jlink upload_protocol = jlink - # # MKS Robin Nano V3 # diff --git a/platformio.ini b/platformio.ini index d4352a2379..33973531ab 100644 --- a/platformio.ini +++ b/platformio.ini @@ -13,7 +13,7 @@ [platformio] src_dir = Marlin boards_dir = buildroot/share/PlatformIO/boards -default_envs = mks_robin_nano35 +default_envs = mks_robin_nano_v1_3 include_dir = Marlin extra_configs = ini/avr.ini