projects
/
goodfet
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
TI Launchpad patch from Peter Lorenzen, edited to ease the mergequake.
[goodfet]
/
firmware
/
apps
/
jtag
/
jtag.c
diff --git
a/firmware/apps/jtag/jtag.c
b/firmware/apps/jtag/jtag.c
index
bf6f8f8
..
ccddf2f
100644
(file)
--- a/
firmware/apps/jtag/jtag.c
+++ b/
firmware/apps/jtag/jtag.c
@@
-74,18
+74,18
@@
int in_state(enum eTAPState state)
void jtag_reset_target()
{
SETRST;
void jtag_reset_target()
{
SETRST;
- PLEDOUT^=PLEDPIN;
+ led_toggle();
CLRRST;
CLRRST;
- PLEDOUT^=PLEDPIN;
+ led_toggle();
}
//! Clock the JTAG clock line
void jtag_tcktock()
{
CLRTCK;
}
//! Clock the JTAG clock line
void jtag_tcktock()
{
CLRTCK;
- PLEDOUT^=PLEDPIN;
+ led_toggle();
SETTCK;
SETTCK;
-
PLEDOUT^=PLEDPIN
;
+
led_toggle()
;
}
//! Goes through test-logic-reset and ends in run-test-idle
}
//! Goes through test-logic-reset and ends in run-test-idle
@@
-519,6
+519,10
@@
uint16_t jtag_trans_16(uint16_t in)
//! Shift 8 bits of the IR.
uint8_t jtag_ir_shift_8(uint8_t in)
{
//! Shift 8 bits of the IR.
uint8_t jtag_ir_shift_8(uint8_t in)
{
+ /* Huseby's code, which breaks MSP430 support.
+ The code is broken because either the invalid jtag state error
+ causes the client to give up, or because it adds an extra clock edge.
+
if (!in_run_test_idle())
{
debugstr("Not in run-test-idle state");
if (!in_run_test_idle())
{
debugstr("Not in run-test-idle state");
@@
-528,9
+532,24
@@
uint8_t jtag_ir_shift_8(uint8_t in)
// get intot the right state
jtag_capture_ir();
jtag_shift_register();
// get intot the right state
jtag_capture_ir();
jtag_shift_register();
-
- // shift IR bits
- return jtag_trans_8(in);
+ */
+
+
+
+ // idle
+ SETTMS;
+ jtag_tcktock();
+ // select DR
+ jtag_tcktock();
+ // select IR
+ CLRTMS;
+ jtag_tcktock();
+ // capture IR
+ jtag_tcktock();
+ //jtag_state = CAPTURE_IR;
+ jtag_state = SHIFT_IR;
+ // shift IR bits
+ return jtag_trans_8(in);
}
//! Shift 16 bits of the DR.
}
//! Shift 16 bits of the DR.