Page 1 of 1

Having a problem with bootloader after uploading code

Posted: Mon Dec 30, 2019 6:17 pm
by soniccd123
Hello,

I am trying to use STM32duino core for some time now with the HID Bootloader and a STM32F103 bluepill. I can flash the bootloader with the stm32flash and a USB-Serial adapter thing and my PC recognizes the device. I set boot0 to 0 and it continues to recognize it normally. The problem is when i upload code through Arduino IDE. I select the HID bootloader as upload method, the upload occours normally, but when it finishes uploading and the Bluepill resets, windows stops to recognize the device and i cannot upload anything anymore. The strange thing is that the code works normally on the bluepill, its only like the bootloader became corrupted. The same happens with Maple bootloader 2.0. Someone has ever had this problem? Can someone help me?

Thanks

Re: Having a problem with bootloader after uploading code

Posted: Tue Dec 31, 2019 9:50 am
by stevestrong
After you upload your code and restart the device, the bootloader is no longer active.
So if you have not activated USB serial in your uploaded code, then the PC cannot recognize anything, is normal.

Re: Having a problem with bootloader after uploading code

Posted: Tue Dec 31, 2019 5:50 pm
by soniccd123
stevestrong wrote:
Tue Dec 31, 2019 9:50 am
After you upload your code and restart the device, the bootloader is no longer active.
So if you have not activated USB serial in your uploaded code, then the PC cannot recognize anything, is normal.
I'll give it a try, the thing is that i can't upload any new code after the first upload.

Thanks

Re: Having a problem with bootloader after uploading code

Posted: Tue Dec 31, 2019 6:04 pm
by Vassilis
stevestrong is right. Please select these settings

hid_bl.PNG
hid_bl.PNG (14.93 KiB) Viewed 823 times

Re: Having a problem with bootloader after uploading code

Posted: Tue Dec 31, 2019 6:24 pm
by fredbox
Set BOOT1 = 1 and press reset to see if the HID bootloader is still available.
From the hid-bootloader readme:

Code: Select all

Normally, both BOOT-0 and BOOT-1 must be connected to '0'. 
If you connect BOOT-1 pin to 3.3V (or '1' on BluePill boards), 
the board will stay in HID Bootloader mode.

Re: Having a problem with bootloader after uploading code

Posted: Tue Dec 31, 2019 8:26 pm
by soniccd123
Vassilis wrote:
Tue Dec 31, 2019 6:04 pm
stevestrong is right. Please select these settings


hid_bl.PNG
Thanks! That just worked, it was the USB support CDC setting!

Thanks for everybody who tried to help too!