![]() |
![]() |
JTAG Function Prototypes and Definitions.
Definition in file JTAGfunc430Xv2.h.
#include "Config430Xv2.h"
Go to the source code of this file.
Macros | |
#define | ERASE_MAIN 0xA506 |
Constant for an erase of the entire flash main memory. More... | |
#define | ERASE_BANK 0xA504 |
Constants for an erase of a single flash memory bank. More... | |
#define | ERASE_SEGMENT 0xA502 |
Constant for an erase of the selected flash memory segment. More... | |
#define | IR_CNTRL_SIG_16BIT 0xC8 |
Set the JTAG control signal register. More... | |
#define | IR_CNTRL_SIG_CAPTURE 0x28 |
Read out the JTAG control signal register. More... | |
#define | IR_CNTRL_SIG_RELEASE 0xA8 |
Release the CPU from JTAG control. More... | |
#define | IR_PREPARE_BLOW 0x44 |
Prepare for JTAG fuse blow. More... | |
#define | IR_EX_BLOW 0x24 |
Perform JTAG fuse blow. More... | |
#define | IR_DATA_16BIT 0x82 |
Set the MSP430 MDB to a specific 16-bit value with the next 16-bit data access. More... | |
#define | IR_DATA_QUICK 0xC2 |
Set the MSP430 MDB to a specific 16-bit value (RAM only) More... | |
#define | IR_DATA_PSA 0x22 |
Switch JTAG data register to PSA mode. More... | |
#define | IR_SHIFT_OUT_PSA 0x62 |
Shift out the PSA pattern generated by IR_DATA_PSA. More... | |
#define | IR_ADDR_16BIT 0xC1 |
Set the MSP430 MAB to a specific 16-bit value. More... | |
#define | IR_ADDR_CAPTURE 0x21 |
Read out the MAB data on the next 16/20-bit data access. More... | |
#define | IR_DATA_TO_ADDR 0xA1 |
Set the MSP430 MDB with a specific 16-bit value and write it to the memory address which is currently on the MAB. More... | |
#define | IR_BYPASS 0xFF |
Bypass instruction - TDI input is shifted to TDO as an output. More... | |
#define | IR_DATA_CAPTURE 0x42 |
#define | JTAG_ID 0x89 |
JTAG identification value for 430X architecture devices. More... | |
#define | JTAG_ID91 0x91 |
JTAG identification value for 430Xv2 architecture devices. More... | |
#define | JTAG_ID99 0x99 |
JTAG identification value for 430Xv2 architecture FR59XX devices. More... | |
#define | IR_COREIP_ID 0xE8 |
Instruction to determine device's CoreIP. More... | |
#define | IR_DEVICE_ID 0xE1 |
Instruction to determine device's DeviceID. More... | |
#define | IR_JMB_EXCHANGE 0x86 |
Request a JTAG mailbox exchange. More... | |
#define | IR_TEST_REG 0x54 |
Instruction for test register in 5xx. More... | |
#define | IR_TEST_3V_REG 0xF4 |
Instruction for 3 volt test register in 5xx. More... | |
#define | OUT1RDY 0x0008 |
JTAG mailbox constant -. More... | |
#define | IN0RDY 0x0001 |
JTAG mailbox constant -. More... | |
#define | JMB32B 0x0010 |
JTAG mailbox constant -. More... | |
#define | OUTREQ 0x0004 |
JTAG mailbox constant -. More... | |
#define | INREQ 0x0001 |
JTAG mailbox constant -. More... | |
#define | __DATAFORMATS__ |
#define | F_BYTE 8 |
#define | F_WORD 16 |
#define | F_ADDR 20 |
#define | F_LONG 32 |
#define | V_RESET 0xFFFE |
Triggers a regular reset on device release from JTAG control. More... | |
#define | V_BOR 0x1B08 |
Triggers a "brown-out" reset on device release from JTAG control. More... | |
#define | VPP_ON_TDI 0 |
Fuse blow voltage is supplied via the TDI pin. More... | |
#define | VPP_ON_TEST 1 |
Fuse blow voltage is supplied via the TEST pin. More... | |
#define | STOP_DEVICE 0xA55A |
#define | GetDevice GetDevice_430Xv2 |
#define | ReleaseDevice ReleaseDevice_430Xv2 |
#define | WriteMem WriteMem_430Xv2 |
#define | WriteMemQuick WriteMemQuick_430Xv2 |
#define | WriteFLASH WriteFLASH_430Xv2 |
#define | WriteFLASHallSections WriteFLASHallSections_430Xv2 |
#define | ReadMem ReadMem_430Xv2 |
#define | ReadMemQuick ReadMemQuick_430Xv2 |
#define | EraseFLASH EraseFLASH_430Xv2 |
#define | EraseCheck EraseCheck_430Xv2 |
#define | VerifyMem VerifyMem_430Xv2 |
Functions | |
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 out from the target device. It is used for very fast data block write or erasure verification. More... | |
word | GetCoreipIdXv2 () |
Function to determine & compare core identification info (Xv2) More... | |
void | jResetJtagTap (void) |
Reset target JTAG interface and perform fuse-HW check. More... | |
void | StartJtagJSbw (byte states) |
Start JTAG communication in JSBW mode. More... | |
void | jRelease (void) |
Releases the JSBW logic. More... | |
long | jsbw_Shift (word Format, long Data) |
Shift a value into TDI (MSB first) and simultaneously shift out a value from TDO (MSB first). More... | |
long | jsbw_IR_Shift (byte instruction) |
Function for shifting a new instruction into the JTAG instruction register through JSBW (MSB first, but with interchanged MSB - LSB, to simply use the same shifting function Shift()). More... | |
long | jsbw_DR_Shift (long data) |
Function for shifting data into the JTAG data register through JSBW (MSB first, but with interchanged MSB - LSB, to simply use the same shifting function Shift()). More... | |
void | JsbwMagicPattern (void) |
Function for applying the magic pattern via JSBW. More... | |
void | jsbwJtagUnlock (void) |
Function for resetting the JTAG lock via JSBW. More... | |
word | GetDevice_430Xv2 (void) |
Function to take target device under JTAG control. Disables the target watchdog. Sets the global DEVICE variable as read from the target device. More... | |
void | ReleaseDevice_430Xv2 (unsigned long Addr) |
Function to release the target device from JTAG control. More... | |
void | WriteMem_430Xv2 (word Format, unsigned long Addr, word Data) |
This function writes one byte/word at a given address ( <0xA00) More... | |
void | WriteMemQuick_430Xv2 (unsigned long StartAddr, unsigned long Length, word *DataArray) |
This function writes an array of words into the target memory. More... | |
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. More... | |
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 "WriteFLASH()" function. It conforms with the "CodeArray" structure convention of file "Target_Code_5xx_(IDE).s43" or "Target_Code.h". More... | |
word | ReadMem_430Xv2 (word Format, unsigned long Addr) |
This function reads one byte/word from a given address in memory. More... | |
void | ReadMemQuick_430Xv2 (unsigned long StartAddr, unsigned long Length, word *DataArray) |
This function reads an array of words from the memory. More... | |
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 specified by the given mode and address. Large memory devices get additional mass erase operations to meet the spec. (Could be extended with erase check via PSA) More... | |
word | EraseCheck_430Xv2 (unsigned long StartAddr, unsigned long Length) |
This function performs an Erase Check over the given memory range. More... | |
word | VerifyMem_430Xv2 (unsigned long StartAddr, unsigned long Length, word *DataArray) |
This function performs a Verification over the given memory range. More... | |
word | ProgramLockKey (void) |
This function disables JTAG access to the target device. More... | |
word | IsLockKeyProgrammed (void) |
This function checks if the JTAG lock key is programmed. More... | |
void | UnlockInfoA_430Xv2 (void) |
This function unlocks segment A of the InfoMemory (Flash) More... | |
void | UnlockBsl_430Xv2Flash (void) |
This function unlocks the BSL memory protection. More... | |
#define ERASE_BANK 0xA504 |
Constants for an erase of a single flash memory bank.
Definition at line 85 of file JTAGfunc430Xv2.h.
#define ERASE_MAIN 0xA506 |
Constant for an erase of the entire flash main memory.
Definition at line 83 of file JTAGfunc430Xv2.h.
#define ERASE_SEGMENT 0xA502 |
Constant for an erase of the selected flash memory segment.
Definition at line 87 of file JTAGfunc430Xv2.h.
#define IN0RDY 0x0001 |
JTAG mailbox constant -.
Definition at line 161 of file JTAGfunc430Xv2.h.
#define INREQ 0x0001 |
JTAG mailbox constant -.
Definition at line 167 of file JTAGfunc430Xv2.h.
#define IR_ADDR_16BIT 0xC1 |
Set the MSP430 MAB to a specific 16-bit value.
Use the 20-bit macro for 430X and 430Xv2 architectures
Definition at line 126 of file JTAGfunc430Xv2.h.
#define IR_ADDR_CAPTURE 0x21 |
Read out the MAB data on the next 16/20-bit data access.
Definition at line 128 of file JTAGfunc430Xv2.h.
#define IR_BYPASS 0xFF |
Bypass instruction - TDI input is shifted to TDO as an output.
Definition at line 133 of file JTAGfunc430Xv2.h.
#define IR_CNTRL_SIG_16BIT 0xC8 |
Set the JTAG control signal register.
Definition at line 98 of file JTAGfunc430Xv2.h.
#define IR_CNTRL_SIG_CAPTURE 0x28 |
Read out the JTAG control signal register.
Definition at line 100 of file JTAGfunc430Xv2.h.
#define IR_CNTRL_SIG_RELEASE 0xA8 |
Release the CPU from JTAG control.
Definition at line 102 of file JTAGfunc430Xv2.h.
#define IR_COREIP_ID 0xE8 |
Instruction to determine device's CoreIP.
Definition at line 145 of file JTAGfunc430Xv2.h.
#define IR_DATA_16BIT 0x82 |
Set the MSP430 MDB to a specific 16-bit value with the next 16-bit data access.
Definition at line 113 of file JTAGfunc430Xv2.h.
#define IR_DATA_PSA 0x22 |
Switch JTAG data register to PSA mode.
Definition at line 119 of file JTAGfunc430Xv2.h.
#define IR_DATA_QUICK 0xC2 |
Set the MSP430 MDB to a specific 16-bit value (RAM only)
Definition at line 115 of file JTAGfunc430Xv2.h.
#define IR_DATA_TO_ADDR 0xA1 |
Set the MSP430 MDB with a specific 16-bit value and write it to the memory address which is currently on the MAB.
Definition at line 131 of file JTAGfunc430Xv2.h.
#define IR_DEVICE_ID 0xE1 |
Instruction to determine device's DeviceID.
Definition at line 147 of file JTAGfunc430Xv2.h.
#define IR_EX_BLOW 0x24 |
Perform JTAG fuse blow.
Definition at line 108 of file JTAGfunc430Xv2.h.
#define IR_JMB_EXCHANGE 0x86 |
Request a JTAG mailbox exchange.
Definition at line 151 of file JTAGfunc430Xv2.h.
#define IR_PREPARE_BLOW 0x44 |
Prepare for JTAG fuse blow.
Definition at line 106 of file JTAGfunc430Xv2.h.
#define IR_SHIFT_OUT_PSA 0x62 |
Shift out the PSA pattern generated by IR_DATA_PSA.
Definition at line 121 of file JTAGfunc430Xv2.h.
#define IR_TEST_3V_REG 0xF4 |
Instruction for 3 volt test register in 5xx.
Definition at line 155 of file JTAGfunc430Xv2.h.
#define IR_TEST_REG 0x54 |
Instruction for test register in 5xx.
Definition at line 153 of file JTAGfunc430Xv2.h.
#define JMB32B 0x0010 |
JTAG mailbox constant -.
Definition at line 163 of file JTAGfunc430Xv2.h.
#define JTAG_ID 0x89 |
JTAG identification value for 430X architecture devices.
Definition at line 138 of file JTAGfunc430Xv2.h.
#define JTAG_ID91 0x91 |
JTAG identification value for 430Xv2 architecture devices.
Definition at line 140 of file JTAGfunc430Xv2.h.
#define JTAG_ID99 0x99 |
JTAG identification value for 430Xv2 architecture FR59XX devices.
Definition at line 142 of file JTAGfunc430Xv2.h.
#define OUT1RDY 0x0008 |
JTAG mailbox constant -.
Definition at line 159 of file JTAGfunc430Xv2.h.
#define OUTREQ 0x0004 |
JTAG mailbox constant -.
Definition at line 165 of file JTAGfunc430Xv2.h.
#define V_BOR 0x1B08 |
Triggers a "brown-out" reset on device release from JTAG control.
Definition at line 182 of file JTAGfunc430Xv2.h.
#define V_RESET 0xFFFE |
Triggers a regular reset on device release from JTAG control.
Definition at line 180 of file JTAGfunc430Xv2.h.
#define VPP_ON_TDI 0 |
Fuse blow voltage is supplied via the TDI pin.
Definition at line 186 of file JTAGfunc430Xv2.h.
#define VPP_ON_TEST 1 |
Fuse blow voltage is supplied via the TEST pin.
Definition at line 188 of file JTAGfunc430Xv2.h.
word EraseCheck_430Xv2 | ( | unsigned long | StartAddr, |
unsigned long | Length | ||
) |
This function performs an Erase Check over the given memory range.
[in] | word | StartAddr (Start address of memory to be checked) |
[in] | word | Length (Number of words to be checked) |
Definition at line 1326 of file JTAGfunc430Xv2.c.
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 specified by the given mode and address. Large memory devices get additional mass erase operations to meet the spec. (Could be extended with erase check via PSA)
[in] | word | Mode (could be ERASE_MASS or ERASE_MAIN or ERASE_SGMT) |
[in] | word | Addr (any address within the selected segment) |
Definition at line 1221 of file JTAGfunc430Xv2.c.
word GetCoreipIdXv2 | ( | ) |
Function to determine & compare core identification info (Xv2)
Definition at line 867 of file JTAGfunc430Xv2.c.
word GetDevice_430Xv2 | ( | void | ) |
Function to take target device under JTAG control. Disables the target watchdog. Sets the global DEVICE variable as read from the target device.
Definition at line 922 of file JTAGfunc430Xv2.c.
word IsLockKeyProgrammed | ( | void | ) |
This function checks if the JTAG lock key is programmed.
Definition at line 1369 of file JTAGfunc430Xv2.c.
void jRelease | ( | void | ) |
void jResetJtagTap | ( | void | ) |
long jsbw_DR_Shift | ( | long | data | ) |
Function for shifting data into the JTAG data register through JSBW (MSB first, but with interchanged MSB - LSB, to simply use the same shifting function Shift()).
data |
Definition at line 249 of file JSBW.c.
long jsbw_IR_Shift | ( | byte | instruction | ) |
Function for shifting a new instruction into the JTAG instruction register through JSBW (MSB first, but with interchanged MSB - LSB, to simply use the same shifting function Shift()).
instruction | (8 bit JTAG instruction) |
Definition at line 229 of file JSBW.c.
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 | Format (number of bits shifted, 8 (F_BYTE), 16 (F_WORD), 20 (F_ADDR) or 32 (F_LONG)) |
long | Data (data to be shifted into TDI) |
void jsbwJtagUnlock | ( | void | ) |
void JsbwMagicPattern | ( | void | ) |
word ProgramLockKey | ( | void | ) |
This function disables JTAG access to the target device.
Definition at line 1345 of file JTAGfunc430Xv2.c.
word ReadMem_430Xv2 | ( | word | Format, |
unsigned long | Addr | ||
) |
This function reads one byte/word from a given address in memory.
[in] | word | Format (F_BYTE or F_WORD) |
[in] | word | Addr (address of memory) |
Definition at line 1140 of file JTAGfunc430Xv2.c.
void ReadMemQuick_430Xv2 | ( | unsigned long | StartAddr, |
unsigned long | Length, | ||
word * | DataArray | ||
) |
This function reads an array of words from the memory.
[in] | word | StartAddr (Start address of memory to be read) |
[in] | word | Length (Number of words to be read) |
[out] | word | *DataArray (Pointer to array for the data) |
Definition at line 1181 of file JTAGfunc430Xv2.c.
void ReleaseDevice_430Xv2 | ( | unsigned long | Addr | ) |
Function to release the target device from JTAG control.
[in] | word | Addr (0xFFFE: Perform Reset, means Load Reset Vector into PC, otherwise: Load Addr into PC) |
Definition at line 951 of file JTAGfunc430Xv2.c.
void StartJtagJSbw | ( | byte | states | ) |
void UnlockBsl_430Xv2Flash | ( | void | ) |
This function unlocks the BSL memory protection.
Definition at line 1386 of file JTAGfunc430Xv2.c.
void UnlockInfoA_430Xv2 | ( | void | ) |
This function unlocks segment A of the InfoMemory (Flash)
Definition at line 1400 of file JTAGfunc430Xv2.c.
word VerifyMem_430Xv2 | ( | unsigned long | StartAddr, |
unsigned long | Length, | ||
word * | DataArray | ||
) |
This function performs a Verification over the given memory range.
[in] | word | StartAddr (Start address of memory to be verified) |
[in] | word | Length (Number of words to be verified) |
[in] | word | *DataArray (Pointer to array with the data) |
Definition at line 1338 of file JTAGfunc430Xv2.c.
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 out from the target device. It is used for very fast data block write or erasure verification.
[in] | unsigned | long StartAddr (Start address of data block to be checked) |
[in] | unsigned | long Length (Number of words within data block) |
[in] | word | *DataArray (Pointer to array with the data, 0 for Erase Check) |
Definition at line 465 of file JTAGfunc430Xv2.c.
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.
[in] | word | StartAddr (Start address of FLASH memory) |
[in] | word | Length (Number of words to be programmed) |
[in] | word | *DataArray (Pointer to array with the data) |
Definition at line 1045 of file JTAGfunc430Xv2.c.
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 "WriteFLASH()" function. It conforms with the "CodeArray" structure convention of file "Target_Code_5xx_(IDE).s43" or "Target_Code.h".
[in] | const | unsigned int *DataArray (Pointer to array with the data) |
[in] | const | unsigned long *address (Pointer to array with the startaddresses) |
[in] | const | unsigned long *length_of_sections (Pointer to array with the number of words counting from startaddress) |
[in] | const | unsigned long sections (Number of sections in code file) |
Definition at line 1118 of file JTAGfunc430Xv2.c.
void WriteMem_430Xv2 | ( | word | Format, |
unsigned long | Addr, | ||
word | Data | ||
) |
This function writes one byte/word at a given address ( <0xA00)
[in] | word | Format (F_BYTE or F_WORD) |
[in] | word | Addr (Address of data to be written) |
[in] | word | Data (shifted data) |
Definition at line 989 of file JTAGfunc430Xv2.c.
void WriteMemQuick_430Xv2 | ( | unsigned long | StartAddr, |
unsigned long | Length, | ||
word * | DataArray | ||
) |
This function writes an array of words into the target memory.
[in] | word | StartAddr (Start address of target memory) |
[in] | word | Length (Number of words to be programmed) |
[in] | word | *DataArray (Pointer to array with the data) |
Definition at line 1028 of file JTAGfunc430Xv2.c.