2
\$\begingroup\$

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.
enter image description here

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:

  1. Connecting the Board to Power Supply and to USART1 (here via micro-USB, using the CP2102N as a USB to UART Bridge)
  2. The device manager detects the UART1-Bridge (see picture) as COMenter image description here
  3. Using the STMFlashLoader to flash the Bootloader (found on GitHub) enter image description here
    also put the Boot0 High, and the Boot1 low. (like mentioned in the Datasheet Pattern1: enter image description here
  4. Getting to the next window (with the traficlight) --> saying Flash size is 64KB.enter image description here
  5. Then choosing the STM32F1_Med-density_64K version of the Target
  6. 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)
  7. Its staring downloading and it also finished successfully

enter image description here

  1. 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?

  1. Turn the Boot0 back to 0 (low or GND)
  2. Disconnecting the cable i use for setting the Boot1 pin to GND
  3. Then reseting the Board through a Hard reset or via reset button

here is where I relaize something is not working:

  1. Connecting the Board again with the USB cable but on the Power-USB
  2. The LED (in Boot0 = 0 Mode) starts blinking like the pc_13 Bootup should do.
  3. But the USB-Device dont get recognize (see image below) enter image description here

#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!

\$\endgroup\$
7
  • \$\begingroup\$ You did read the bootloader manual how to use it? Does your board have the necessary hardware to support that bootloader, or USB connections? \$\endgroup\$
    – Justme
    Apr 6, 2023 at 11:06
  • \$\begingroup\$ @Justme, I looked at the Datasheet AN2606 and didnt find any more specific informations. To receive via USB, I only need an connection to the board via D+/D- I thought?! \$\endgroup\$
    – Y-E-Quit
    Apr 6, 2023 at 11:22
  • 2
    \$\begingroup\$ The AN2606 won't be able to tell you if some random bootloader you downloaded from Github will work on your MCU or on your PCB. \$\endgroup\$
    – Justme
    Apr 6, 2023 at 11:27
  • \$\begingroup\$ What should I look for? I used the GitHub Bootloader mentioned in all the Tutorials (see here) \$\endgroup\$
    – Y-E-Quit
    Apr 6, 2023 at 11:31
  • 1
    \$\begingroup\$ How would a random Github bootloader know which frequency crystal your board has? What frequency crystal you have, or do you even use a crystal on your board? Any piece of code must be run on compatible hardware. \$\endgroup\$
    – Justme
    Apr 6, 2023 at 11:41

2 Answers 2

0
\$\begingroup\$

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.

\$\endgroup\$
0
\$\begingroup\$

As I wrote in the discussion chat above with @Paul, it looks like I have to write an own Bootloader for my board specific.

Following Steps then need to be followed:

  1. Code own Bootloader (will be added in the future)
  2. Upload the File (following the working steps in Problem description above)

--> follow the steps mentioned in the above Problem section.

other options

Like mentioned by other Users in the comments, it is also possible to use the same Bootloader but to change the settings (for example: change clock size, and so on).

--> if fixed in the near future, will be later on be added

\$\endgroup\$
1
  • 2
    \$\begingroup\$ No, that is not the only option. You can simply take one that works on your MCU and board as-is, or can be easily configured and recompiled to work on your MCU and board. You don't really have to code anything if you don't want to. \$\endgroup\$
    – Justme
    Apr 6, 2023 at 13:27

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.