cancel
Showing results for 
Search instead for 
Did you mean: 

How to program STM32F103RE on Creality v4.2.7 silent 3D Printer board [solved]

PMeno.1
Associate II

I have written an open source 3D Printer firmware for Arduino Mega - RAMPS 1.6 board which i have uploaded to github: https://github.com/3DHexfw/3DHex

Now i am trying to port the code to Creality v4.2.7 board (STM32F103RE on board). To do so i have downloaded SMT32Cube in order to initilize the peripherals, write and build the code.

Creality v4.2.7 board comes with pre-installed bootloader so the firmware.bin(compiled) can be uploaded directly from micro-SD card without the need of external programmer.

My first attempt was just to set HIGH one of the output pins, code on github: https://github.com/3DHexfw/3DHex/blob/master/MCU/Creality/Creality_v4.2.7_Silent/Core/Src/main.c

The steps i followed:

  • Build the source with STM32Cube
  • Move generated firmware.bin to SD card
  • Insert the SD with firmware.bin to the slot
  • Power up the board to load the firmware

For the time being i cannot make it to work.

Do i have to edit the linker file for the STM32 project, so that it doesn't try to use the flash memory space used by the bootloader? I am not sure how to do it and what is the offset.

Any suggestions?

Notes:

  • I can upload any other 3d printer firmware.bin at any time, no issue here.
  • It is important to be able to upload the firmware.bin by micro sd

2 REPLIES 2

You likely want to inspect the boot loader source or binary to determine an origin for the application code, and expectations about signing or checksumming.

Generally one would need to advance the base of flash in the linker script​ and make sure the vector table address matches in SystemInit().

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
PMeno.1
Associate II

Thank you very much for your comment, i used the same starting address as the marlin fw and seems to work: https://github.com/MarlinFirmware/Marlin/blob/2.0.x/buildroot/share/PlatformIO/ldscripts/creality.ld

Maybe i will create a new loop for my next issue but if you could take a quick look here: https://github.com/3DHexfw/3DHex/blob/master/MCU/Creality/Creality_v4.2.7_Silent/Core/Src/main.c

I am trying to send data over USB. The MCU "talks" via USART1 to a serial to usb converter (ch340g). I have also added __HAL_UART_ENABLE(&huart1); but with no luck so far.

Any advice? Thank you in advance!