![]() |
![]() |
JTAG Function Prototypes and Definitions.
Definition in file JTAGfunc430FR.h.
#include "Config430FR.h"
Go to the source code of this file.
Data Structures | |
struct | struct_program |
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 | MAIN_ERASE 0x1A1A |
Constant for an erase of the FRAM Main memory on FR5xx/FR6xx. More... | |
#define | TOTAL_ERASE 0x1B1B |
Constant for an erase of the FRAM Main, INFO & IP protected memory on FR5xx/FR6xx. More... | |
#define | USER_CODE_ERASE 0x1A1A |
Constant for an erase of the FRAM Main & INFO memory including JTAG lock signature on FR4xx. More... | |
#define | STOP_DEVICE 0xA55A |
#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_ID98 0x98 |
JTAG identification value for 430Xv2 architecture FR4XX/FR2xx 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 | MAIL_BOX_32BIT 0x10 |
JTAG mailbox mode 32 bit -. More... | |
#define | MAIL_BOX_16BIT 0x00 |
JTAG mailbox moede 16 bit -. 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... | |
Typedefs | |
typedef struct struct_program | struct_Program |
Functions | |
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 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, unsigned short const *DataArray) |
This function writes an array of words into the target memory. 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... | |
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, unsigned short const *DataArray) |
This function performs a Verification over the given memory range. More... | |
word | UnlockDevice_430Xv2 (unsigned short *password, unsigned long passwordLength) |
This function unlocks the Fram memory when a JTAG password is set. More... | |
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 equals a write operation of 0xFFFF to the respective memory section. (Could be extended with erase check via PSA) This function should be used for "segment erases" only. For a "mass erase", consider using EraseFRAMViaBootCode_430Xv2 instead. More... | |
word | DisableMpu_430Xv2 (void) |
This function disables the Memory Protection Unit (FRAM devices only) More... | |
word | ProgramLockKey (void) |
This function blows the security fuse. More... | |
word | IsLockKeyProgrammed (void) |
This function checks if the JTAG lock key is programmed. More... | |
void | UnlockBsl_430Xv2FRAM (void) |
This function unlocks the BSL memory protection. More... | |
short | DownloadProgram (struct_Program *program) |
DownloadFile Load program data int memory sections. More... | |
short | DownloadMsp430Code () |
Download a program to target. More... | |
word | EraseFRAMViaBootCode_430Xv2 (word mailBoxMode, word data1, word data2) |
This function performs a Erase of FRxx devices using the JTAG mailbox. More... | |
#define ERASE_BANK 0xA504 |
Constants for an erase of a single flash memory bank.
Definition at line 74 of file JTAGfunc430FR.h.
#define ERASE_MAIN 0xA506 |
Constant for an erase of the entire flash main memory.
Definition at line 72 of file JTAGfunc430FR.h.
#define ERASE_SEGMENT 0xA502 |
Constant for an erase of the selected flash memory segment.
Definition at line 76 of file JTAGfunc430FR.h.
#define IN0RDY 0x0001 |
JTAG mailbox constant -.
Definition at line 161 of file JTAGfunc430FR.h.
#define INREQ 0x0001 |
JTAG mailbox constant -.
Definition at line 167 of file JTAGfunc430FR.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 124 of file JTAGfunc430FR.h.
#define IR_ADDR_CAPTURE 0x21 |
Read out the MAB data on the next 16/20-bit data access.
Definition at line 126 of file JTAGfunc430FR.h.
#define IR_BYPASS 0xFF |
Bypass instruction - TDI input is shifted to TDO as an output.
Definition at line 131 of file JTAGfunc430FR.h.
#define IR_CNTRL_SIG_16BIT 0xC8 |
Set the JTAG control signal register.
Definition at line 96 of file JTAGfunc430FR.h.
#define IR_CNTRL_SIG_CAPTURE 0x28 |
Read out the JTAG control signal register.
Definition at line 98 of file JTAGfunc430FR.h.
#define IR_CNTRL_SIG_RELEASE 0xA8 |
Release the CPU from JTAG control.
Definition at line 100 of file JTAGfunc430FR.h.
#define IR_COREIP_ID 0xE8 |
Instruction to determine device's CoreIP.
Definition at line 145 of file JTAGfunc430FR.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 111 of file JTAGfunc430FR.h.
#define IR_DATA_PSA 0x22 |
Switch JTAG data register to PSA mode.
Definition at line 117 of file JTAGfunc430FR.h.
#define IR_DATA_QUICK 0xC2 |
Set the MSP430 MDB to a specific 16-bit value (RAM only)
Definition at line 113 of file JTAGfunc430FR.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 129 of file JTAGfunc430FR.h.
#define IR_DEVICE_ID 0xE1 |
Instruction to determine device's DeviceID.
Definition at line 147 of file JTAGfunc430FR.h.
#define IR_EX_BLOW 0x24 |
Perform JTAG fuse blow.
Definition at line 106 of file JTAGfunc430FR.h.
#define IR_JMB_EXCHANGE 0x86 |
Request a JTAG mailbox exchange.
Definition at line 151 of file JTAGfunc430FR.h.
#define IR_PREPARE_BLOW 0x44 |
Prepare for JTAG fuse blow.
Definition at line 104 of file JTAGfunc430FR.h.
#define IR_SHIFT_OUT_PSA 0x62 |
Shift out the PSA pattern generated by IR_DATA_PSA.
Definition at line 119 of file JTAGfunc430FR.h.
#define IR_TEST_3V_REG 0xF4 |
Instruction for 3 volt test register in 5xx.
Definition at line 155 of file JTAGfunc430FR.h.
#define IR_TEST_REG 0x54 |
Instruction for test register in 5xx.
Definition at line 153 of file JTAGfunc430FR.h.
#define JMB32B 0x0010 |
JTAG mailbox constant -.
Definition at line 163 of file JTAGfunc430FR.h.
#define JTAG_ID 0x89 |
JTAG identification value for 430X architecture devices.
Definition at line 136 of file JTAGfunc430FR.h.
#define JTAG_ID91 0x91 |
JTAG identification value for 430Xv2 architecture devices.
Definition at line 138 of file JTAGfunc430FR.h.
#define JTAG_ID98 0x98 |
JTAG identification value for 430Xv2 architecture FR4XX/FR2xx devices.
Definition at line 140 of file JTAGfunc430FR.h.
#define JTAG_ID99 0x99 |
JTAG identification value for 430Xv2 architecture FR59XX devices.
Definition at line 142 of file JTAGfunc430FR.h.
#define MAIL_BOX_16BIT 0x00 |
JTAG mailbox moede 16 bit -.
Definition at line 171 of file JTAGfunc430FR.h.
#define MAIL_BOX_32BIT 0x10 |
JTAG mailbox mode 32 bit -.
Definition at line 169 of file JTAGfunc430FR.h.
#define MAIN_ERASE 0x1A1A |
Constant for an erase of the FRAM Main memory on FR5xx/FR6xx.
Definition at line 78 of file JTAGfunc430FR.h.
#define OUT1RDY 0x0008 |
JTAG mailbox constant -.
Definition at line 159 of file JTAGfunc430FR.h.
#define OUTREQ 0x0004 |
JTAG mailbox constant -.
Definition at line 165 of file JTAGfunc430FR.h.
#define TOTAL_ERASE 0x1B1B |
Constant for an erase of the FRAM Main, INFO & IP protected memory on FR5xx/FR6xx.
Definition at line 81 of file JTAGfunc430FR.h.
#define USER_CODE_ERASE 0x1A1A |
Constant for an erase of the FRAM Main & INFO memory including JTAG lock signature on FR4xx.
Definition at line 84 of file JTAGfunc430FR.h.
#define V_BOR 0x1B08 |
Triggers a "brown-out" reset on device release from JTAG control.
Definition at line 186 of file JTAGfunc430FR.h.
#define V_RESET 0xFFFE |
Triggers a regular reset on device release from JTAG control.
Definition at line 184 of file JTAGfunc430FR.h.
#define VPP_ON_TDI 0 |
Fuse blow voltage is supplied via the TDI pin.
Definition at line 190 of file JTAGfunc430FR.h.
#define VPP_ON_TEST 1 |
Fuse blow voltage is supplied via the TEST pin.
Definition at line 192 of file JTAGfunc430FR.h.
typedef struct struct_program struct_Program |
Structure to hold text, data sections and meta data to download the program to th target
word DisableMpu_430Xv2 | ( | void | ) |
This function disables the Memory Protection Unit (FRAM devices only)
Definition at line 1447 of file JTAGfunc430FR.c.
short DownloadMsp430Code | ( | ) |
Download a program to target.
Definition at line 1243 of file JTAGfunc430FR.c.
short DownloadProgram | ( | struct_Program * | program | ) |
DownloadFile Load program data int memory sections.
[in] | program | Structure containing executable code and meta data |
Definition at line 1176 of file JTAGfunc430FR.c.
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 1386 of file JTAGfunc430FR.c.
void EraseFRAM_430Xv2 | ( | unsigned long | EraseAddr, |
unsigned long | Length | ||
) |
This function performs an erase of a user defined FRAM memory section. For FRAM devices the erase equals a write operation of 0xFFFF to the respective memory section. (Could be extended with erase check via PSA) This function should be used for "segment erases" only. For a "mass erase", consider using EraseFRAMViaBootCode_430Xv2 instead.
[in] | word | StartAddr (start address for the erase) |
[in] | word | Length (length of the memory section in WORDS) |
Definition at line 1340 of file JTAGfunc430FR.c.
word EraseFRAMViaBootCode_430Xv2 | ( | word | mailBoxMode, |
word | data1, | ||
word | data2 | ||
) |
This function performs a Erase of FRxx devices using the JTAG mailbox.
[in] | word | mailBoxMode 32Bit 16Bit mode |
[in] | word | data1 mailbox data - first 16BIT |
[in] | word | data2 mailbox data - second 16BIT |
Definition at line 1552 of file JTAGfunc430FR.c.
word GetCoreipIdXv2 | ( | ) |
Function to determine & compare core identification info (Xv2)
Definition at line 930 of file JTAGfunc430FR.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 986 of file JTAGfunc430FR.c.
word IsLockKeyProgrammed | ( | void | ) |
This function checks if the JTAG lock key is programmed.
Definition at line 1426 of file JTAGfunc430FR.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 blows the security fuse.
Definition at line 1406 of file JTAGfunc430FR.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 1260 of file JTAGfunc430FR.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 1300 of file JTAGfunc430FR.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 1015 of file JTAGfunc430FR.c.
void StartJtagJSbw | ( | byte | states | ) |
void UnlockBsl_430Xv2FRAM | ( | void | ) |
This function unlocks the BSL memory protection.
Definition at line 1530 of file JTAGfunc430FR.c.
word UnlockDevice_430Xv2 | ( | unsigned short * | password, |
unsigned long | passwordLength | ||
) |
This function unlocks the Fram memory when a JTAG password is set.
[in] | unsigned | short* password (Pointer to array containing the JTAG Password) |
[in] | unsigned | long passwordLength (length of the password in words) |
Definition at line 802 of file JTAGfunc430FR.c.
word VerifyMem_430Xv2 | ( | unsigned long | StartAddr, |
unsigned long | Length, | ||
unsigned short const * | 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 1398 of file JTAGfunc430FR.c.
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 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 461 of file JTAGfunc430FR.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 1053 of file JTAGfunc430FR.c.
void WriteMemQuick_430Xv2 | ( | unsigned long | StartAddr, |
unsigned long | Length, | ||
unsigned short const * | 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 1092 of file JTAGfunc430FR.c.