STM32F0 Bootloader Problem/Issue

STM32duino bootloader aka Maple bootloader
kosovali
Posts: 6
Joined: Wed Dec 09, 2020 4:52 pm

STM32F0 Bootloader Problem/Issue

Post 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.
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: STM32F0 Bootloader Problem/Issue

Post 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
kosovali
Posts: 6
Joined: Wed Dec 09, 2020 4:52 pm

Re: STM32F0 Bootloader Problem/Issue

Post 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.
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: STM32F0 Bootloader Problem/Issue

Post by fpiSTM »

As mentioned in the AN2606:
STM32F070_BL.png
STM32F070_BL.png (12.98 KiB) Viewed 7745 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.
kosovali
Posts: 6
Joined: Wed Dec 09, 2020 4:52 pm

Re: STM32F0 Bootloader Problem/Issue

Post 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?
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: STM32F0 Bootloader Problem/Issue

Post 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.
kosovali
Posts: 6
Joined: Wed Dec 09, 2020 4:52 pm

Re: STM32F0 Bootloader Problem/Issue

Post 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.
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: STM32F0 Bootloader Problem/Issue

Post 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.
kosovali
Posts: 6
Joined: Wed Dec 09, 2020 4:52 pm

Re: STM32F0 Bootloader Problem/Issue

Post 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.
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: STM32F0 Bootloader Problem/Issue

Post 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.
Post Reply

Return to “USB bootloader”