Add USB Bulk backend support for cmsisDAP and cable support for Sipeed SLogic Combo 8#659
Add USB Bulk backend support for cmsisDAP and cable support for Sipeed SLogic Combo 8#659aisuneko wants to merge 6 commits into
Conversation
|
According to CI messages, Windows toolchains are missing <hidapi.h>. @trabucayre Is this intended behavior? |
|
An #ifdef ENABLE_CMSISDAP
#include "cmsisDAP.hpp"
#endifBut the main issue here is this dependency is not installed by the CI -> |
|
The missing dependency is fixed on branch master. I will rebase your PR on this branch with small modifications. |
|
|
|
@trabucayre Tested again with both mem and flash programming options. Feel free to try it out with CMSIS-DAPv2 probes that you may own and tell me if there are more bugs :) Also check out #662. a byproduct from the fix above. |
|
Hi I have few remarks.
|
Will fix in my next commit.
Are there better solutions to backend selection in your opinion? After all we should leave an argument available for the user to choose a specific backend to use - there could be more backends implemented in the future such as TCP.
There are two slogic products by Sipeed:
This PR only concerns the former, but I could rename the device in concern to e.g. |
|
Sorry for the confusion. Indeed the sipeed slogic combo 8 is a cable not a board. |
|
I have added a new branch with some modifications https://github.com/trabucayre/openFPGALoader/tree/cmsisdap_backend
|
Are you planning to keep the argument in main.cpp, or to delete it and only keep the build flags? Also, what will you close this particular PR since you've opened a new branch, or else...? |
|
For the argument it's a good question. In one hand having this option allows to have control about backend type but in other hand the most important thing is to have the better/faster protocol supported by the cable. So I don't know. |
I gave it some more thought... indeed it doesn't matter that much whether or not we exposed an interface for the user to choose a specific backend. Seems that these two implementations (HID and USB Bulk) are mutually exclusive for most CMSIS-DAP probes; at least among my two such probes, one is HID only and the other is bulk only. That is, we'll likely to be dealing with only one of the two backends available at a time. I'll make one more commit to address this before merge. |
|
I have adapted your modifications in my temp branch and removed the first switch to always uses bulk -> hid -> fails. |
Sure. I think I need extra time to test the stability of this backend. I'll let you know when I think this is ready to merge. |
The current
cmsisdapcable implementation only detects cables (with specific hardcodedvid:pids) which communicates viahidapi's HID (in other words, compliant with the CMSIS-DAPv1 protocol). This PR fixes this with support for the CMSIS-DAPv2 protocol which communicates throughlibusb's USB Bulk Transfer, along with a new backend system for the cmsisdap driver class and the--cmsisdap-backendCLI argument for the user to choose from the multiple backends available, or by auto selection. OpenOCD'scmsis_dap_usb_bulk.cis used as reference.This PR also adds support for the Sipeed SLogic Combo 8 cable (
sipeed_slogic), which could not be detected by HID and only works with USB bulk.Tested with the SLogic Combo 8 and the Colorlight 5A-75B v7.0 board (Lattice LFE5U-25).
Example output: