Trying to port Repetier-Firmware to Creality3D Silent Board V.4.2.7 but stuck....
Hi guys,
I've tried to get rid of Marlin 2.0.7 on my Ender 5 with the silent board V.4.2.7 which features a STM32F103RET6. But I'm to dump to get to the next level...
What did I do 'till now?
I searched for all pins used by Marlin and put 'em in a new file creality_v4_2_7.h under ...\Repetier-Firmware-dev2\src\Repetier\src\boards\STM32F1\boards
I tried to add a new environment env:STM32F103RET6_creallity (same as in Marlin PlatformIO-project)
I tried to get all linking and compiling arguments and parameters out of Marlin scripts.
But the only effect is that I crashed my repetier-PlatformIO-project. There seems to be a gap of information (HAL?) I'm unable to close.
This is what I borrowed from my active Marlin firmware and ported to Repetier in creality_v4_2_7.h (copy of the skr_mini-files):
#pragma once
#ifndef STM32F1
#error "Oops! Select creality_v4_2_7 in platformio.ini -> default_envs"
#endif
#ifndef Serial
#define Serial SerialUSB
#endif
#ifndef SDSUPPORT
#define SDSUPPORT true
#endif
#define CPU_ARCH ARCH_ARM
#define MAX_RAM 47960
// Steppers
#define ORIG_X_STEP_PIN PB9
#define ORIG_X_DIR_PIN PC2
#define ORIG_X_ENABLE_PIN PC3
#define ORIG_X_MIN_PIN NO_PIN
#define ORIG_X_MAX_PIN PA5
#define ORIG_Y_STEP_PIN PB7
#define ORIG_Y_DIR_PIN PB8
#define ORIG_Y_ENABLE_PIN PC3
#define ORIG_Y_MIN_PIN NO_PIN
#define ORIG_Y_MAX_PIN PA6
#define ORIG_Z_STEP_PIN PB5
#define ORIG_Z_DIR_PIN PB6
#define ORIG_Z_ENABLE_PIN PC3
#define ORIG_Z_MIN_PIN NO_PIN
#define ORIG_Z_MAX_PIN PA7
#define ORIG_E0_STEP_PIN PB3
#define ORIG_E0_DIR_PIN PB4
#define ORIG_E0_ENABLE_PIN PC3
//#define ORIG_E0_MIN_PIN PC15 // E0-STOP
//#define X_SW_SERIAL_TMC_PIN PB15
//#define Y_SW_SERIAL_TMC_PIN PC6
//#define Z_SW_SERIAL_TMC_PIN PC10
//#define E0_SW_SERIAL_TMC_PIN PC11
//#define TMC_SW_SERIAL_BAUD 57600
//#define SERVO_1_PIN PC6
//#define BLTOUCH_Z_MIN PB0
// Temperature Sensors
#define TEMP_0_PIN PC5 // HOTEND
#define TEMP_1_PIN PC4 // BED
#define TEMP_CPU ADC_CHANNEL_TEMPSENSOR
#define VREF_CPU ADC_CHANNEL_VREFINT
// Heaters / Fans
#define HEATER_0_PIN PA1
#define HEATER_1_PIN PA2
#define ORIG_FAN_PIN PA0
#define EEPROM_PAGE_SIZE FLASH_PAGE_SIZE // page write buffer size
// Creality's bootloader seems to use up around 28kb?
#define FLASH_START 0x08007000ul
#ifndef STM32_FLASH_SIZE
#define STM32_FLASH_SIZE 256
#endif
#ifndef FLASH_SIZE
#define FLASH_SIZE (STM32_FLASH_SIZE == 512 ? 0x0080000ul : 0x0040000ul)
#endif
#ifndef FLASH_EEPROM_SIZE
#define FLASH_EEPROM_SIZE EEPROM_BYTES * 8
#endif
#if SDSUPPORT
#ifndef EEPROM_MODE
#define EEPROM_MODE EEPROM_SDCARD
#endif
#ifndef EEPROM_AVAILABLE
#define EEPROM_AVAILABLE EEPROM_SDCARD
#endif
#else
#ifndef EEPROM_MODE
#define EEPROM_MODE EEPROM_FLASH
#endif
#ifndef EEPROM_AVAILABLE
#define EEPROM_AVAILABLE EEPROM_FLASH
#endif
#endif
#ifndef EEPROM_MODE
#define EEPROM_MODE EEPROM_NONE
#endif
#ifndef EEPROM_AVAILABLE
#define EEPROM_AVAILABLE EEPROM_NONE
#endif
//
// Misc. Functions
//
#ifndef SDSS
#define SDSS PA4
#endif
#define ORIG_SDCARDDETECT PC7
#define SDCARDDETECTINVERTED false
//#define STATUS_LED_PIN PA15 // Small PCB LED
//#define NEOPIXEL_PIN PC7
// LCD / Controller RET6_12864_LCD
#ifndef CUSTOM_CONTROLLER_PINS
#if FEATURE_CONTROLLER != CONTROLLER_NONE
#define BEEPER_PIN PC6
#define UI_ENCODER_A PB10
#define UI_ENCODER_B PB14
#define UI_ENCODER_CLICK PB2
#define UI_DISPLAY_ENABLE_PIN PB15 // SW SPI MOSI
#define UI_DISPLAY_RS_PIN PB12 // SW SPI CS
#define UI_DISPLAY_D4_PIN PB13 // SW SPI SCK
#define UI_DISPLAY_D5_PIN NO_PIN // NOT USED
#endif
#endif
/* // Moses - for debugging stm32f1 hal only
#define ENABLE_SOFTWARE_SPI_CLASS 1
#define SD_SOFT_MISO_PIN PA6
#define SD_SOFT_MOSI_PIN PA7
#define SD_SOFT_SCK_PIN PA5
*/
#define ORIG_PS_ON_PIN NO_PIN
#define LED_PIN STATUS_LED_PIN
#ifndef TWI_CLOCK_FREQ
#define TWI_CLOCK_FREQ 0
#endif
#define SDPOWER -1
#ifndef STM32F1
#error "Oops! Select creality_v4_2_7 in platformio.ini -> default_envs"
#endif
#ifndef Serial
#define Serial SerialUSB
#endif
#ifndef SDSUPPORT
#define SDSUPPORT true
#endif
#define CPU_ARCH ARCH_ARM
#define MAX_RAM 47960
// Steppers
#define ORIG_X_STEP_PIN PB9
#define ORIG_X_DIR_PIN PC2
#define ORIG_X_ENABLE_PIN PC3
#define ORIG_X_MIN_PIN NO_PIN
#define ORIG_X_MAX_PIN PA5
#define ORIG_Y_STEP_PIN PB7
#define ORIG_Y_DIR_PIN PB8
#define ORIG_Y_ENABLE_PIN PC3
#define ORIG_Y_MIN_PIN NO_PIN
#define ORIG_Y_MAX_PIN PA6
#define ORIG_Z_STEP_PIN PB5
#define ORIG_Z_DIR_PIN PB6
#define ORIG_Z_ENABLE_PIN PC3
#define ORIG_Z_MIN_PIN NO_PIN
#define ORIG_Z_MAX_PIN PA7
#define ORIG_E0_STEP_PIN PB3
#define ORIG_E0_DIR_PIN PB4
#define ORIG_E0_ENABLE_PIN PC3
//#define ORIG_E0_MIN_PIN PC15 // E0-STOP
//#define X_SW_SERIAL_TMC_PIN PB15
//#define Y_SW_SERIAL_TMC_PIN PC6
//#define Z_SW_SERIAL_TMC_PIN PC10
//#define E0_SW_SERIAL_TMC_PIN PC11
//#define TMC_SW_SERIAL_BAUD 57600
//#define SERVO_1_PIN PC6
//#define BLTOUCH_Z_MIN PB0
// Temperature Sensors
#define TEMP_0_PIN PC5 // HOTEND
#define TEMP_1_PIN PC4 // BED
#define TEMP_CPU ADC_CHANNEL_TEMPSENSOR
#define VREF_CPU ADC_CHANNEL_VREFINT
// Heaters / Fans
#define HEATER_0_PIN PA1
#define HEATER_1_PIN PA2
#define ORIG_FAN_PIN PA0
#define EEPROM_PAGE_SIZE FLASH_PAGE_SIZE // page write buffer size
// Creality's bootloader seems to use up around 28kb?
#define FLASH_START 0x08007000ul
#ifndef STM32_FLASH_SIZE
#define STM32_FLASH_SIZE 256
#endif
#ifndef FLASH_SIZE
#define FLASH_SIZE (STM32_FLASH_SIZE == 512 ? 0x0080000ul : 0x0040000ul)
#endif
#ifndef FLASH_EEPROM_SIZE
#define FLASH_EEPROM_SIZE EEPROM_BYTES * 8
#endif
#if SDSUPPORT
#ifndef EEPROM_MODE
#define EEPROM_MODE EEPROM_SDCARD
#endif
#ifndef EEPROM_AVAILABLE
#define EEPROM_AVAILABLE EEPROM_SDCARD
#endif
#else
#ifndef EEPROM_MODE
#define EEPROM_MODE EEPROM_FLASH
#endif
#ifndef EEPROM_AVAILABLE
#define EEPROM_AVAILABLE EEPROM_FLASH
#endif
#endif
#ifndef EEPROM_MODE
#define EEPROM_MODE EEPROM_NONE
#endif
#ifndef EEPROM_AVAILABLE
#define EEPROM_AVAILABLE EEPROM_NONE
#endif
//
// Misc. Functions
//
#ifndef SDSS
#define SDSS PA4
#endif
#define ORIG_SDCARDDETECT PC7
#define SDCARDDETECTINVERTED false
//#define STATUS_LED_PIN PA15 // Small PCB LED
//#define NEOPIXEL_PIN PC7
// LCD / Controller RET6_12864_LCD
#ifndef CUSTOM_CONTROLLER_PINS
#if FEATURE_CONTROLLER != CONTROLLER_NONE
#define BEEPER_PIN PC6
#define UI_ENCODER_A PB10
#define UI_ENCODER_B PB14
#define UI_ENCODER_CLICK PB2
#define UI_DISPLAY_ENABLE_PIN PB15 // SW SPI MOSI
#define UI_DISPLAY_RS_PIN PB12 // SW SPI CS
#define UI_DISPLAY_D4_PIN PB13 // SW SPI SCK
#define UI_DISPLAY_D5_PIN NO_PIN // NOT USED
#endif
#endif
/* // Moses - for debugging stm32f1 hal only
#define ENABLE_SOFTWARE_SPI_CLASS 1
#define SD_SOFT_MISO_PIN PA6
#define SD_SOFT_MOSI_PIN PA7
#define SD_SOFT_SCK_PIN PA5
*/
#define ORIG_PS_ON_PIN NO_PIN
#define LED_PIN STATUS_LED_PIN
#ifndef TWI_CLOCK_FREQ
#define TWI_CLOCK_FREQ 0
#endif
#define SDPOWER -1
Any hints or someone who knows what to do? Or is there anyone who can use this as a starting point for integration in repetier-dev2?
Greetings
Ingo
Comments
> I tried to get all linking and compiling arguments and parameters out of Marlin scripts.
The platformio settings from marlin are likely to not work. They contain much "special" clutter for marlin files etc. Better use skr_mini_e3_v1_2 as starting point, which has our clutter and is also for STM32F1 based boards. Most important is to have
adjusted and that the board description exists. Actually that board already uses stm32f103rct6 cpu so using that identifyer should most likely already work if you combine it with your board.
In constants add your board with id 2503 to be in STM32F1 id range and add a include in src/boards/STM32F1/pins.h
so that it gets found when you select it as motherboard.
Then compilation should work if your config uses no unknown identifiers.