![]() |
![]() |
JTAG Control Sequences for Erasing / Programming / Fuse Programming.
Definition in file JTAGfunc430Xv2.c.
#include "LowLevelFunc430Xv2.h"
#include "JTAGfunc430Xv2.h"
#include "FlashErase.c"
#include "FlashWrite.c"
Go to the source code of this file.
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... | |
void | configure_IO_JTAG (void) |
Set JTAG pins to output direction - from REP430F to target. 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, 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... | |
void | EraseFLASH_430Xv2_wo_release (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 without releasing the device from JTAG control. 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 | UnlockBsl_430Xv2Flash (void) |
This function unlocks the BSL memory protection. More... | |
void | UnlockInfoA_430Xv2 (void) |
This function unlocks segment A of the InfoMemory (Flash) 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... | |
void configure_IO_JTAG | ( | void | ) |
Set JTAG pins to output direction - from REP430F to target.
Definition at line 593 of file LowLevelFunc430Xv2.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 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.
void EraseFLASH_430Xv2_wo_release | ( | 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 without releasing the device from JTAG control. 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 1269 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.
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 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.
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.