![]() |
![]() |
JTAG Control Sequences for Erasing / Programming / Fuse Programming.
Definition in file JTAGfunc430FR.c.
#include "LowLevelFunc430Xv2.h"
#include "JTAGfunc430FR.h"
#include "FramErase.c"
#include "FramWrite.c"
#include "msp430CodeFR57_6xx.h"
Go to the source code of this file.
Macros | |
#define | SAFE_FRAM_PC 0x0004 |
#define | FR4xx_LOCKREGISTER 0x160 |
Functions | |
short | i_WriteJmbIn32 (unsigned short dataX, unsigned short dataY) |
Write a 32bit value into the JTAG mailbox system. The function timeouts if the mailbox is not empty after a certain number of retries. More... | |
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... | |
void | configure_IO_JTAG (void) |
Set JTAG pins to output direction - from REP430F to target. More... | |
word | UnlockDevice_430Xv2 (unsigned short *password, unsigned long passwordLength) |
This function unlocks the Fram memory when a JTAG password is set. More... | |
word | GetCoreipIdXv2 () |
Function to determine & compare core identification info (Xv2) 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... | |
short | WriteFram_430Xv2 (unsigned long StartAddr, unsigned long Length, unsigned short const *DataArray) |
This function programs/verifies an array of words into the Fram memory. More... | |
short | DownloadProgram (struct_Program *program) |
DownloadFile Load program data int memory sections. More... | |
short | DownloadMsp430Code () |
Download a program to target. 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 | 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. 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 | ProgramLockKey (void) |
This function blows the security fuse. More... | |
word | IsLockKeyProgrammed (void) |
This function checks if the JTAG lock key is programmed. More... | |
word | DisableMpu_430Xv2 (void) |
This function disables the Memory Protection Unit (FRAM devices only) More... | |
void | UnlockBsl_430Xv2FRAM (void) |
This function unlocks the BSL memory protection. More... | |
word | EraseFRAMViaBootCode_430Xv2 (word mailBoxMode, word data1, word data2) |
This function performs a Erase of FRxx devices using the JTAG mailbox. More... | |
Variables | |
byte | tdo_bit |
Holds the value of TDO-bit. More... | |
byte | TCLK_saved |
Holds the last value of TCLK before entering a JTAG sequence. More... | |
struct_Program | prog |
Executable code and meta data about downloaded program. More... | |
void configure_IO_JTAG | ( | void | ) |
Set JTAG pins to output direction - from REP430F to target.
Definition at line 593 of file LowLevelFunc430Xv2.c.
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.
short i_WriteJmbIn32 | ( | unsigned short | dataX, |
unsigned short | dataY | ||
) |
Write a 32bit value into the JTAG mailbox system. The function timeouts if the mailbox is not empty after a certain number of retries.
[in] | word | dataX (data to be shifted into mailbox) |
[in] | word | dataY (data to be shifted into mailbox) |
Definition at line 422 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.
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 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.
short WriteFram_430Xv2 | ( | unsigned long | StartAddr, |
unsigned long | Length, | ||
unsigned short const * | DataArray | ||
) |
This function programs/verifies an array of words into the Fram memory.
[in] | word | StartAddr (Start address of Fram memory) |
[in] | word | Length (Number of words to be programmed) |
[in] | word | *DataArray (Pointer to array with the data) |
Definition at line 1109 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.
struct_Program prog |
Executable code and meta data about downloaded program.
Definition at line 1239 of file JTAGfunc430FR.c.
byte TCLK_saved |
Holds the last value of TCLK before entering a JTAG sequence.
Definition at line 77 of file LowLevelFunc430Xv2.c.
byte tdo_bit |
Holds the value of TDO-bit.
Definition at line 75 of file LowLevelFunc430Xv2.c.