A drop-in SD card bootloader for the Creality Ender-3 V3 SE (C14 motherboard, STM32F401RET6).
If you bricked your printer by flashing a bad bootloader — or your stock bootloader just stopped working — this project gives you a clean, open-source replacement. Drop firmware.bin on an SD card, power on, done.
- Power on → bootloader initializes the MCU and mounts the SD card via SDIO
- Checks for
firmware.binon the SD card root - Validates the binary (stack pointer in SRAM, reset vector in flash, Thumb bit set)
- Erases application flash sectors 4–7
- Writes the firmware byte-by-byte with readback verification
- Renames
firmware.bin→firmware.CURso it doesn't re-flash on next boot - Jumps to the application at
0x08010000
If there's no SD card or no firmware.bin, it boots whatever app is already flashed.
Sector Address Range Size Usage
────── ───────────────── ───── ────────────────────
0 0x08000000-0x08003FFF 16 KB Bootloader
1 0x08004000-0x08007FFF 16 KB Bootloader
2 0x08008000-0x0800BFFF 16 KB Bootloader
3 0x0800C000-0x0800FFFF 16 KB (reserved/padding)
4 0x08010000-0x0801FFFF 64 KB Application ←─┐
5 0x08020000-0x0803FFFF 128 KB Application │ 448 KB total
6 0x08040000-0x0805FFFF 128 KB Application │
7 0x08060000-0x0807FFFF 128 KB Application ←─┘
This matches the Creality stock layout — official Marlin firmware binaries work without modification.
| Item | Details |
|---|---|
| Printer | Creality Ender-3 V3 SE |
| Motherboard | C14 revision (HW ID: CR4NS200320C14) |
| MCU | STM32F401RET6 (ARM Cortex-M4, 512 KB flash, 96 KB SRAM) |
| SD Interface | SDIO 4-bit wide bus (PC8–12 data/clock, PD2 CMD, PC7 detect) |
| Programmer | ST-Link V2 (or any SWD programmer) — only needed once to flash the bootloader |
| SD Card | FAT32 formatted, any size |
Note: This is specifically for the C14 board with the STM32F401 chip. If your board says C13 or has a GD32F303, this bootloader is NOT for you.
You need an ST-Link V2 and either STM32CubeProgrammer or OpenOCD.
With STM32CubeProgrammer:
- Connect ST-Link to the board's SWD header (SWDIO, SWCLK, GND, 3.3V)
- Open STM32CubeProgrammer → Connect
- Open Tab: Erasing & Programming
- Browse to
E3V3SE_SDBootloader.bin - Start Address:
0x08000000 - Click Start Programming
With OpenOCD:
openocd -f interface/stlink.cfg -f target/stm32f4x.cfg \
-c "program E3V3SE_SDBootloader.bin 0x08000000 verify reset exit"- Format your SD card as FAT32
- Copy Creality's firmware
.binfile to the SD card root - Rename it to exactly
firmware.bin - Insert SD card into the printer
- Power on — wait a few seconds
- Marlin boots. Check the SD card:
firmware.binis nowfirmware.CUR
Future updates: just put a new firmware.bin on the card and power cycle.
arm-none-eabi-gcc(any recent version — tested with 14.2)make(GNU Make)- STM32CubeF4 HAL — the Makefile expects PlatformIO's copy:
You can also point
~/.platformio/packages/framework-stm32cubef4/CUBE_DIRto any STM32CubeF4 SDK directory.
# If PlatformIO HAL is in the default location:
make
# Or specify a custom path:
make CUBE_DIR=/path/to/STM32CubeF4Output: build/E3V3SE_SDBootloader.bin (~16 KB)
E3V3SE_SDBootloader/
├── Core/
│ ├── Inc/
│ │ ├── bootloader.h # Flash layout, firmware filename, API
│ │ ├── ffconf.h # FatFS configuration
│ │ ├── fatfs.h # FatFS link driver header
│ │ ├── main.h # Pin defines, extern declarations
│ │ ├── sd_diskio.h # SD disk I/O header
│ │ ├── stm32f4xx_hal_conf.h # HAL module enables
│ │ └── stm32f4xx_it.h # Interrupt handler prototypes
│ └── Src/
│ ├── bootloader.c # Core logic: mount, validate, erase, write, jump
│ ├── fatfs.c # FatFS driver registration
│ ├── main.c # MCU init (clock, SDIO, GPIO) + entry point
│ ├── sd_diskio.c # SDIO-based FatFS disk I/O
│ └── stm32f4xx_it.c # SysTick + fault handlers
├── STM32F401RETX_FLASH.ld # Linker script (48 KB flash, 96 KB RAM)
├── Makefile
├── LICENSE
└── README.md
Clock configuration: HSI 16 MHz → PLL (M=/8, N=x168, P=/4, Q=/7) → SYSCLK 84 MHz, SDIOCLK 48 MHz
SD card initialization: Starts in 1-bit mode at ~4 MHz, then widens to 4-bit SDIO for faster reads.
Firmware validation (before erasing anything):
- Stack pointer (word 0) must be in SRAM range:
0x20000000–0x20018000 - Reset vector (word 1) must be in app flash:
0x08010000–0x08080000 - Reset vector must have Thumb bit set (odd address)
Flash programming: HAL byte-by-byte with FLASH_TYPEPROGRAM_BYTE, verified with memcmp readback after each chunk.
Application jump: Disables all IRQs, clears NVIC, sets SCB->VTOR to 0x08010000, sets MSP, re-enables IRQs, calls reset vector.
Failure modes:
| Scenario | Behavior |
|---|---|
| No SD card | Boots existing app |
No firmware.bin |
Boots existing app |
| File too large (>448KB) | Boots existing app |
| Invalid header | Boots existing app |
| Erase fails | Hangs (re-flash via SWD) |
| Write/verify fails | Hangs (re-flash via SWD) |
| No valid app | Hangs (re-flash via SWD) |
Printer is completely dead after flashing bootloader:
- Re-check SWD wiring. Re-flash the bootloader binary at
0x08000000.
firmware.bin not renamed to firmware.CUR:
- SD card didn't mount. Reformat as FAT32 (allocation size 4096). Try a different card.
- Make sure the file is named exactly
firmware.bin(case-sensitive on some cards).
Bootloader flashes but Marlin doesn't start:
- Confirm your firmware binary is for the STM32F401 / C14 board, not the GD32F303 / C13.
- Check that the binary is < 448 KB.
How do I get back to stock?
- The stock Creality bootloader binary is not publicly available, but you don't need it — this bootloader is functionally identical. Any official Creality firmware
.binfile will work.
This bootloader was born out of necessity. The stock Creality bootloader on an Ender-3 V3 SE C14 board got replaced with an incompatible one (meant for the GD32F303/C13 board), completely bricking the printer's SD card flashing capability.
After discovering that no open-source SDIO-based bootloader existed for this specific board, this project was written from scratch — with a lot of late-night debugging, HAL datasheet diving, and determination to avoid buying a whole new motherboard.
If you're here because you're in the same boat: you're going to be fine. Flash this, put your firmware on the SD card, and get back to printing.
- ewatts104-bit — Project owner. Diagnosed the bricked bootloader, sourced the pin mappings, tested on real hardware.
- GitHub Copilot (Claude, Anthropic) — AI pair-programmer that wrote the bootloader code, HAL configuration, FatFS integration, Makefile, and this README during an extended debugging and development session. Yes, an AI helped unbrick a 3D printer. The future is now.
- Revoxxi — Marlin fork for the C14 board, which provided the critical SDIO pin mapping (
pins_CREALITY_F401.h). - quangcaol/SDBootloader — SPI-based STM32 SD bootloader that served as the initial reference architecture.
- STMicroelectronics — STM32CubeF4 HAL and FatFS middleware.
MIT — Use it, modify it, share it. If it saves your printer, that's all the thanks we need.