Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Feature/softdfu upload #69

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

ekawahyu
Copy link

The current built-in STM32 DFU upload requires user to pull BOOT0 pin to 3.3V and perform system reset. With this enhancement, users do not require to press reset button nor pulling BOOT0 pin to 3.3V to upload new binary. The protocol is based on reading magic number over USBCDC (same magic number as Maple board '1EAF') and then it jumps to built-in DFU mode and ready to accept binary from there.

This enhancement script has been tested to work on STM32F072B Discovery board with my branch develop:

https://github.com/SnapBloks/Arduino_Core_STM32/tree/develop

Board part number is STM32F072B-DISC-SOFTDFU and it has not been merged into STM32F072B-DISCOVERY yet. The enhancement scripts are available for Linux, macOS, and Windows.

@fpistm
Copy link
Member

fpistm commented Sep 14, 2020

Hi @ekawahyu
Thanks for this PR anyway it seems you made lot of changes (mainly in the variant).
A POC has been made to test the reset in BL mode:
stm32duino/Arduino_Core_STM32#710

It requires some clean up and rebase but should be less invasive.

@fpistm fpistm added this to In progress in STM32duino libraries via automation Sep 14, 2020
@ekawahyu
Copy link
Author

ekawahyu commented Sep 14, 2020

The changes is not that much, but it was mainly due to missing __initialize_hardware_early() in every startup code. That's why I created a new variant *-SOFTDFU instead of adding it directly to the existing STM32F072B-DISCOVERY.

If you want, I can do the cleanup on the core and merge the required changes to STM32F072B-DISCOVERY before doing PR for the core. I will also look at #710. What is BL mode? BL as in BootLoader mode?

@ekawahyu
Copy link
Author

By the way, when I worked on this thing in the past, I believe the __initialize_hardware_early() was generated and available in HALMX. So, why I don't see it anymore in every startup code in the core?

@fpistm
Copy link
Member

fpistm commented Sep 14, 2020

Honestly, I don't know core __initialize_hardware_early().
BL is for BootLoader.

@ekawahyu
Copy link
Author

ekawahyu commented Sep 15, 2020

FYI, got minimal changes merged with STM32F072B-DISCO variant here:

https://github.com/SnapBloks/Arduino_Core_STM32/tree/feature/STM32F072B-DISCO-softdfu-upload

Will do PR for the core soon. Please review and comments. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
STM32duino libraries
  
Needs review
Development

Successfully merging this pull request may close these issues.

None yet

2 participants