STM32L476 dfu upgrade bug
-
- Posts: 363
- Joined: Sun Apr 17, 2016 1:55 pm
STM32L476 dfu upgrade bug
I found when upgrade firmware for STM32L476 with dfu file, it will not run after download. But when I use stlink to download hex file, it is work.
I try it in dfu-util in ubuntu and DfuSe Demo in windows, get same result.
I try it in dfu-util in ubuntu and DfuSe Demo in windows, get same result.
Re: STM32L476 dfu upgrade bug
I can reproduce that with my STM32L476DISC (running Ubuntu 16.04 on my build machine). If I use pydfu.py (which is the default), then it seems to work fine.
So this works: while this doesn't:
MicroPython has been using pydfu.py as the default since it's faster than dfu-util
Since I was flashing the identical same image, I have to conclude that its a bug in dfu-util. I was using a version of dfu-util built from the latest sources.
So this works:
Code: Select all
make BOARD=STM32F476DISC deploy
Code: Select all
make BOARD=STM32L476DISC USE_PYDFU=0 deploy
Since I was flashing the identical same image, I have to conclude that its a bug in dfu-util. I was using a version of dfu-util built from the latest sources.
-
- Posts: 363
- Joined: Sun Apr 17, 2016 1:55 pm
Re: STM32L476 dfu upgrade bug
I try to generate dfu with hex file, and using dfu-util and DfuSe to download, it is work.dhylands wrote:I can reproduce that with my STM32L476DISC (running Ubuntu 16.04 on my build machine). If I use pydfu.py (which is the default), then it seems to work fine.
So this works:while this doesn't:Code: Select all
make BOARD=STM32F476DISC deploy
MicroPython has been using pydfu.py as the default since it's faster than dfu-utilCode: Select all
make BOARD=STM32L476DISC USE_PYDFU=0 deploy
Since I was flashing the identical same image, I have to conclude that its a bug in dfu-util. I was using a version of dfu-util built from the latest sources.
-
- Posts: 363
- Joined: Sun Apr 17, 2016 1:55 pm
Re: STM32L476 dfu upgrade bug
Old version (1.8.2) is work with dfu-util.dhylands wrote:I can reproduce that with my STM32L476DISC (running Ubuntu 16.04 on my build machine). If I use pydfu.py (which is the default), then it seems to work fine.
So this works:while this doesn't:Code: Select all
make BOARD=STM32F476DISC deploy
MicroPython has been using pydfu.py as the default since it's faster than dfu-utilCode: Select all
make BOARD=STM32L476DISC USE_PYDFU=0 deploy
Since I was flashing the identical same image, I have to conclude that its a bug in dfu-util. I was using a version of dfu-util built from the latest sources.
Re: STM32L476 dfu upgrade bug
I think that what happens is that the very last flash block doesn't get written properly. Whether a given image will work or not depends on what exactly is in that last flash block.
Regardless, it's still a bug in dfu-util and NOT a bug in MicroPython.
Regardless, it's still a bug in dfu-util and NOT a bug in MicroPython.
-
- Posts: 363
- Joined: Sun Apr 17, 2016 1:55 pm
Re: STM32L476 dfu upgrade bug
I have read flash and make a compare, left is dfu can't run, right is fine one.dhylands wrote:I think that what happens is that the very last flash block doesn't get written properly. Whether a given image will work or not depends on what exactly is in that last flash block.
Regardless, it's still a bug in dfu-util and NOT a bug in MicroPython.
There are two block different, first is 0x4000-0x5FFF
-
- Posts: 363
- Joined: Sun Apr 17, 2016 1:55 pm
Re: STM32L476 dfu upgrade bug
second is from 0x20000-0x487FF
Re: STM32L476 dfu upgrade bug
Interesting. So not at the end, but someplace in the middle. The 0x4000 is the beginning of the block right after the filesystem.
So it's still random as to whether a given image will work or not, and it will only work until it has to call code in one of the corrupted blocks.
So it's still random as to whether a given image will work or not, and it will only work until it has to call code in one of the corrupted blocks.