Page 6 of 6

Re: STM32F103C8 and Fast Bootloader

Posted: Fri Jul 17, 2020 11:08 am
by GeorgeIoak
Here's my current settings that have working reliably although I've only flashed a handful of times since getting this to work

When I was experimenting with the USB Boot Loader I never did get it work without some type of manual reset but the HID has always worked to reset the board automatically.

Re: STM32F103C8 and Fast Bootloader

Posted: Fri Jul 17, 2020 11:13 am
by ag123
i see so CDC is still there, it is likely useful after all, as Serial.print("message"); would go to the virtual comm port to your pc console.
and there is no need for a usb-uart dongle, a usb - micro/mini cable would do it.
USB is very complex due to all that state management. i think if one is determined, i think one can hack the core implementation so that it shows as 2 'com' ports even if there is only one device, it would take quite a bit of changes and deep down understanding of usb.
this may for instance help, if you want a 'side' channel for the debug messages. the other way is to hack in the core to figure out
if you can place a hook to process custom usb requests, as normally for usb-serial (CDC) there are 3 endpoints, endpoint 0 is the control pipe in which usb requests are transmitted, the other 2 (IN and OUT) are used for the normal usb comms. as usb endpoints are basically 'logical' concepts one can hack around that to add 'side channel' functionalities

Re: STM32F103C8 and Fast Bootloader

Posted: Fri Jul 17, 2020 11:16 am
by fpiSTM
You can disable the uart support.

Re: STM32F103C8 and Fast Bootloader

Posted: Fri Jul 17, 2020 11:26 am
by GeorgeIoak
Thanks again. Yes, I disabled the UART and everything works the same and that freed up a little more flash:

Code: Select all

Sketch uses 58964 bytes (89%) of program storage space. Maximum is 65536 bytes.
Global variables use 4192 bytes (20%) of dynamic memory, leaving 16288 bytes for local variables. Maximum is 20480 bytes.
For reference this is what it was with UART enabled:

Code: Select all

Sketch uses 60712 bytes (92%) of program storage space. Maximum is 65536 bytes.
Global variables use 4456 bytes (21%) of dynamic memory, leaving 16024 bytes for local variables. Maximum is 20480 bytes.