Skip to content

Software DFU mode implementation for STM32F4 MCU. #6919

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

Merged
merged 1 commit into from
Sep 19, 2022

Conversation

flom84
Copy link

@flom84 flom84 commented Sep 18, 2022

Hello all

I have tried to add support for entering DFU mode from software as explained in the following issue: ##3444

The implementation particularly supports STM32F4 family since I have only one MCU from ST :)

The code follows the recommended steps from the application notes: AN2606 Rev 55. Link here: https://www.st.com/resource/en/application_note/cd00167594-stm32-microcontroller-system-memory-boot-mode-stmicroelectronics.pdf

To test, add the lines bellow in your code.py, run the program, then connect to the device with an ##utility as explained here: https://learn.adafruit.com/adafruit-stm32f405-feather-express/dfu-bootloader-details.

import microcontroller

microcontroller.on_next_reset(microcontroller.RunMode.BOOTLOADER)

microcontroller.reset()

@jepler
Copy link

jepler commented Sep 18, 2022

This looks simple enough. I assume it works -- can you say specifically what device you tested it on?

@flom84
Copy link
Author

flom84 commented Sep 18, 2022

@jepler I have tested on my NUCLEO-F446RE board: https://www.st.com/en/evaluation-tools/nucleo-f446re.html.
I have added circuitpython support for it on my local branch: d40278f , then used software DFU to do firmware upgrades.

Copy link

@jepler jepler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Low chance of negative impact, looks sensible to me, and you tested.

I hope you'll be submitting a PR to add that board soon, too.

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

Successfully merging this pull request may close these issues.

2 participants