![]() |
![]() |
JTAG Function Prototypes and Definitions.
Definition in file JTAGfunc430.h.
#include "Config430.h"
Go to the source code of this file.
Macros | |
#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 | JTAG_ID 0x89 |
JTAG identification value for MSP430 architecture devices. More... | |
#define | F_BYTE 8 |
#define | F_WORD 16 |
#define | V_RESET 0xFFFE |
#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... | |
Functions | |
word | DR_Shift16 (word Data) |
Function for shifting a given 16-bit word into the JTAG data register through TDI. More... | |
word | IR_Shift (byte Instruction) |
Function for shifting a new instruction into the JTAG instruction register through TDI (MSB first, but with interchanged MSB - LSB, to simply use the same shifting function, Shift(), as used in DR_Shift16). More... | |
void | ResetTAP (void) |
Reset target JTAG interface and perform fuse-HW check. More... | |
word | ExecutePOR (void) |
Function to execute a Power-On Reset (POR) using JTAG CNTRL SIG register. More... | |
word | SetInstrFetch (void) |
Function to set target CPU JTAG FSM into the instruction fetch state. More... | |
void | SetPC (word Addr) |
Load a given address into the target CPU's program counter (PC). More... | |
void | HaltCPU (void) |
Function to set the CPU into a controlled stop state. More... | |
void | ReleaseCPU (void) |
Function to release the target CPU from the controlled stop state. More... | |
word | VerifyPSA (word StartAddr, word Length, word *DataArray) |
word | GetDevice (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 (word Addr) |
Function to release the target device from JTAG control. More... | |
void | WriteMem (word Format, word Addr, word Data) |
This function writes one byte/word at a given address ( <0xA00) More... | |
void | WriteMemQuick (word StartAddr, word Length, word *DataArray) |
This function writes an array of words into the target memory. More... | |
void | WriteFLASH (word StartAddr, word Length, word *DataArray) |
This function programs/verifies an array of words into the FLASH memory by using the FLASH controller. More... | |
word | WriteFLASHallSections (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_(IDE).s43" or "Target_Code.h". More... | |
word | ReadMem (word Format, word Addr) |
This function reads one byte/word from a given address in memory. More... | |
void | ReadMemQuick (word StartAddr, word Length, word *DataArray) |
This function reads an array of words from the memory. More... | |
void | EraseFLASH (word EraseMode, word 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 (word StartAddr, word Length) |
This function performs an Erase Check over the given memory range. More... | |
word | VerifyMem (word StartAddr, word Length, word *DataArray) |
This function performs a Verification over the given memory range. More... | |
word | BlowFuse (void) |
This function blows the security fuse. More... | |
word | IsFuseBlown (void) |
This function checks if the JTAG access security fuse is blown. More... | |
void | UnlockInfoA (void) |
This Function unlocks segment A of the InfoMemory (Flash) More... | |
#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 112 of file JTAGfunc430.h.
#define IR_ADDR_CAPTURE 0x21 |
Read out the MAB data on the next 16/20-bit data access.
Definition at line 114 of file JTAGfunc430.h.
#define IR_BYPASS 0xFF |
Bypass instruction - TDI input is shifted to TDO as an output.
Definition at line 119 of file JTAGfunc430.h.
#define IR_CNTRL_SIG_16BIT 0xC8 |
Set the JTAG control signal register.
Definition at line 84 of file JTAGfunc430.h.
#define IR_CNTRL_SIG_CAPTURE 0x28 |
Read out the JTAG control signal register.
Definition at line 86 of file JTAGfunc430.h.
#define IR_CNTRL_SIG_RELEASE 0xA8 |
Release the CPU from JTAG control.
Definition at line 88 of file JTAGfunc430.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 99 of file JTAGfunc430.h.
#define IR_DATA_PSA 0x22 |
Switch JTAG data register to PSA mode.
Definition at line 105 of file JTAGfunc430.h.
#define IR_DATA_QUICK 0xC2 |
Set the MSP430 MDB to a specific 16-bit value (RAM only)
Definition at line 101 of file JTAGfunc430.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 117 of file JTAGfunc430.h.
#define IR_EX_BLOW 0x24 |
Perform JTAG fuse blow.
Definition at line 94 of file JTAGfunc430.h.
#define IR_PREPARE_BLOW 0x44 |
Prepare for JTAG fuse blow.
Definition at line 92 of file JTAGfunc430.h.
#define IR_SHIFT_OUT_PSA 0x62 |
Shift out the PSA pattern generated by IR_DATA_PSA.
Definition at line 107 of file JTAGfunc430.h.
#define JTAG_ID 0x89 |
JTAG identification value for MSP430 architecture devices.
Definition at line 123 of file JTAGfunc430.h.
#define VPP_ON_TDI 0 |
Fuse blow voltage is supplied via the TDI pin.
Definition at line 132 of file JTAGfunc430.h.
#define VPP_ON_TEST 1 |
Fuse blow voltage is supplied via the TEST pin.
Definition at line 134 of file JTAGfunc430.h.
word BlowFuse | ( | void | ) |
This function blows the security fuse.
Definition at line 1240 of file JTAGfunc430.c.
word DR_Shift16 | ( | word | data | ) |
Function for shifting a given 16-bit word into the JTAG data register through TDI.
[in] | word | data (16-bit data, MSB first) |
Definition at line 94 of file JTAGfunc430.c.
word EraseCheck | ( | word | StartAddr, |
word | 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 1220 of file JTAGfunc430.c.
void EraseFLASH | ( | word | EraseMode, |
word | 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 1044 of file JTAGfunc430.c.
word ExecutePOR | ( | void | ) |
Function to execute a Power-On Reset (POR) using JTAG CNTRL SIG register.
Definition at line 239 of file JTAGfunc430.c.
word GetDevice | ( | 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 659 of file JTAGfunc430.c.
void HaltCPU | ( | void | ) |
Function to set the CPU into a controlled stop state.
Definition at line 311 of file JTAGfunc430.c.
word IR_Shift | ( | byte | instruction | ) |
Function for shifting a new instruction into the JTAG instruction register through TDI (MSB first, but with interchanged MSB - LSB, to simply use the same shifting function, Shift(), as used in DR_Shift16).
[in] | byte | Instruction (8bit JTAG instruction, MSB first) |
Definition at line 137 of file JTAGfunc430.c.
word IsFuseBlown | ( | void | ) |
This function checks if the JTAG access security fuse is blown.
Definition at line 1290 of file JTAGfunc430.c.
word ReadMem | ( | word | Format, |
word | 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 980 of file JTAGfunc430.c.
void ReadMemQuick | ( | word | StartAddr, |
word | 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 1013 of file JTAGfunc430.c.
void ReleaseCPU | ( | void | ) |
Function to release the target CPU from the controlled stop state.
Definition at line 325 of file JTAGfunc430.c.
void ReleaseDevice | ( | word | 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 721 of file JTAGfunc430.c.
void ResetTAP | ( | void | ) |
Reset target JTAG interface and perform fuse-HW check.
Definition at line 180 of file JTAGfunc430.c.
word SetInstrFetch | ( | void | ) |
Function to set target CPU JTAG FSM into the instruction fetch state.
Definition at line 267 of file JTAGfunc430.c.
void SetPC | ( | word | Addr | ) |
Load a given address into the target CPU's program counter (PC).
[in] | word | Addr (destination address) |
Definition at line 289 of file JTAGfunc430.c.
void UnlockInfoA | ( | void | ) |
This Function unlocks segment A of the InfoMemory (Flash)
Definition at line 1307 of file JTAGfunc430.c.
word VerifyMem | ( | word | StartAddr, |
word | 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 1232 of file JTAGfunc430.c.
void WriteFLASH | ( | word | StartAddr, |
word | 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 797 of file JTAGfunc430.c.
word WriteFLASHallSections | ( | 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_(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 957 of file JTAGfunc430.c.
void WriteMem | ( | word | Format, |
word | 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 741 of file JTAGfunc430.c.
void WriteMemQuick | ( | word | StartAddr, |
word | 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 769 of file JTAGfunc430.c.