62 typedef unsigned short word;
63 typedef unsigned char byte;
72 #define ERASE_MAIN 0xA506
73 #define ERASE_BANK 0xA504
75 #define ERASE_SEGMENT 0xA502
77 #define MAIN_ERASE 0x1A1A
79 #define TOTAL_ERASE 0x1B1B
82 #define USER_CODE_ERASE 0x1A1A
85 #define STOP_DEVICE 0xA55A
96 #define IR_CNTRL_SIG_16BIT 0xC8 // original value: 0x13
97 #define IR_CNTRL_SIG_CAPTURE 0x28 // original value: 0x14
99 #define IR_CNTRL_SIG_RELEASE 0xA8 // original value: 0x15
104 #define IR_PREPARE_BLOW 0x44 // original value: 0x22
105 #define IR_EX_BLOW 0x24 // original value: 0x24
111 #define IR_DATA_16BIT 0x82 // original value: 0x41
112 #define IR_DATA_QUICK 0xC2 // original value: 0x43
117 #define IR_DATA_PSA 0x22 // original value: 0x44
118 #define IR_SHIFT_OUT_PSA 0x62 // original value: 0x46
124 #define IR_ADDR_16BIT 0xC1 // original value: 0x83
125 #define IR_ADDR_CAPTURE 0x21 // original value: 0x84
127 #define IR_DATA_TO_ADDR 0xA1 // original value: 0x85
130 #define IR_BYPASS 0xFF // original value: 0xFF
132 #define IR_DATA_CAPTURE 0x42
137 #define JTAG_ID91 0x91
139 #define JTAG_ID98 0x98
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
168 #define MAIL_BOX_32BIT 0x10
170 #define MAIL_BOX_16BIT 0x00
174 #ifndef __DATAFORMATS__
175 #define __DATAFORMATS__
184 #define V_RESET 0xFFFE
191 #define VPP_ON_TEST 1
199 static word JtagId = 0;
201 static word CoreId = 0;
203 static unsigned long DeviceIdPointer = 0;
205 static word DeviceId = 0;
208 static unsigned short SegmentInfoAKey5xx = 0xA548;
231 static word DR_Shift16(word Data);
232 static unsigned long DR_Shift20(
unsigned long address);
233 static word IR_Shift(byte Instruction);
234 static void ResetTAP(
void);
235 static word ExecutePOR_430Xv2(
void);
236 static void SetPC_430Xv2(
unsigned long Addr);
237 word
VerifyPSA_430Xv2(
unsigned long StartAddr,
unsigned long Length,
unsigned short const *DataArray);
252 void WriteMemQuick_430Xv2(
unsigned long StartAddr,
unsigned long Length,
unsigned short const *DataArray);
256 word
VerifyMem_430Xv2(
unsigned long StartAddr,
unsigned long Length,
unsigned short const *DataArray);
struct struct_program struct_Program
const unsigned long * startAddress
Array of start addresses of the sections.
word IsLockKeyProgrammed(void)
This function checks if the JTAG lock key is programmed.
word EraseFRAMViaBootCode_430Xv2(word mailBoxMode, word data1, word data2)
This function performs a Erase of FRxx devices using the JTAG mailbox.
void ReleaseDevice_430Xv2(unsigned long Addr)
Function to release the target device from JTAG control.
void JsbwMagicPattern(void)
Function for applying the magic pattern via JSBW.
void ReadMemQuick_430Xv2(unsigned long StartAddr, unsigned long Length, word *DataArray)
This function reads an array of words from the memory.
const unsigned long * sectionLength
Array of length information of the sections.
word VerifyMem_430Xv2(unsigned long StartAddr, unsigned long Length, unsigned short const *DataArray)
This function performs a Verification over the given memory range.
Configurations for the MSP430 FRAM Replicator.
word UnlockDevice_430Xv2(unsigned short *password, unsigned long passwordLength)
This function unlocks the Fram memory when a JTAG password is set.
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 blows the security fuse.
word DisableMpu_430Xv2(void)
This function disables the Memory Protection Unit (FRAM devices only)
void jResetJtagTap(void)
Reset target JTAG interface and perform fuse-HW check.
const unsigned short * textData
Array executable code and data sections.
word VerifyPSA_430Xv2(unsigned long StartAddr, unsigned long Length, unsigned short const *DataArray)
This function compares the computed PSA (Pseudo Signature Analysis) value to the PSA value shifted ou...
void StartJtagJSbw(byte states)
Start JTAG communication in JSBW mode.
void jsbwJtagUnlock(void)
Function for resetting the JTAG lock via JSBW.
unsigned long noSections
Number of sections.
void WriteMemQuick_430Xv2(unsigned long StartAddr, unsigned long Length, unsigned short const *DataArray)
This function writes an array of words into the target memory.
word EraseCheck_430Xv2(unsigned long StartAddr, unsigned long Length)
This function performs an Erase Check over the given memory range.
long jsbw_Shift(word Format, long Data)
Shift a value into TDI (MSB first) and simultaneously shift out a value from TDO (MSB first)...
short DownloadMsp430Code()
Download a program to target.
void EraseFRAM_430Xv2(unsigned long StartAddr, unsigned long Length)
This function performs an erase of a user defined FRAM memory section. For FRAM devices the erase equ...
void WriteMem_430Xv2(word Format, unsigned long Addr, word Data)
This function writes one byte/word at a given address ( <0xA00)
void UnlockBsl_430Xv2FRAM(void)
This function unlocks the BSL memory protection.
word ReadMem_430Xv2(word Format, unsigned long Addr)
This function reads one byte/word from a given address in memory.
long jsbw_IR_Shift(byte instruction)
Function for shifting a new instruction into the JTAG instruction register through JSBW (MSB first...
short DownloadProgram(struct_Program *program)
DownloadFile Load program data int memory sections.
void jRelease(void)
Releases the JSBW logic.
word GetDevice_430Xv2(void)
Function to take target device under JTAG control. Disables the target watchdog. Sets the global DEVI...
unsigned long start
Execution start address.
word GetCoreipIdXv2()
Function to determine & compare core identification info (Xv2)