I have some HDL that is passing JTAG to my serial flash and vice versa. I have been debugging for some time, but to my surprise I have now seen that the source of the issue is on the DJTG API side.
I have attached some scope shots that show TDO (yellow) and TCK (blue). So this is ground truth. It can be a little hard to parse, but the expected byte pattern returned is 0x00 0x20 0xBA 0x18 (spi flash ID code). That is the data that is returned as shown in the scope captures.
But the data in the tdi buffer is instead 0x00 0x30 0xBA 0x08. So you can see a bit is added and a bit missing.
Here is a snippet of my DJTG api calls. Am I doing something wrong? I currently have the TCK set for 1MHZ conservatively.
// reset and transition state machine to SHIFT-IR
if (!DjtgPutTmsTdiBits(hif, irShiftSetup, NULL, 10, fFalse)) {
printf("DjtgPutTmsTdiBits failed\n");
ErrorExit();
}
// send User1 Code (0x02) and then transition to SHIFT-DR
if (!DjtgPutTmsTdiBits(hif, user1CodeAndGotoShiftDr, NULL, 10, fFalse)) {
printf("DjtgPutTmsTdiBits failed\n");
ErrorExit();
}
// now we are connected to the SPI flash chip and we can directly clock
// out the request for spi flash ID
// 0x9f
getSpiIdTdiArray[0] = reverse_bits(getSpiIdTdiArray[0]);
Question
Nichobeg
I have some HDL that is passing JTAG to my serial flash and vice versa. I have been debugging for some time, but to my surprise I have now seen that the source of the issue is on the DJTG API side.
I have attached some scope shots that show TDO (yellow) and TCK (blue). So this is ground truth. It can be a little hard to parse, but the expected byte pattern returned is 0x00 0x20 0xBA 0x18 (spi flash ID code). That is the data that is returned as shown in the scope captures.
But the data in the tdi buffer is instead 0x00 0x30 0xBA 0x08. So you can see a bit is added and a bit missing.
Here is a snippet of my DJTG api calls. Am I doing something wrong? I currently have the TCK set for 1MHZ conservatively.
Any help is appreciated. Thank you.
BYTE rgbTdo[4];
BYTE irShiftSetup[] = { 0xaa, 0xa2, 0x00 };
BYTE user1CodeAndGotoShiftDr[] = { 0x04, 0xa8, 0x00 };
BYTE dataCmd[] = { 0x40, 0x00 };
BYTE tms[] = { 0x1F };
BYTE getSpiIdTdiArray[1] = {0x9F};
// reset and transition state machine to SHIFT-IR
if (!DjtgPutTmsTdiBits(hif, irShiftSetup, NULL, 10, fFalse)) {
printf("DjtgPutTmsTdiBits failed\n");
ErrorExit();
}
// send User1 Code (0x02) and then transition to SHIFT-DR
if (!DjtgPutTmsTdiBits(hif, user1CodeAndGotoShiftDr, NULL, 10, fFalse)) {
printf("DjtgPutTmsTdiBits failed\n");
ErrorExit();
}
// now we are connected to the SPI flash chip and we can directly clock
// out the request for spi flash ID
// 0x9f
getSpiIdTdiArray[0] = reverse_bits(getSpiIdTdiArray[0]);
if (!DjtgPutTdiBits(hif, fFalse, getSpiIdTdiArray, NULL, 8, fFalse)) {
printf("DjtgPutTdiBits failed\n");
ErrorExit();
}
if (!DjtgGetTdoBits(hif, fFalse, fFalse, rgbTdo, 24, fFalse)) {
printf("DjtgGetTdoBits failed\n");
ErrorExit();
}
fixing small typo
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now