1
\$\begingroup\$

I'm developing a project with custom hardware and an STM32F103, however, due to lack of stock until next year, I have proceeded with the clone GD32F103CBT6.

One of the problems I'm encountering is the serial port/UART. Another one is that today I uploaded to the GD32 an ESP32 sketch by accident, and now the microcontroller is not found by the ST-Link.

I have tried to use the ST-Link Utility to try to erase its flash, but for some reason it won't work. Is it possible that it got physically damaged? If so, how can I avoid that from happening? I'm trying to use #ifdef conditions but it won't do what I want (prevent the sketch from being uploaded).

\$\endgroup\$
2
  • 2
    \$\begingroup\$ You probably overwrote part of the boot loader \$\endgroup\$
    – mmmm
    Commented Jul 19, 2021 at 15:32
  • 2
    \$\begingroup\$ Assuming you connected the board via USB-to-serial connection, @mmmm is probably right. In that case, you can set the jumper for BOOT0 to upload a bootloader again. \$\endgroup\$
    – Codo
    Commented Jul 19, 2021 at 15:34

1 Answer 1

1
\$\begingroup\$

I found a solution in this video! https://www.youtube.com/watch?v=jEz0C2bT2M0&ab_channel=BuildYourCNC Basically use ST-Link Utility, connect the reset pin to GND (ideally through a pd resistor) select the option erase flash and disconnect the reset pin from gnd right away. It will factory reset your flash memory and it will load code again!

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.