Skip to content

Commit

Permalink
Fix Creality E3 "Free-runs" (MarlinFirmware#26533)
Browse files Browse the repository at this point in the history
  • Loading branch information
geijt authored and classicrocker883 committed Dec 26, 2023
1 parent bace70f commit cd1ead2
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Marlin/src/inc/Conditionals_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1277,7 +1277,7 @@
#if LCD_IS_SERIAL_HOST && !defined(LCD_SERIAL_PORT)
#if MB(BTT_SKR_MINI_E3_V1_0, BTT_SKR_MINI_E3_V1_2, BTT_SKR_MINI_E3_V2_0, BTT_SKR_MINI_E3_V3_0, BTT_SKR_MINI_E3_V3_0_1, BTT_SKR_E3_TURBO, BTT_OCTOPUS_V1_1, AQUILA_V101)
#define LCD_SERIAL_PORT 1
#elif MB(CREALITY_V24S1_301, CREALITY_V24S1_301F4, CREALITY_F401RE, CREALITY_V423, MKS_ROBIN, PANOWIN_CUTLASS, KODAMA_BARDO)
#elif MB(CREALITY_V24S1_301, CREALITY_V24S1_301F4, CREALITY_F401RE, CREALITY_V423, CREALITY_CR4NTXXC10, MKS_ROBIN, PANOWIN_CUTLASS, KODAMA_BARDO)
#define LCD_SERIAL_PORT 2
#else
#define LCD_SERIAL_PORT 3
Expand Down
20 changes: 10 additions & 10 deletions Marlin/src/pins/stm32f4/pins_CREALITY_CR4NTXXC10.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@
#define X_STEP_PIN PC2
#define X_DIR_PIN PB9

#define Y_ENABLE_PIN PC3
#define Y_ENABLE_PIN X_ENABLE_PIN
#define Y_STEP_PIN PB8
#define Y_DIR_PIN PB7

#define Z_ENABLE_PIN PC3
#define Z_ENABLE_PIN X_ENABLE_PIN
#define Z_STEP_PIN PB6
#define Z_DIR_PIN PB5

#define E0_ENABLE_PIN PC3
#define E0_ENABLE_PIN X_ENABLE_PIN
#define E0_STEP_PIN PB4
#define E0_DIR_PIN PB3

Expand Down Expand Up @@ -142,21 +142,21 @@
* If undefined software serial is used according to the pins below
*/
#define X_HARDWARE_SERIAL Serial6
#define Y_HARDWARE_SERIAL Serial6
#define Z_HARDWARE_SERIAL Serial6
#define E0_HARDWARE_SERIAL Serial6
#define Y_HARDWARE_SERIAL X_HARDWARE_SERIAL
#define Z_HARDWARE_SERIAL X_HARDWARE_SERIAL
#define E0_HARDWARE_SERIAL X_HARDWARE_SERIAL

#ifndef X_SLAVE_ADDRESS
#define X_SLAVE_ADDRESS 0
#define X_SLAVE_ADDRESS 0
#endif
#ifndef Y_SLAVE_ADDRESS
#define Y_SLAVE_ADDRESS 1
#define Y_SLAVE_ADDRESS 1
#endif
#ifndef Z_SLAVE_ADDRESS
#define Z_SLAVE_ADDRESS 2
#define Z_SLAVE_ADDRESS 2
#endif
#ifndef E0_SLAVE_ADDRESS
#define E0_SLAVE_ADDRESS 3
#define E0_SLAVE_ADDRESS 3
#endif

// Software serial
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@
ENTRY(Reset_Handler)

/* Highest address of the user mode stack */
_estack = 0x20017FFB; /* end of RAM */
_estack = 0x20000000 + LD_MAX_DATA_SIZE; /* end of RAM */

/* Generate a link error if heap and stack don't fit into RAM */
_Min_Heap_Size = 0x200; /* required amount of heap */
_Min_Stack_Size = 0x400; /* required amount of stack */
_Min_Heap_Size = 0x200; /* required amount of heap */
_Min_Stack_Size = 0x400; /* required amount of stack */

/* Specify the memory areas */
MEMORY
{
FLASH (rx) : ORIGIN = 0x8000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 96K
FLASH (rx) : ORIGIN = 0x8000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE
}

/* Define output sections */
Expand Down
3 changes: 2 additions & 1 deletion ini/stm32f4.ini
Original file line number Diff line number Diff line change
Expand Up @@ -746,9 +746,10 @@ board = genericSTM32F401RE
board_build.variant = 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} -DMCU_STM32F401RE -DSTM32F4
-DSS_TIMER=4 -DTIMER_SERVO=TIM5
-DENABLE_HWSERIAL3 -DTRANSFER_CLOCK_DIV=8
-DTRANSFER_CLOCK_DIV=8
build_unflags = ${stm32_variant.build_unflags} -DUSBCON -DUSBD_USE_CDC
extra_scripts = ${stm32_variant.extra_scripts}
pre:buildroot/share/PlatformIO/scripts/random-bin.py
Expand Down

0 comments on commit cd1ead2

Please sign in to comment.