Data Structures | Macros | Typedefs | Functions
JTAGfunc430FR.h File Reference

Detailed Description

JTAG Function Prototypes and Definitions.

Definition in file JTAGfunc430FR.h.

#include "Config430FR.h"
Include dependency graph for JTAGfunc430FR.h:
This graph shows which files directly or indirectly include this file:

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...
 

Macro Definition Documentation

#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 Documentation

Structure to hold text, data sections and meta data to download the program to th target

Function Documentation

word DisableMpu_430Xv2 ( void  )

This function disables the Memory Protection Unit (FRAM devices only)

Returns
word (STATUS_OK if MPU was disabled successfully, STATUS_ERROR otherwise)

Definition at line 1447 of file JTAGfunc430FR.c.

Here is the call graph for this function:

short DownloadMsp430Code ( )

Download a program to target.

Returns
received error of called funtion

Definition at line 1243 of file JTAGfunc430FR.c.

Here is the call graph for this function:

short DownloadProgram ( struct_Program program)

DownloadFile Load program data int memory sections.

Parameters
[in]programStructure containing executable code and meta data
Returns
word (STATUS_OK if verification was successful, STATUS_ERROR otherwise)

Definition at line 1176 of file JTAGfunc430FR.c.

Here is the call graph for this function:

word EraseCheck_430Xv2 ( unsigned long  StartAddr,
unsigned long  Length 
)

This function performs an Erase Check over the given memory range.

Parameters
[in]wordStartAddr (Start address of memory to be checked)
[in]wordLength (Number of words to be checked)
Returns
word (STATUS_OK if erase check was successful, STATUS_ERROR otherwise)

Definition at line 1386 of file JTAGfunc430FR.c.

Here is the call graph for this function:

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.

Parameters
[in]wordStartAddr (start address for the erase)
[in]wordLength (length of the memory section in WORDS)

Definition at line 1340 of file JTAGfunc430FR.c.

Here is the call graph for this function:

word EraseFRAMViaBootCode_430Xv2 ( word  mailBoxMode,
word  data1,
word  data2 
)

This function performs a Erase of FRxx devices using the JTAG mailbox.

Parameters
[in]wordmailBoxMode 32Bit 16Bit mode
[in]worddata1 mailbox data - first 16BIT
[in]worddata2 mailbox data - second 16BIT
Returns
word (STATUS_OK if erase was successful, STATUS_ERROR otherwise)

Definition at line 1552 of file JTAGfunc430FR.c.

Here is the call graph for this function:

word GetCoreipIdXv2 ( )

Function to determine & compare core identification info (Xv2)

Returns
word (STATUS_OK if correct JTAG ID was returned, STATUS_ERROR otherwise)

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.

Returns
word (STATUS_ERROR if fuse is blown, incorrect JTAG ID or synchronizing time-out; STATUS_OK otherwise)

Definition at line 986 of file JTAGfunc430FR.c.

Here is the call graph for this function:

word IsLockKeyProgrammed ( void  )

This function checks if the JTAG lock key is programmed.

Returns
word (STATUS_OK if fuse is blown, STATUS_ERROR otherwise)

Definition at line 1426 of file JTAGfunc430FR.c.

void jRelease ( void  )

Releases the JSBW logic.

Definition at line 65 of file JSBW.c.

Here is the call graph for this function:

void jResetJtagTap ( void  )

Reset target JTAG interface and perform fuse-HW check.

Definition at line 154 of file JSBW.c.

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()).

Parameters
data
Returns
word (TDOword - value shifted out from TDO: JTAG identification)

Definition at line 249 of file JSBW.c.

Here is the call graph for this function:

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()).

Parameters
instruction(8 bit JTAG instruction)
Returns
word (TDOword - value shifted out from TDO: JTAG identification)

Definition at line 229 of file JSBW.c.

Here is the call graph for this function:

long jsbw_Shift ( word  Format,
long  Data 
)

Shift a value into TDI (MSB first) and simultaneously shift out a value from TDO (MSB first).

Parameters
wordFormat (number of bits shifted, 8 (F_BYTE), 16 (F_WORD), 20 (F_ADDR) or 32 (F_LONG))
longData (data to be shifted into TDI)
Returns
unsigned long (scanned TDO value)

Definition at line 173 of file JSBW.c.

void jsbwJtagUnlock ( void  )

Function for resetting the JTAG lock via JSBW.

Definition at line 283 of file JSBW.c.

Here is the call graph for this function:

void JsbwMagicPattern ( void  )

Function for applying the magic pattern via JSBW.

Definition at line 271 of file JSBW.c.

Here is the call graph for this function:

word ProgramLockKey ( void  )

This function blows the security fuse.

Returns
word (TRUE if fuse blow was successful, FALSE otherwise)

Definition at line 1406 of file JTAGfunc430FR.c.

Here is the call graph for this function:

word ReadMem_430Xv2 ( word  Format,
unsigned long  Addr 
)

This function reads one byte/word from a given address in memory.

Parameters
[in]wordFormat (F_BYTE or F_WORD)
[in]wordAddr (address of memory)
Returns
word (content of the addressed memory location)

Definition at line 1260 of file JTAGfunc430FR.c.

Here is the call graph for this function:

void ReadMemQuick_430Xv2 ( unsigned long  StartAddr,
unsigned long  Length,
word *  DataArray 
)

This function reads an array of words from the memory.

Parameters
[in]wordStartAddr (Start address of memory to be read)
[in]wordLength (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.

Parameters
[in]wordAddr (0xFFFE: Perform Reset, means Load Reset Vector into PC, otherwise: Load Addr into PC)

Definition at line 1015 of file JTAGfunc430FR.c.

Here is the call graph for this function:

void StartJtagJSbw ( byte  states)

Start JTAG communication in JSBW mode.

Parameters
bytestates (reset state)

Definition at line 79 of file JSBW.c.

Here is the call graph for this function:

void UnlockBsl_430Xv2FRAM ( void  )

This function unlocks the BSL memory protection.

Definition at line 1530 of file JTAGfunc430FR.c.

Here is the call graph for this function:

word UnlockDevice_430Xv2 ( unsigned short *  password,
unsigned long  passwordLength 
)

This function unlocks the Fram memory when a JTAG password is set.

Parameters
[in]unsignedshort* password (Pointer to array containing the JTAG Password)
[in]unsignedlong passwordLength (length of the password in words)
Returns
word (STATUS_OK if memory unlock was successful, STATUS_ERROR otherwise)

Definition at line 802 of file JTAGfunc430FR.c.

Here is the call graph for this function:

word VerifyMem_430Xv2 ( unsigned long  StartAddr,
unsigned long  Length,
unsigned short const *  DataArray 
)

This function performs a Verification over the given memory range.

Parameters
[in]wordStartAddr (Start address of memory to be verified)
[in]wordLength (Number of words to be verified)
[in]word*DataArray (Pointer to array with the data)
Returns
word (STATUS_OK if verification was successful, STATUS_ERROR otherwise)

Definition at line 1398 of file JTAGfunc430FR.c.

Here is the call graph for this function:

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.

Parameters
[in]unsignedlong StartAddr (Start address of data block to be checked)
[in]unsignedlong Length (Number of words within data block)
[in]word*DataArray (Pointer to array with the data, 0 for Erase Check)
Returns
word (STATUS_OK if comparison was successful, STATUS_ERROR otherwise)

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)

Parameters
[in]wordFormat (F_BYTE or F_WORD)
[in]wordAddr (Address of data to be written)
[in]wordData (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.

Parameters
[in]wordStartAddr (Start address of target memory)
[in]wordLength (Number of words to be programmed)
[in]word*DataArray (Pointer to array with the data)

Definition at line 1092 of file JTAGfunc430FR.c.

Here is the call graph for this function:


Copyright 2016, Texas Instruments Incorporated