B-L475E-IOT01A USB DFU is stuck in different states.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-06-22 10:01 PM
I am using B-L475E-IOT01A (STM32L475VGTx) dev kit and this article for DFU and I am getting following issue.
Sequence of process I do is as below.
- Erase the whole flash.
- Flash the bootloader created based on above video.
- Make a DFU using DfuSe Tool and It works.
But when I want to upgrade the device again with DfuSe Tool, DFU process stuck or gives me error. Please see below screenshot.
Upgrade file is simple LED blinking application. It works when I do the DFU first time. But for upcoming DFU does not work.
Can anyone please help me out here ?
- Labels:
-
Bootloader
-
STM32L4 series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-06-29 8:00 AM
That's because the flash is no more empty after you flashed the LED app.
I think the DFU protocol implementation is incomplete.
If you want a quick workaround for your case, just modify the following line in usbd_dfu_if.c,
function MEM_If_Erase_FS(uint32_t Add):
//eraseinitstruct.NbPages = 1;
eraseinitstruct.NbPages = (FLASH_BANK_SIZE/FLASH_PAGE_SIZE) - GetPage(Add);
That should erase the BANK 1 until the end, instead of the first page only. So the flash operation can succeed again and again.
Please read the AN3156
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-06-30 10:48 PM
@Mike_ST​ Thank you for resoultion and explanation.
I have done changes as you suggested and it worked. :grinning_face:
I have gone through the AN3156 but couldn't get an idea of why the workaround you suggested is worked or what is incomplete in my DFU protocol implementation.
Can you please elaborate ? It would be great help for me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-07-01 12:42 AM
This implementation is only an example and is only deleting 1 page of flash memory before programming.
So it would work for small binaries (2KB max) and that is why deleting more flash pages helps.
So you have to understand it and adapt it for your needs.

- « Previous
-
- 1
- 2
- Next »