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

Continuous flashing in dfu mode is not working #1782

Closed
darshansm opened this issue Aug 6, 2022 · 4 comments
Closed

Continuous flashing in dfu mode is not working #1782

darshansm opened this issue Aug 6, 2022 · 4 comments
Labels
duplicate This issue or pull request already exists

Comments

@darshansm
Copy link

darshansm commented Aug 6, 2022

Core Version: 2.3.0
Board: NUCLEO L476RG

But using upload protocol dfu. Everytime I need to make Boot pin high to enter dfu mode. Generally to enter dfu mode we open the com port with 1200 baud. It is not working. I tried in windows and Linux platform both.

Any workaround for this issue??

@ABOSTM
Copy link
Contributor

ABOSTM commented Aug 8, 2022

Hi @darshansm,
I don't understand what you mean by Generally to enter dfu mode ? other core version ? other STM32 MCU/board ? Other non STM32 MCUboards ?

From Application note AN2606 Rev 55,
§64 STM32L47xxx/48xxx devices bootloader
STM32L47xxx supports bootloader "pattern 7"
image
So, having to set Boot0 pin is a valid choice,
and it sounds normal to me, to set it each time you want to enter BootLoader.

And then, when USB enumerates (when USB cable is plugged), it starts in DFU. see AN3156.

In order to be able to open COM port requires to be in DFU (and not reverse)

@darshansm
Copy link
Author

I Agree on that. But If I enable USB CDC, I can see the USB COM port. Using that COM port, how can we enter to dfu mode. Generally we can't change the Boot0 pin always.

Previously I was using https://github.com/GrumpyOldPizza/arduino-STM32L4

Board package. There if I enable USB CDC and if I open and close COM port with 1200 baud rate it get entering in to dfu mode.

@ABOSTM
Copy link
Contributor

ABOSTM commented Aug 8, 2022

I am not familiar with GrumpyOldPizza.
What I told you is valid for STM32 DFU (ROM code), and it is mandatory because at reset, MCU needs Boot0 pin status to decide to continue in normal mode or in BootLoader mode.
Maybe GrumpyOldPizza uses an 2nd stage bootloader,
meaning MCU goes only once in bootloader mode and install a FW which is a 2nd level bootloader.
Then even if you run in normal mode (from MCU point of view and no need for BOOT pin change), the code executed allows to flash the real application in Flash. Note: in such case 2nd level bootloader reserve some space in Flash (which is not usable for application).
This seems to be the case as I see this:
https://github.com/GrumpyOldPizza/arduino-STM32L4/blob/ac659033eadd50cfe001ba1590a1362b2d87bb76/variants/STM32L433CC-Butterfly/linker_scripts/STM32L433CC_FLASH.ld#L72

This core Arduino_Core_STM32, doesn't provided such 2nd level bootloader, but it is ready to use some existing ones like HID Bootloader, Maple , ...
image

@fpistm
Copy link
Member

fpistm commented Aug 23, 2022

Hi,
automatic reset in dfu mode is not supported yet.
A PR was started several years ago: #710
Anyway it will require some more work.

Duplicate of #706

@fpistm fpistm closed this as completed Aug 23, 2022
@fpistm fpistm added invalid This doesn't seem right duplicate This issue or pull request already exists and removed invalid This doesn't seem right labels Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants