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
Must be in DFU mode to upload firmware, unless dataflash is erased first #1102
Comments
VCP targets really need to go into DFU mode.
On non-VCP targets like naze32 there is a separate chip on the board what
handles the serial connection to UART (acts as FTDI)
If you would want to flash going in DFU mode you would have to use UART
with ftdi.
But why do you have problems going into DFU? With zadig drivers setup
correctly it should all be easy.
You have to separately setup zadig for DFU and for normal configuring in
case you didnt know.
|
If its set correctly it goes into DFU automatically on flash button.
|
@joshuabardwell You can try the method I use When you try to flash the FW and it fails, do not unplug the board from usb, now just go to the zadig program and replace or update the win driver, when its complete unplug the usb and reconnect it, now when you go into BF and try to flash the fw it will automatically change to dfu mode and install the fw. |
To address these questions: I am using a board with CP210. This board should be able to flash without manually entering DFU mode. It only works when dataflash is manually erased before uploading new firmware. Entering DFU mode is inconvenient if the FC has bootloader pads instead of button; if the FC is installed in a frame and is not accessible, such as with Holybro Shuriken; etc... There are lots of cases where it is inconvenient to manually enter DFU mode. For VCP targets, if manual DFU mode is required, so be it. There are lots of CP210 targets that don't need it. I request that a change be made to the flashing procedure to avoid the need to manually erase flash to avoid the timeout. @Rossbow my drivers are correct r.e. Zadig. Everything works 100% if I manually press the bootloader button. |
You never have to go into DFU mode on cp210 boards.
You also dont need zadig drivers for those.
|
I respectfully disagree. I am basically never able to flash new firmware without going into DFU mode on the Xracer F303, for example. Clearing the dataflash chip before uploading is the only thing that has fixed it. |
You for sure dont have to. I have quite a few boards where it always works.
But....there is a known windows driver bug on some cp210 versions and maybe
thats what you mean. I forgot the exact cp210 part names as there are few
different ones.
But basically some versions of cp210 are buggy only on windows where
flashing goes wrong in certain scenarios.
I found a workaround. When flashing always connect. Than
disconnect....disconnect cable / power and than connect cable and go to
flash.
So basically only go straight to flash and dont connect and read/write
other things to the board prior flashing and dont flash on the first
connect to this board.
That might be the only explaination for your case that I know.
|
There is a CLI command called dfu :) it will put the board into DFU mode. It works for F4 - just not F3 yet (though is easily added for those targets too) |
Naze works fine with no reboot sequence turned off ... |
@joshuabardwell perhaps skipping erasing / checking the onboard BB flash during firmware upgrade will fix it... I have one F303 based board (with a CP chip) that will only flash if manual baud rate is set at 57600 and no reboot sequence is off. |
I'm really thinking this is a windows driver bug as Boris suggested. I use OSX and have X-Racer F303's (v1 and v2.1) in all my quads and never have had to go into DFU mode to flash them - with or without full chip erase (doesn't matter). This is across 6 different quads and with all the BF testing I've probably flashed them 100's of times! :) On my desk I have some old Naze32 rev5's I use for testing and never have to go into DFU mode either (they also have the CP2102). |
There is definitely something wrong with either the CP210x drivers or the configurator (or Chrome) on Windows. Just took a clean (fully updated) Windows 10 machine, installed the latest CP210x and I get unreliable firmware flashing with both a Naze32 rev5 and X-Racer F303 (v2). Sometimes I can flash with no problems, sometimes the verify phase will stall and timeout, and other times there'll be a bootloader timeout and I have to use DFU mode. The workaround that Boris suggested (connect/disconnect, unplug, plug, flash) seems to allow the flash to start reliably but I still get intermittent timeouts during the verify phase. Never have any of these problems on OSX and apparently everything is fine on Linux as well. |
Latest 3.0.0 RC13 has working dfu cli command so you can force it into DFU |
Added further parameter group diffs in CLI
please help. failed to open serial port |
only will connect in cli mode I've downloaded all the latest drivers and version of both betaflight as well as cleanflight not sure what to do at this point |
@Samus1rebooted Please redirect your support request to appropriate places on the net, such as a thread in RCG. You can look for a thread by entering your FC brand/model in the search dialogue there. |
Please reopen! I can confirm this bug with BF 4.0.2 and newest configurator on Ubuntu Linux 18.04. When I try to enter DFU mode either with the DFU button in the configurator or with the flash button and there is data in the data flash it will not properly enter DFU mode. It will instead crash after reboot and the beeper continuously beeps (one continuous tone). dmesg shows this when it reboots into DFU (an USB device appears but it is dead):
When I press the boot button while powering up the FC I see this instead (which is how it should be):
No matter what I do it won't enter DFU through software reset without freezing and activating the beeper unless I erase data flash! When the data flash is empty it will allow me to enter DFU from software without a problem and without need for boot button, I can just press the "flash" button in betaflight configurator and it will immediately work. When there is data in the flash it will show the above symptoms. |
I cannot upload new firmware to my boards unless I am in DFU mode. This has always confused me because other people seem to be able to flash without going into DFU mode, and I was always able to do it on my Naze32, unless I messed something up. A viewer of mine pointed out that it seems that the configurator tries to erase the dataflash chip before upgrading the firmware, and this causes a timeout. This can be fixed by manually erasing the dataflash just before uploading the firmware. To my amazement, this seems to be correct, although I have a limited number of boards to test on.
Can this be fixed? Forcing DFU mode to flash firmware is a real pain on many copters with enclosed FC such as some ARF and RTF models, but also more enclosed frames like Armattan Armadillo for example.
The text was updated successfully, but these errors were encountered: