Help with STM32F103

Post Reply
mindzila
Posts: 1
Joined: Sat Oct 15, 2022 8:30 am

Help with STM32F103

Post by mindzila »

Hi, I have creality 3d printer board V4.2.2 and I want to use it as arduino. Board has STM32F103RET6 and built it Ch340G on PA9 and PA10 pins. When I am trying to burn bootloader with STM32CubeProgramer I get error ".. please verify boot mode configuration" Maybe somebody can help me ?

This is link to V4.2.2 Scematic: https://klipper.discourse.group/uploads ... FPNi87.pdf
ag123
Posts: 1697
Joined: Thu Dec 19, 2019 5:30 am
Answers: 27

Re: Help with STM32F103

Post by ag123 »

for this board get a st-link v2 to program it
https://www.adafruit.com/product/2548
https://www.st.com/en/development-tools/st-link-v2.html
the SWD (ICSP port) is shown in the schematic
you would need to connect to those pins with st-link v2

On the schematic:
there is something else unusual about your board, pin 60 boot0 is apparently pulled up to 3.3v. This is unusual and not normal.
if it is indeed the case, there has to be a jumper or some sort to pull BOOT0 to GND instead.
Otherwise, in this mode, you should be able to program it over the on board ch340.

But that if you cannot put BOOT0 to GND after programming, then it'd "forever" remain in program mode.
BOOT0 should be GND - 0v in normal use.
and you set BOOT0 pull up to 3.3v if you want to program it over uart1 (PA9, PA10) - connected to the ch340
GonzoG
Posts: 408
Joined: Wed Jan 15, 2020 11:30 am
Answers: 28
Location: Prudnik, Poland

Re: Help with STM32F103

Post by GonzoG »

You don't need to flash bootloader for this board. There is no native USB on this board (USB pins are used for IIC EEPROM)
You have USB<->TTL on board (CH340) and you can use built-in serial bootloader. You just need proper BOOT0 and BOOT1 pin setup to enter serial bootloader.
masonjacob
Posts: 1
Joined: Thu May 23, 2024 12:01 am

Re: Help with STM32F103

Post by masonjacob »

Does anyone have any more information on the V4.2.2 board's bootloader and how to burn an Arduino like bootloader such as the stm32duino? I am looking to use the V4.2.2 board as a "general purpose stepper motor control board" with my own firmware, and therefore I would like to develop with it like an Arduino. Out of spite for having to buy a separate programmer (yes I know the ST-LINK V2s are cheap) does anyone know if the bootloader can be burned with a raspberry pi, (it seems like this is possible based on this and if so how I would go about doing that for this board specifically? I also see how the boot pin is configured on the board and am confused as to how the bootloader actually functions the way it does and is able to reprogram when detecting new firmware on the SD, so and guidance on how to make the board compatible with an Arduino like bootloader would be really helpful.
ag123
Posts: 1697
Joined: Thu Dec 19, 2019 5:30 am
Answers: 27

Re: Help with STM32F103

Post by ag123 »

stm32f103 can be programmed either by:
- st-link (SWD)
- uart boot mode (need to set boot0)
what is strange on the original schematic is that boot0 is pulled up to 3v3 i.e. it is set.
which means that the chip will always be in programming mode on reset.
I think there'd be a jumper to pull that boot0 pin to gnd, otherwise the board can never be used normally.

in that uart boot mode, i.e. boot0 set you can program a sketch.bin on stm32f103 using uart pins say using a usb-uart dongle at pins PA9 (tx), PA10 (rx) serial 1 pins.

you can install (e.g. 'roger's boot loader') in that same way, but that after that you need to use an .ld script file that compile your sketch / firmware to install at 0x8003000. The normal start of flash is 0x8000000, this is the normal way if you program via st-link, or a usb-uart dongle at uart1 (PA9, PA10)
Post Reply

Return to “STM32F1 based boards”