What's the Problem?
I created a Custom 'Development/Discovery'-Board and want to program it using USB. I saw in the Datasheet AN2606 that it is not possible to flash the program via USB.
What I tried
A user on this Page told me I need to a flash a Bootloader first using USART1. I wathed multiple videos on this topic and up to a certain point every works. (see following steps)
Working steps:
- Connecting the Board to Power Supply and to USART1 (here via micro-USB, using the CP2102N as a USB to UART Bridge)
- The device manager detects the UART1-Bridge (see picture) as COM
- Using the STMFlashLoader to flash the Bootloader (found on GitHub)
also put the Boot0 High, and the Boot1 low. (like mentioned in the Datasheet Pattern1: - Getting to the next window (with the traficlight) –> saying Flash size is 64KB.
- Then choosing the STM32F1_Med-density_64K version of the Target
- Still following the tutorials, I choose Download to device and selecting the Download from file the binary-file: generic_boot20_pc13.bin (downloaded from GitHub)
- Its staring downloading and it also finished successfully
- Then I click on close
Nothing works from here on
I dont know if its on me or if the pc doesnt have all the nessasary tools.
What am I doning next?
- Turn the Boot0 back to 0 (low or GND)
- Disconnecting the cable i use for setting the Boot1 pin to GND
- Then reseting the Board through a Hard reset or via reset button
here is where I relaize something is not working:
- Connecting the Board again with the USB cable but on the Power-USB
- The LED (in Boot0 = 0 Mode) starts blinking like the pc_13 Bootup should do.
- But the USB-Device dont get recognize (see image below)
#Does anyone know what I could also do?#
I also tried following:
- Using the STM32CubeProgrammer
- Uploading a own Programm (where I activate the possibility for the USB to receive data (working) & sending data (not really sure if working (but should do)).
Maybe someone also had a hard time with this. Hope you can help me!
Best Answer
You seem to have wrong crystal for the bootloader.
You also don't have a pushbutton which the custom bootloader can read to determine if the bootloader should jump to user program or stay in the bootloader and start communicating with USB.