word GetDevice (void) |
|
Takes the target MSP430 device under JTAG control. Sets the target device's CPU watchdog to a hold state; sets the global DEVICE variable. |
|
|
Arguments: |
None |
|
|
Result: |
word (STATUS_ERROR if fuse is blown, JTAG_ID is incorrect (not = 0x89) or synchronizing time-out occurs; STATUS_OK otherwise) |
void ReleaseDevice (word Addr) |
|
Releases the target device from JTAG control; CPU starts execution at the specified PC address |
|
|
Arguments: |
word Addr (0xFFFE: perform reset; address at reset vector loaded into PC; |
|
otherwise address specified by Addr loaded into PC) |
|
|
Result: |
None |
void WriteMem (word Format, word Addr, word Data) |
|
Writes a single byte or word to a given address (RAM/peripheral only) |
|
|
Arguments: |
word Format (F_BYTE or F_WORD) |
|
word Addr (destination address for data to be written) |
|
word Data (data value to be written) |
|
|
Result: |
None |
void WriteMemQuick (word StartAddr, word Length, word *DataArray) |
|
Writes an array of words into the target device memory (RAM/peripheral only) |
|
|
Arguments: |
word StartAddr (start address of destination memory) |
|
word Length (number of words to be programmed) |
|
word *DataArray (pointer to array containing the data) |
|
|
Result: |
None |
void WriteFLASH (word StartAddr, word Length, word *DataArray) |
|
Programs/verifies an array of words into flash memory using the flash controller of the target device |
|
|
Arguments: |
word StartAddr (start address of destination flash memory) |
|
word Length (number of words to be programmed) |
|
word *DataArray (pointer to array containing the data) |
|
|
Result: |
None |
word WriteFLASHallSections(const unsigned int *data, const unsigned long *address, const unsigned long *length_of_sections, const unsigned
long sections) |
|
Programs and 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. |
|
|
Arguments: |
const unsigned int *DataArray (pointer to array with the data) |
|
|
|
const unsigned long *address (pointer to array with the startaddresses) |
|
|
|
const unsigned long *length_of_sections (pointer to array with the number of words counting from startaddress) |
|
|
|
const unsigned long sections (number of sections in code file) |
|
|
Result: |
word (STATUS_OK if verification was successful, STATUS_ERROR otherwise) |
word ReadMem (word Format, word Addr) |
|
Reads one byte or word from a specified target memory address |
|
|
Arguments: |
word Format (F_BYTE or F_WORD) |
|
word Addr (target address for data to be read) |
|
|
Result: |
word (data value stored in the target address memory location) |
void ReadMemQuick (word StartAddr, word Length, word *DataArray) |
|
Reads an array of words from target memory |
|
|
Arguments: |
word StartAddr (start address of target memory to be read) |
|
word Length (number of words to be read) |
|
word *DataArray (pointer to array for data storage) |
|
|
Result: |
None |
void EraseFLASH (word EraseMode, word EraseAddr) |
|
Performs a mass erase (with or without information memory) or a segment erase of a flash module specified by the given mode and address |
|
|
Arguments: |
word EraseMode (ERASE_MASS, ERASE_MAIN or ERASE_SGMT) |
|
word EraseAddr (any address within the selected segment to be erased) |
|
|
Result: |
None |
word EraseCheck (word StartAddr, word Length) |
|
Uses the VerifyPSA function to perform an erase check over the given memory range |
|
|
Arguments: |
word StartAddr (start address of memory to be checked) |
|
word Length (number of words to be checked) |
|
|
Result: |
word (STATUS_OK if erase check was successful, STATUS_ERROR otherwise) |
word VerifyMem (word StartAddr, word Length, word *DataArray) |
|
Performs a program verification over the given memory range |
|
|
Arguments: |
word StartAddr (start address of memory to be verified) |
|
word Length (number of words to be verified) |
|
word *DataArray (pointer to array containing the data) |
|
|
Result: |
word (STATUS_OK if verification was successful, STATUS_ERROR otherwise) |
For MSP430 and MSP430X architecture devices, the following functions are defined:
word BlowFuse (void) |
|
Programs (or blows) the JTAG interface access security fuse. This function also checks for a successfully programmed fuse using the IsFuseBlown() prototype. |
|
|
Arguments: |
None |
|
|
Result: |
word (STATUS_OK if fuse blow was successful, STATUS_ERROR otherwise) |
word IsFuseBlown (void) |
|
Determines if the security fuse has been programmed on the target device |
|
|
Arguments: |
None |
|
|
Result: |
word (STATUS_OK if fuse is blown, STATUS_ERROR otherwise) |
void UnlockInfoA(void) |
|
Unlocks segment A of the InfoMemory (Flash) |
|
|
Arguments: |
None |
|
|
Result: |
None |
For MSP430Xv2 architecture (flash and FRAM devices), the following functions are defined:
word ProgramLockKey(void) |
|
Disables JTAG access to the target device. |
|
|
Arguments: |
None |
|
|
Result: |
word (TRUE if fuse blow was successful, FALSE otherwise) |
word IsLockKeyProgrammed(void) |
|
Checks if the JTAG lock key is programmed. |
|
|
Arguments: |
None |
|
|
Result: |
word (STATUS_OK if fuse is blown, STATUS_ERROR otherwise) |
For MSP430Xv2 architecture (only flash devices), the following functions are defined:
void UnlockInfoA_430Xv2(void) |
|
Unlocks segment A of the InfoMemory (flash). |
|
|
Arguments: |
None |
|
|
Result: |
None |
void UnlockBsl_430Xv2Flash(void) |
|
Unlocks the BSL memory protection. |
|
|
Arguments: |
None |
|
|
Result: |
None |
For MSP430Xv2 architecture (only FRAM devices), the following functions are defined:
word UnlockDevice_430Xv2(unsigned short* password, unsigned long passwordLength) |
|
Unlocks the FRAM memory when a JTAG password is set |
|
|
Arguments: |
unsigned short* password (Pointer to array containing the JTAG Password) |
|
|
|
unsigned long passwordLength (length of the password in words) |
|
|
Result: |
word (STATUS_OK if memory unlock was successful, STATUS_ERROR otherwise) |
void EraseFRAM_430Xv2(unsigned long StartAddr, unsigned long Length) |
|
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. |
|
|
Arguments: |
word StartAddr (start address for the erase) |
|
|
|
word Length (length of the memory section in WORDS) |
|
|
Result: |
None |
word DisableMpu_430Xv2(void) |
|
Disables the Memory Protection Unit (FRAM devices only) |
|
|
Arguments: |
None |
|
|
Result: |
word (STATUS_OK if MPU was disabled successfully, STATUS_ERROR otherwise) |
word DisableFramWprod_430Xv2(void) |
|
Disables the Memory Write Protection (FRAM devices only FR6047, FR5994) |
|
|
Arguments: |
None |
|
|
Result: |
word (STATUS_OK if Memory Write Protection was disabled successfully, STATUS_ERROR otherwise) |
void UnlockBsl_430Xv2FRAM(void) |
|
Unlocks the BSL memory protection. |
|
|
Arguments: |
None |
|
|
Result: |
None |
word EraseFRAMViaBootCode_430Xv2(word mailBoxMode, word data1, word data2) |
|
Performs a Erase of FRxx devices using the JTAG mailbox. |
|
|
Arguments: |
word mailBoxMode 32Bit 16Bit mode |
|
|
|
word data1 mailbox data - first 16BIT |
|
|
|
word data2 mailbox data - second 16BIT |
|
|
Result: |
word (STATUS_OK if erase was successful, STATUS_ERROR otherwise) |
short DownloadProgram(struct_Program* program) |
|
This function downloads a converted MSP430.txt file |
|
|
Arguments: |
struct_Program* program Structure containing executable code and memory data |
|
|
Result: |
word STATUS_OK if verification was successful, STATUS_ERROR otherwise |
short DownloadMsp430Code() |
|
This function configures all needed information to download a program into target memory. After configuration is done it calls the DownloadProgram() function. |
|
|
Arguments: |
None |
|
|
Result: |
None |