-
-
Notifications
You must be signed in to change notification settings - Fork 893
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
Save blackbox file from dataflash freezes mid-download in recent versions of configurator #411
Comments
Can you check if you get any error messages in the console (right-click into configurator, click 'Inspect', console is at the bottom of the window that opens) when you get the freeze / reboot? |
Also, can you try with a different / shorter USB cable? |
hi @mikeller - sorry I haven't had the chance to get the console output. I've ended up wiring up both quads with OpenLog loggers instead (which is fantastic!). As for USB cables - tried regular coiled and 1' length, to no avail. Also tried on two different laptops and a fresh reinstall of the VCP drivers. It only occurred to me to roll back the configurator after I've eliminated all other factors. I'll update this when I get some console dump. |
@mlopyrev: Fair enough. Fyi, the XRacerSPI does not use VCP, it requires the CP2102 USB to serial drivers. |
ok cool. I'll try a fresh install of the drivers as well. Thanks for checking in on this. |
Ok, here is the console dump. (attaching a file) |
I can confirm this problem. I have a friend using a X-Racer F303 v2.1 (SPRACINGF3 target) and he was having the configurator freeze while downloading blackbox logs. I did some testing with a board of my own (same X-Racer v2.1) and was able to replicate the problem. Using latest BF 3.1.3 (all defaults), BF configurator 1.9.1. Downloading the logs will sometimes freeze - about 50% of the time for me and 100% of the time for my friend. Took a look at the debug console and got the following:
This is with the default 115,200 baud rate. Computer is a MacBook Pro with latest OS X 10.12.3. It only looks like the configurator is hanging as force killing it and reopening allows reconnection to the flight controller - not reboot needed. I haven't been able to replicate with VCP targets. |
@mikeller I tried reinstalling the latest CP210x drivers and the problem still persists. Tested on another computer with OS X 10.10 and the same issue so it's not related to an OSX 10.12 problem. The timeout is random in that it occurs at different points in the download - doesn't seem to be a pattern. The only commonality is that the debugging reports a CRC error and then the other errors. It looks like the code doesn't recover properly from the CRC error and retry the packet. Whether or not the CRC error is real and actually corrupted serial data is unknown. I've tried many different baud rates and USB cables and it doesn't seem to matter. I believe this problem is related to the jumbo packets implementation. Back when that was originally implemented I did some testing and on a couple of occasions I saw the same problem. I couldn't ever replicate it them and it seemed to stop happening so I never reported it. |
I was just able to replicate this with a VCP target (Revo) on BF 3.1.3. The behavior is the same; CRC error followed javascript errors. It doesn't look like the problem is limited to CP210x targets. The debug console from the VCP failure:
|
We've confirmed the problem with the XRACERSPI, looking into reducing the block size (and speed) for this target. I've not had any other reports of download problems with REVO, so this makes me suspect that the susceptibility to these problems might be affected by the hardware that the configurator is running on. |
@mikeller I can consistently get the SPRACERF3 target (on a X-Racer F303 v2) to fail. I tried lowering the block size in onboard_logging.js all the way down to 512 and still get occasional CRC errors and aborts (and much slower downloads). Tried multiple computers, multiple USB cables, etc. Some thoughts: Shouldn't a CRC error be recoverable? Discard the block and re-request it? Right now the code crashes. The most common point that the failure occurs is right at the very end of the download when the progress bar fills. This is not always the case, but probably about 75% of the time for me. Maybe other MSP traffic interleaved with blackbox frames causing problems and corrupting the CRC? Since I can easily replicate on both CP210x and VCP (Revo) targets I'm happy to test any debugging you want to try. |
@mikeller I've been debugging all morning and haven't come up with a reason for the CRC errors, but it looks like they're real. So instead I shifted focus on how to retry the packet and came up with a really messy fix. From the MSP processing structure it appears like it would be really difficult to generically handle retries for CRC errors so I focused on the dataflash read messages. Since the data structure and callback mechanism is the same for all message types, I had to come up with a way to pass back an indicator that a CRC error occurred to inform the caller to retry the block. Since we have the (currently) unused data compression type byte I used that as a flag (set to 255 on a CRC error). Patch files are attached for js/msp.js and js/msp/MSPHelper.js I've tested many times for both VCP and CP210x targets and have 100% success - even with high baud rates. The CRC errors are still occasionally happening (as evidenced in the console log) but the block gets retried and the download succeeds. Verified the downloaded logs exactly match between cases where they download successfully with no CRC errors and cases where the blocks have to be retried. I realize these patches are "messy" but the goal is to suggest a solution that can be integrated in a better way. |
Just another data point: Added the patches, copied the two files into 1.9.1 folders, rename existing by adding '.old' and deleting the '.txt' from patch files. Configurator now does not show opening screen and does not Connect. |
@waltr1 No, these patches are not the complete files - just the differences between the old and patched versions. You can't use these files directly. I added a second post on rcgroups with a link to a patched configurator version. https://www.rcgroups.com/forums/showpost.php?p=36811734&postcount=44503 If you want to use this you'll have to download and unzip the directory and then in Chrome go to preferences -> extensions and enable developer mode (checkbox in top-right). Then click the "Load unpacked extension…" button and locate the unzipped directory. |
Created pull request 418 with the patches. |
Thank you. I have been unable to download blackbox logs either. Usually stops near 0% and does show an i2c error lower left status line. I will try the patches. |
@jamesarm97 The patches listed here have been superseded and the final version is merged into code. So just download the current patched version from github - no need to patch yourself. |
on my KIWI.F4 boards I have identical issue as described above. |
the patched version posted above solved the issue on my KIWI.F4 boards, I still get packet errors during download but the download continues and completes (previously it would freeze on first packet error). |
Yes, #420 is already merged into master. Also, thanks for the feedback. |
Hi, I'm having the same issue on an OmnibusF4 target, running 3.1.5. |
@VolcanoG: Yes, sounds like the same problem as described above (are you using a Mac?). A workaround will be included in the next release of the configurator. |
@mikeller Yes I'm on Mac OSX, fantastic looking forward to it! |
The beta version now gets further than it did before (it use to stay on 0%), but now moves slowly and gets hundreds of bad packets. I still haven't been able to download a complete log (using beta as of a week ago). |
@jamesarm97: Are you using a Mac? If so, try downloading on a PC, there is a bug in the MacOS driver that seems to be the root cause for the high incidence of errors on Mac. |
@mikeller Yeah I tried to download the log now on a virtual machine running windows and it downloaded the file with no issue, thanks for the help man |
same issue affects Revolt v2 running on BF when trying to download blackbox logs, |
This issue / pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within a week. |
Target: X-RacerSPI (tried two boards with different configurations)
Betaflight version: 3.1.1; also tried earlier ones with same result
Configurator version: 1.9 (freezes); tried 1.8.4 (freezes), 1.7 (works), 1.3 (works)
Other symptoms: if aircraft is plugged in to power, at a random point during the dataflash download, there is a restart / ESC re-init - at that point, the download progress bar stops, but I can still see Cycle Time, CPU Load numbers move.
I'm able to use v1.3 to download the files.
The text was updated successfully, but these errors were encountered: