Change "Button" pin in bootloader

Post here first, or if you can't find a relevant section!
Post Reply
User avatar
RogerClark
Posts: 6917
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Change "Button" pin in bootloader

Post by RogerClark » Sat Aug 26, 2017 10:57 am

Guys

I noticed someone had a problem with the bootloader as they were using PC14 as an input which was being driven high

http://www.stm32duino.com/viewtopic.php ... C14#p33365

Several of the bootloader targets, have the "Button" pin set to PC14, but I can see this is problematic.

I posted a while ago about using Boo1 (which AFIK is PB2), as the "Button" pin on generic boards which do not have a button, but as I recall, people were not keen on the idea.

Anyway, I investigated using PB2, and found that on the Blue Pill, that the pullup resistor on Boot1 is not strong enough to overcome the internall Pulldown which is enabled on the Button pin, so moving the jump link on Boot1 did not result in the bootloader holding in DFU mode.

However... I don't see a problem with this, because if anyone wants to hold the Bootloader in DFU mode, they could simply connect the middle pin of Boot1 jumper pins to Vcc.

Alternatively, I can remove the Button functionality from all generic boards which do not have a button, but it can be handy to get the bootloader to lock in DFU mode, if you are having problems getting drivers to load
As the 1 sec its currently in DFU mode, is not really long enough to look in the Windows device manager to find out whether the correct driver has been loaded etc

ag123
Posts: 742
Joined: Thu Jul 21, 2016 4:24 pm

Re: Change "Button" pin in bootloader

Post by ag123 » Sat Aug 26, 2017 7:15 pm

imho, one of those issues is that it isn't possible to tell what board it is running on, e.g. between BP, MM etc there really isn't anything a sketch or bootloader etc could tell if it is running on BP or MM, that would mean distributing binaries / images and the board or features is in the file name etc. to distinguish between that which have the button pin feature e.g. MM vs one that don't (e.g. an image the perhaps is named 'no button pin')
just 2 cents

User avatar
RogerClark
Posts: 6917
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Change "Button" pin in bootloader

Post by RogerClark » Sat Aug 26, 2017 8:47 pm

The problem with the Button being on PC14 in most of the binaries, is that it's not documented anywhere apart from in the code.

I guess the safe option is for me to remove that feature, but as I find it handy for testing the drivers etc, I am loathed to completely remove it, hence moving to PB2 / Boot1 seems the least worst option

Ps. I can't stop people installing the MM. bootloader onto a Blue Pill, but most people seem to install the correct binary, and in this case the user was using the correct binary

Post Reply