Add faulty MPSEE cmd 8E workaround

This commit is contained in:
jgroman
2024-01-27 13:02:46 +01:00
parent 308e47c5c0
commit 33eaf58869
4 changed files with 38 additions and 2 deletions
+9 -2
View File
@@ -34,6 +34,7 @@ FtdiJtagMPSSE::FtdiJtagMPSSE(const cable_t &cable,
const string &dev, const string &serial, uint32_t clkHZ,
bool invert_read_edge, int8_t verbose):
FTDIpp_MPSSE(cable, dev, serial, clkHZ, verbose), _ch552WA(false),
_cmd8EWA(false),
_write_mode(MPSSE_WRITE_NEG), // always write on neg edge
_read_mode(0),
_invert_read_edge(invert_read_edge), // false: pos, true: neg
@@ -73,6 +74,12 @@ void FtdiJtagMPSSE::init_internal(const mpsse_bit_config &cable)
_ch552WA = true;
}
// This Sipeed firmware does not support MPSEE 0x8E, 0x8F commands properly
if ( (!strncmp((const char *)_imanufacturer, "SIPEED", 6))
&& (!strncmp((const char *)_iserialnumber, "2023112818", 10)) ) {
_cmd8EWA = true;
}
display("%x\n", cable.bit_low_val);
display("%x\n", cable.bit_low_dir);
display("%x\n", cable.bit_high_val);
@@ -174,8 +181,8 @@ int FtdiJtagMPSSE::toggleClk(uint8_t tms, uint8_t tdi, uint32_t clk_len)
* with 2232H, 4242H & 232H
*/
if (_ftdi->type == TYPE_2232H || _ftdi->type == TYPE_4232H ||
_ftdi->type == TYPE_232H) {
if ((_ftdi->type == TYPE_2232H || _ftdi->type == TYPE_4232H ||
_ftdi->type == TYPE_232H) && !_cmd8EWA) {
uint8_t buf[] = {static_cast<uint8_t>(0x8f), 0, 0};
while (len) {
unsigned int chunk = len;