Page 1 of 2

STM32F0 Bootloader Problem/Issue

Posted: Wed Dec 09, 2020 5:12 pm
by kosovali
I have a board with STM32F070CBT6 as a microcontroller. I want to program this board from USB port (I will use the Arduino compiler for programming). So i need to write USB bootloader. Can you help me? Is there a suitable document or a written bootloader? Thank you in advance.

Re: STM32F0 Bootloader Problem/Issue

Posted: Thu Dec 10, 2020 8:43 am
by fpiSTM
Depending of the STM32F0, it has a buitlin BL for DFU.
https://www.google.com/url?sa=t&rct=j&q ... PpgQX1P-ho

Re: STM32F0 Bootloader Problem/Issue

Posted: Thu Dec 10, 2020 2:08 pm
by kosovali
Thanks for your reply. I am confused. You say I don't need to write bootloader. Is it correct? So what should I do to program my board from USB? What is your advise? Thanks in advance.

Re: STM32F0 Bootloader Problem/Issue

Posted: Thu Dec 10, 2020 5:20 pm
by fpiSTM
As mentioned in the AN2606:
STM32F070_BL.png
STM32F070_BL.png (12.98 KiB) Viewed 9566 times
So you can use the built in BL. Read the AN to know how to use it.
You have to use the pattern2:
Pattern 2: Boot0(pin) = 1 and nBoot1(bit) = 1
Then the board will enter in DFU mode.

Re: STM32F0 Bootloader Problem/Issue

Posted: Thu Dec 10, 2020 9:18 pm
by kosovali
How can I enable the USB peripheral interface of the microcontroller? First, Do I need to program from UART etc. to enable USB?

Re: STM32F0 Bootloader Problem/Issue

Posted: Fri Dec 11, 2020 8:22 am
by fpiSTM
I don't understand your point.
If you correctly configure the Boot pins and have an USB cable connected,the board will boot in DFU mode.

Re: STM32F0 Bootloader Problem/Issue

Posted: Fri Dec 11, 2020 4:53 pm
by kosovali
Thank you for your answers. I achieved to program my board via Arduino. So, DFU related questions;
1) I don't want to use the boot pin every time I program my board. Is there a way to do this?
2) If I write my own bootloader, can I solve the above problem?
3) Can I modify the embedded bootloader?

Thank you in advance.

Re: STM32F0 Bootloader Problem/Issue

Posted: Fri Dec 11, 2020 5:56 pm
by fpiSTM
kosovali wrote: Fri Dec 11, 2020 4:53 pm 1) I don't want to use the boot pin every time I program my board. Is there a way to do this?
It is ongoing:
https://github.com/stm32duino/Arduino_C ... 2/pull/710
to restart automatically in BL mode.
kosovali wrote: Fri Dec 11, 2020 4:53 pm 2) If I write my own bootloader, can I solve the above problem?
You can do your own BL and stuff to automatically handle this but this is the same issue than using the Built in BL.
kosovali wrote: Fri Dec 11, 2020 4:53 pm 3) Can I modify the embedded bootloader?
No it is in ROM.

Re: STM32F0 Bootloader Problem/Issue

Posted: Sat Dec 12, 2020 1:40 pm
by kosovali
You said "You don't need to use the boot pin every time while programming your board". Well, I want to do this for STM32F070CBT6. How can I do? Is there any example or document?

Thank you in advance.

Re: STM32F0 Bootloader Problem/Issue

Posted: Sat Dec 12, 2020 3:03 pm
by fpiSTM
kosovali wrote: Sat Dec 12, 2020 1:40 pm You said "You don't need to use the boot pin every time while programming your board". Well, I want to do this for STM32F070CBT6. How can I do? Is there any example or document?

Thank you in advance.
Where? @kosovali the example is the PR. I can not provide more stuff.