what is sequence for writing and reading DMI (debug module interface) register using Jlink Script APIS?
I’m able read JTAG Id, DTMCS registers using JLink Script APIs (DTM registers). But to access DM registers, we have to write 66-bits of data in to DMI (debug module interface access) register.
I followed below sequence. but it is not working.
void JTAG_DMI_WRITE(unsigned int addr, unsigned int val) {
int BitPos;
JTAG_WriteIR(0x11);
JLINK_JTAG_StartDR();
JLINK_JTAG_WriteDRCont(2, 2);
BitPos = JLINK_JTAG_WriteDRCont(val, 32);
JLINK_JTAG_WriteDREnd(addr, 32);
}
unsigned int JTAG_DMI_READ(unsigned int addr) {
int BitPos;
unsigned int val0;
unsigned int val1;
unsigned int val2;
JTAG_WriteIR(0x11);
JLINK_JTAG_StartDR();
BitPos = JLINK_JTAG_WriteDRCont(1, 2);
JLINK_JTAG_WriteDRCont(0, 32);
JLINK_JTAG_WriteDREnd(addr, 32);
val0 = JTAG_GetU32(BitPos);
val1 = JTAG_GetU32(BitPos+32);
val2 = JTAG_GetU32(BitPos+64);
return val0;
}
--
You received this message because you are subscribed to the Google Groups "RISC-V Debug Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to debug+un...@groups.riscv.org.
To post to this group, send email to de...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/debug/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/debug/BL2PR04MB206756726CC86DCC6CA974779A170%40BL2PR04MB2067.namprd04.prod.outlook.com.
--
You received this message because you are subscribed to the Google Groups "RISC-V Debug Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to debug+un...@groups.riscv.org.
To post to this group, send email to de...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/debug/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/debug/DM5PR2201MB10366742B7AE1C29AE9FE3AEF9170%40DM5PR2201MB1036.namprd22.prod.outlook.com.