73 typedef unsigned short word;
74 typedef unsigned char byte;
83 #define ERASE_MAIN 0xA506
84 #define ERASE_BANK 0xA504
86 #define ERASE_SEGMENT 0xA502
98 #define IR_CNTRL_SIG_16BIT 0xC8 // original value: 0x13
99 #define IR_CNTRL_SIG_CAPTURE 0x28 // original value: 0x14
101 #define IR_CNTRL_SIG_RELEASE 0xA8 // original value: 0x15
106 #define IR_PREPARE_BLOW 0x44 // original value: 0x22
107 #define IR_EX_BLOW 0x24 // original value: 0x24
113 #define IR_DATA_16BIT 0x82 // original value: 0x41
114 #define IR_DATA_QUICK 0xC2 // original value: 0x43
119 #define IR_DATA_PSA 0x22 // original value: 0x44
120 #define IR_SHIFT_OUT_PSA 0x62 // original value: 0x46
126 #define IR_ADDR_16BIT 0xC1 // original value: 0x83
127 #define IR_ADDR_CAPTURE 0x21 // original value: 0x84
129 #define IR_DATA_TO_ADDR 0xA1 // original value: 0x85
132 #define IR_BYPASS 0xFF // original value: 0xFF
134 #define IR_DATA_CAPTURE 0x42
139 #define JTAG_ID91 0x91
141 #define JTAG_ID99 0x99
145 #define IR_COREIP_ID 0xE8 // original value: 0x17
146 #define IR_DEVICE_ID 0xE1 // original value: 0x87
151 #define IR_JMB_EXCHANGE 0x86 // original value: 0x61
152 #define IR_TEST_REG 0x54 // original value: 0x2A
154 #define IR_TEST_3V_REG 0xF4 // original value: 0x2F
159 #define OUT1RDY 0x0008
160 #define IN0RDY 0x0001
162 #define JMB32B 0x0010
164 #define OUTREQ 0x0004
170 #ifndef __DATAFORMATS__
171 #define __DATAFORMATS__
180 #define V_RESET 0xFFFE
187 #define VPP_ON_TEST 1
190 #define STOP_DEVICE 0xA55A
197 static word DR_Shift16(word Data);
198 static unsigned long DR_Shift20(
unsigned long address);
199 static word IR_Shift(byte Instruction);
200 static void ResetTAP(
void);
201 static word ExecutePOR_430Xv2(
void);
202 static void SetPC_430Xv2(
unsigned long Addr);
203 word
VerifyPSA_430Xv2(
unsigned long StartAddr,
unsigned long Length, word *DataArray);
216 #define GetDevice GetDevice_430Xv2
218 #define ReleaseDevice ReleaseDevice_430Xv2
220 #define WriteMem WriteMem_430Xv2
222 #define WriteMemQuick WriteMemQuick_430Xv2
223 void WriteFLASH_430Xv2(
unsigned long StartAddr,
unsigned long Length, word *DataArray);
224 #define WriteFLASH WriteFLASH_430Xv2
225 word
WriteFLASHallSections_430Xv2(
const unsigned int *data,
const unsigned long *address,
const unsigned long *length_of_sections,
const unsigned long sections);
226 #define WriteFLASHallSections WriteFLASHallSections_430Xv2
228 #define ReadMem ReadMem_430Xv2
230 #define ReadMemQuick ReadMemQuick_430Xv2
232 #define EraseFLASH EraseFLASH_430Xv2
234 #define EraseCheck EraseCheck_430Xv2
235 word
VerifyMem_430Xv2(
unsigned long StartAddr,
unsigned long Length, word *DataArray);
236 #define VerifyMem VerifyMem_430Xv2
246 static word CoreId = 0;
248 static unsigned long DeviceIdPointer = 0;
250 static word DeviceId = 0;
253 static unsigned short SegmentInfoAKey5xx = 0xA548;
void EraseFLASH_430Xv2(word EraseMode, unsigned long EraseAddr)
This function performs a mass erase (with and w/o info memory) or a segment erase of a FLASH module s...
void StartJtagJSbw(byte states)
Start JTAG communication in JSBW mode.
void jsbwJtagUnlock(void)
Function for resetting the JTAG lock via JSBW.
long jsbw_IR_Shift(byte instruction)
Function for shifting a new instruction into the JTAG instruction register through JSBW (MSB first...
void WriteFLASH_430Xv2(unsigned long StartAddr, unsigned long Length, word *DataArray)
This function programs/verifies an array of words into the FLASH memory by using the FLASH controller...
word VerifyMem_430Xv2(unsigned long StartAddr, unsigned long Length, word *DataArray)
This function performs a Verification over the given memory range.
word EraseCheck_430Xv2(unsigned long StartAddr, unsigned long Length)
This function performs an Erase Check over the given memory range.
Configurations for the MSP430 Replicator Xv2.
void UnlockInfoA_430Xv2(void)
This function unlocks segment A of the InfoMemory (Flash)
long jsbw_Shift(word Format, long Data)
Shift a value into TDI (MSB first) and simultaneously shift out a value from TDO (MSB first)...
word IsLockKeyProgrammed(void)
This function checks if the JTAG lock key is programmed.
word ReadMem_430Xv2(word Format, unsigned long Addr)
This function reads one byte/word from a given address in memory.
void ReleaseDevice_430Xv2(unsigned long Addr)
Function to release the target device from JTAG control.
void jRelease(void)
Releases the JSBW logic.
void WriteMem_430Xv2(word Format, unsigned long Addr, word Data)
This function writes one byte/word at a given address ( <0xA00)
word GetDevice_430Xv2(void)
Function to take target device under JTAG control. Disables the target watchdog. Sets the global DEVI...
void UnlockBsl_430Xv2Flash(void)
This function unlocks the BSL memory protection.
word WriteFLASHallSections_430Xv2(const unsigned int *data, const unsigned long *address, const unsigned long *length_of_sections, const unsigned long sections)
This function programs/verifies a set of data arrays of words into a FLASH memory by using the "Write...
word GetCoreipIdXv2()
Function to determine & compare core identification info (Xv2)
void WriteMemQuick_430Xv2(unsigned long StartAddr, unsigned long Length, word *DataArray)
This function writes an array of words into the target memory.
void ReadMemQuick_430Xv2(unsigned long StartAddr, unsigned long Length, word *DataArray)
This function reads an array of words from the memory.
void JsbwMagicPattern(void)
Function for applying the magic pattern via JSBW.
long jsbw_DR_Shift(long data)
Function for shifting data into the JTAG data register through JSBW (MSB first, but with interchanged...
word ProgramLockKey(void)
This function disables JTAG access to the target device.
word VerifyPSA_430Xv2(unsigned long StartAddr, unsigned long Length, word *DataArray)
This function compares the computed PSA (Pseudo Signature Analysis) value to the PSA value shifted ou...
void jResetJtagTap(void)
Reset target JTAG interface and perform fuse-HW check.