MSP430 DLL API Documentation  3.9.1.2
Classes | Typedefs | Enumerations | Functions
MSP430.h File Reference

This file contains the Application Programming Interface (API) to access an MSP430 microcontroller via JTAG using the MSP430.DLL. This file contains the DLL function headers and definitions. More...

Go to the source code of this file.

Classes

union  DEVICE_T
 Device information structure. More...
 

Typedefs

typedef int32_t STATUS_T
 this is the definition for the DLL functions return value More...
 
typedef enum STATUS_CODE STATUS_CODE_t
 Status codes of the DLL functions. More...
 
typedef union DEVICE_T DEVICE_T_t
 Device information structure. More...
 
typedef enum CPU_ARCH_TYPE CPU_ARCH_TYPE_t
 
typedef enum TARGET_ARCHITECTURE TARGET_ARCHITECTURE_t
 
typedef enum READ_WRITE READ_WRITE_t
 
typedef enum ENABLE_DISABLE ENABLE_DISABLE_t
 
typedef enum RESET_METHOD RESET_METHOD_t
 Device reset methods. More...
 
typedef enum ERASE_TYPE ERASE_TYPE_t
 FLASH erase type. More...
 
typedef enum CONFIG_MODE CONFIG_MODE_t
 Configurations to set with MSP430_Configure. More...
 
typedef enum INTERFACE_TYPE INTERFACE_TYPE_t
 Configurations values for CONFIG_MODE INTERFACE_MODE. More...
 
typedef enum INTERFACE_SPEED INTERFACE_SPEED_t
 Configurations values for CONFIG_MODE INTERFACE_SPEED. More...
 
typedef enum FILE_TYPE FILE_TYPE_t
 File types. More...
 
typedef enum ERROR_CODE ERROR_CODE_t
 
typedef enum SYSTEM_EVENT_MSP SYSTEM_EVENT_MSP_t
 
typedef void(* SYSTEM_NOTIFY_CALLBACK )(SYSTEM_EVENT_MSP_t MySystemEvent)
 

Enumerations

enum  STATUS_CODE {
  STATUS_ERROR = -1,
  STATUS_OK = 0
}
 Status codes of the DLL functions. More...
 
enum  CPU_ARCH_TYPE {
  CPU_ARCH_ORIGINAL,
  CPU_ARCH_X,
  CPU_ARCH_XV2,
  CPU_ARCH_ARM
}
 
enum  TARGET_ARCHITECTURE {
  MSP430,
  MSP432_M4
}
 
enum  READ_WRITE {
  WRITE = 0,
  READ = 1
}
 
enum  ENABLE_DISABLE {
  DISABLE = 0,
  ENABLE = 1
}
 
enum  RESET_METHOD {
  PUC_RESET = (1 << 0),
  RST_RESET = (1 << 1),
  VCC_RESET = (1 << 2),
  FORCE_RESET = (1 << 3),
  ALL_RESETS = (PUC_RESET | RST_RESET | VCC_RESET),
  FORCE_PUC_RESET = (FORCE_RESET | PUC_RESET),
  FORCE_RST_RESET = (FORCE_RESET | RST_RESET),
  FORCE_VCC_RESET = (FORCE_RESET | VCC_RESET)
}
 Device reset methods. More...
 
enum  ERASE_TYPE {
  ERASE_SEGMENT = 0,
  ERASE_MAIN = 1,
  ERASE_ALL = 2,
  ERASE_TOTAL = 3,
  ERASE_USER_CODE = 4
}
 FLASH erase type. More...
 
enum  CONFIG_MODE {
  VERIFICATION_MODE = 0,
  EMULATION_MODE = 1,
  LOCKED_FLASH_ACCESS = 5,
  EDT_TRACE_MODE = 7,
  INTERFACE_MODE = 8,
  SET_MDB_BEFORE_RUN = 9,
  RAM_PRESERVE_MODE = 10,
  UNLOCK_BSL_MODE =11,
  DEVICE_CODE = 12,
  WRITE_EXTERNAL_MEMORY = 13,
  DEBUG_LPM_X = 14,
  SET_INTERFACE_SPEED = 15,
  TOTAL_ERASE_DEVICE = 16,
  ET_CURRENTDRIVE_FINE = 17,
  SOFTWARE_BREAKPOINTS = 18
}
 Configurations to set with MSP430_Configure. More...
 
enum  INTERFACE_TYPE {
  JTAG_IF = 0,
  SPYBIWIRE_IF = 1,
  SPYBIWIREJTAG_IF = 2,
  AUTOMATIC_IF = 3,
  UNDEF_IF = 4,
  SPYBIWIRE_DCDC = 5,
  SPYBIWIRE_MSP_FET_IF = 6,
  JTAG_MSP432 = 7,
  SWD_MSP432 = 8
}
 Configurations values for CONFIG_MODE INTERFACE_MODE. More...
 
enum  INTERFACE_SPEED {
  FAST = 0,
  MEDIUM = 1,
  SLOW = 2
}
 Configurations values for CONFIG_MODE INTERFACE_SPEED. More...
 
enum  FILE_TYPE {
  FILETYPE_AUTO,
  FILETYPE_TI_TXT,
  FILETYPE_INTEL_HEX
}
 File types. More...
 
enum  ERROR_CODE { ERROR_DEFINITIONS }
 
enum  SYSTEM_EVENT_MSP {
  FET_CONNECTION_LOST,
  DEVICE_CONNECTION_LOST,
  FET_RESTART_NEEDED,
  DEVICE_IN_LPM5_MODE,
  DEVICE_WAKEUP_LPM5_MODE,
  FET_OVERCURRENT,
  FET_FPGA_TIMOUT
}
 

Functions

DLL430_SYMBOL STATUS_T WINAPI MSP430_SET_SYSTEM_NOTIFY_CALLBACK (SYSTEM_NOTIFY_CALLBACK parSystemNotifyCallback)
 Initialize the SYSTEM NOTIFYCALLBACK. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_SetTargetArchitecture (TARGET_ARCHITECTURE_t architecture)
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_LoadDeviceDb (const char *file)
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_ClearDeviceDb ()
 Remove all loaded devices from the device database. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_Initialize (const char *port, int32_t *version)
 Initialize the interface. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_Close (int32_t vccOff)
 Close the interface. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_GetJtagID (int32_t *JtagId)
 Deprecated. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_GetFoundDevice (uint8_t *FoundDevice, int32_t count)
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_OpenDevice (const char *Device, const char *Password, int32_t PwLength, int32_t DeviceCode, int32_t setId)
 Identify the device, and compare the found device to the expected device. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_Device (int32_t localDeviceId, uint8_t *buffer, int32_t count)
 Obtain the device information. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_Configure (int32_t mode, int32_t value)
 Configure the mode(s) of the device and/or the software. Possible configuration modes are covered by the enum CONFIG_MODE. See notes for details of different modes to be configured. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_VCC (int32_t voltage)
 Set the device Vcc pin to voltage/1000 volts.
The USB JTAG adaptor also checks if external power is supplied to the traget device. If an external voltage is detected MSP430_VCC() returns STATUS_ERROR and one of the corresponding error codes. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_GetCurVCCT (int32_t *voltage)
 Report back the current voltage supplied to the target device. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_GetExtVoltage (int32_t *voltage, int32_t *state)
 Detect if external voltage is supplied to the target device. Report back the value of an external voltage as well as an corresponding state. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_Reset (int32_t method, int32_t execute, int32_t releaseJTAG)
 Reset the device using the specified method(s). Optionally start device execution, and release the JTAG control signals. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_Erase (int32_t type, int32_t address, int32_t length)
 Erase the device FLASH/FRAM memory. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_Memory (int32_t address, uint8_t *buffer, int32_t count, int32_t rw)
 Read and write the device memory. "Device memory" includes the Special Function Registers (i.e., peripheral registers), RAM, Information (FLASH/FRAM) memory, Bootstrap Loader memory (BLS) and Main (FLASH/FRAM) memory. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_Secure (void)
 The device is secured (i.e., the JTAG security fuse is blown).
MSP-FET430UIF USB JTAG adaptor >>> DOES <<< support this feature. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_ReadOutFile (int32_t wStart, int32_t wLength, const char *lpszFileName, int32_t iFileType)
 Read the specified range of device memory, and write it to the specified file. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_ProgramFile (const char *File, int32_t eraseType, int32_t verifyMem)
 The contents of the specified file are input, and then written to the device. The device is optionally erased prior to being written. The device is optionally verified after being written. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_VerifyFile (const char *File)
 Compare the MSP430 memory and the contents of the specified file. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_VerifyMem (int32_t StartAddr, int32_t Length, const uint8_t *DataArray)
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_EraseCheck (int32_t StartAddr, int32_t Length)
 Verify that the specified memory range is erased. More...
 
DLL430_SYMBOL int32_t WINAPI MSP430_Error_Number (void)
 Determine the number of the error when a MSP430_xxx() function returns STATUS_ERROR. More...
 
DLL430_SYMBOL const char *WINAPI MSP430_Error_String (int32_t errorNumber)
 Determine the string associated with errorNumber. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_GetNumberOfUsbIfs (int32_t *Number)
 Returns the number of MSP-FET430UIF USB FETs connected to the PC system. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_GetNameOfUsbIf (int32_t Idx, char **Name, int32_t *Status)
 Get the name of a Virtual Com Port (VCP), Human Interface Device (HID) or Communication Device Class (CDC) device index assigned to a certain MSP-FET430UIF USB FET. Also the status of the MSP-FET430UIF is returned (ENABLE/DISABLE). More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_GetInterface_Type (enum INTERFACE_TYPE *type)
 Determine the type of interface for the connection to the device. More...
 

Detailed Description

This file contains the Application Programming Interface (API) to access an MSP430 microcontroller via JTAG using the MSP430.DLL. This file contains the DLL function headers and definitions.

         The MSP430.DLL provides the following functionalities:
         - Initialize a selected JTAG interface (FET)
         - Setting target's supply voltage
         - Identifing a device
         - Programming/Erasing the identified device
         - Program/Erase check of device memory
Project:
MSPDebugStack (MSP430.dll)
Developed using:
MS Visual C++ 2013
Version
3.09.01.002
Supported API calls:
Version History:
  • Version 3.2.01.009 - 10/18/2011
  • Version 3.2.05.004 - 09/14/2012
  • Version 3.3.00.005 - 01/29/2013
  • Version 3.3.00.006 - 01/31/2013
  • Version 3.3.01.003 - 06/24/2013
  • Version 3.3.01.004 - 09/17/2013
  • Version 3.3.01.204 - 11/07/2013
  • Version 3.3.01.205 - 12/02/2013
  • Version 3.4.00.018 - 01/20/2014
  • Version 3.4.00.019 - 01/24/2014
  • Version 3.4.00.020 - 01/27/2014
  • Version 3.4.00.230 - 02/20/2014
  • Version 3.4.01.000 - 04/01/2014
  • Version 3.4.02.007 - 08/26/2014
  • Version 3.4.03.004 - 11/20/2014
  • Version 3.5.00.001 - 04/29/2015
  • Version 3.5.01.001 - 08/10/2015
  • Version 3.7.00.011 - 02/16/2016
  • Version 3.9.01.002 - 11/24/2016

Typedef Documentation

typedef int32_t STATUS_T

this is the definition for the DLL functions return value

typedef enum STATUS_CODE STATUS_CODE_t

Status codes of the DLL functions.

typedef union DEVICE_T DEVICE_T_t

Device information structure.

typedef enum READ_WRITE READ_WRITE_t

Device reset methods.

typedef enum ERASE_TYPE ERASE_TYPE_t

FLASH erase type.

typedef enum CONFIG_MODE CONFIG_MODE_t

Configurations to set with MSP430_Configure.

Configurations values for CONFIG_MODE INTERFACE_MODE.

Configurations values for CONFIG_MODE INTERFACE_SPEED.

typedef enum FILE_TYPE FILE_TYPE_t

File types.

typedef enum ERROR_CODE ERROR_CODE_t
typedef void(* SYSTEM_NOTIFY_CALLBACK)(SYSTEM_EVENT_MSP_t MySystemEvent)

Enumeration Type Documentation

Status codes of the DLL functions.

Enumerator
STATUS_ERROR 

DLL functions return this value on failure

STATUS_OK 

this value is returned on success

Enumerator
CPU_ARCH_ORIGINAL 
CPU_ARCH_X 
CPU_ARCH_XV2 
CPU_ARCH_ARM 
Enumerator
MSP430 
MSP432_M4 
enum READ_WRITE
Enumerator
WRITE 
READ 
Enumerator
DISABLE 
ENABLE 

Device reset methods.

Enumerator
PUC_RESET 

Power up clear (i.e., a "soft") reset

RST_RESET 

RST/NMI (i.e., "hard") reset

VCC_RESET 

Cycle Vcc (i.e., a "power on") reset

FORCE_RESET 
ALL_RESETS 

combines all possible reset methods enumerated in enum RESET_METHOD !!DEPRECATED, do not use any longer

FORCE_PUC_RESET 

forces a Power up clear reset

FORCE_RST_RESET 

forces a RST/NMI clear reset Non-Xv2 devices will be running and executing code after the reset

FORCE_VCC_RESET 

forces a Vcc clear reset Non-Xv2 devices will be running and executing code after the reset !!DEPRECATED, do not use any longer

enum ERASE_TYPE

FLASH erase type.

Enumerator
ERASE_SEGMENT 

Erase a segment

ERASE_MAIN 

Erase all MAIN memory

ERASE_ALL 

Erase all MAIN and INFORMATION memory not including IP protected area

ERASE_TOTAL 

Erase all MAIN and INFORMATION memory including IP protected area

ERASE_USER_CODE 

Erase all MAIN and INFORMATION memory via Jtag mailbox

Configurations to set with MSP430_Configure.

Enumerator
VERIFICATION_MODE 

Verify data downloaded to FLASH memories

EMULATION_MODE 

4xx emulation mode

LOCKED_FLASH_ACCESS 

Allows Locked Info Mem Segment A access (if set to '1')

EDT_TRACE_MODE 

Trace mode in EDT file format

INTERFACE_MODE 

Configure interface protocol: JTAG or Spy-bi-Wire (see enum INTERFACE_TYPE)

SET_MDB_BEFORE_RUN 

Configure a value that will be placed on the devices' MemoryDataBus right before the device gets released from JTAG. Used for Software Breakpoints.

RAM_PRESERVE_MODE 

Configure whether RAM content should be preserved/restored in MSP430_Erase() and MSP430_Memory() or not. RAM_PRESERVE_MODE is set to ENABLE by default. Usage Example for initial flash programming: (1) MSP430_Configure(RAM_PRESERVE_MODE, DISABLE); (2) MSP430_Erase(ERASE_ALL,..,..); (3) MSP430_Memory(..., ..., ..., WRITE ); (4) MSP430_Memory(..., ..., ..., READ ); ..... Flash Programming/Download finished (n) MSP430_Configure(RAM_PRESERVE_MODE, ENABLE);

UNLOCK_BSL_MODE 

Configure the DLL to allow read/write/erase access to the 5xx Bootstrap Loader (BSL) memory segments.

DEVICE_CODE 
WRITE_EXTERNAL_MEMORY 
DEBUG_LPM_X 
SET_INTERFACE_SPEED 
TOTAL_ERASE_DEVICE 
ET_CURRENTDRIVE_FINE 
SOFTWARE_BREAKPOINTS 

Configurations values for CONFIG_MODE INTERFACE_MODE.

Enumerator
JTAG_IF 

4 Wire JTAG protocol used

SPYBIWIRE_IF 

2 Wire (Spy-bi-wire) JTAG protocol used

SPYBIWIREJTAG_IF 

2 Wire Devices accessed by 4wire JTAG protocol

AUTOMATIC_IF 

Protocol will be detected automatically

UNDEF_IF 
SPYBIWIRE_DCDC 
SPYBIWIRE_MSP_FET_IF 
JTAG_MSP432 
SWD_MSP432 

Configurations values for CONFIG_MODE INTERFACE_SPEED.

Enumerator
FAST 

INTERFACE_SPEED JTAG/SBW fast

MEDIUM 

INTERFACE_SPEED JTAG/SBW medium

SLOW 

INTERFACE_SPEED JTAG/SBW slow

enum FILE_TYPE

File types.

Enumerator
FILETYPE_AUTO 

Auto detect

FILETYPE_TI_TXT 

TI text

FILETYPE_INTEL_HEX 

Intel hex

enum ERROR_CODE
Enumerator
ERROR_DEFINITIONS 
Enumerator
FET_CONNECTION_LOST 

System event FET connection is lost.

DEVICE_CONNECTION_LOST 

System event device connection is lost.

FET_RESTART_NEEDED 

System event FET restart needed.

DEVICE_IN_LPM5_MODE 

System event device entered LPMx.5.

DEVICE_WAKEUP_LPM5_MODE 

System event devices wakes up from LPMx.5.

FET_OVERCURRENT 

System event - overcurrent detection on JTAG lines or VCC line.

FET_FPGA_TIMOUT 

System event - Timout occourt during FPGA DR/IR shift.

Function Documentation

STATUS_T WINAPI MSP430_SET_SYSTEM_NOTIFY_CALLBACK ( SYSTEM_NOTIFY_CALLBACK  parSystemNotifyCallback)

Initialize the SYSTEM NOTIFYCALLBACK.

Note
If DEBUG_LPM_X has been previously configured, this will start polling for LPMX.5 events.
This function should be called after MSP430_OpenDevice() function.
Parameters
parSystemNotifyCallback,:To initialize the system notify callback an instance of the enum SYSTEM_EVENT_MSP must be provided to the set function.
Returns
STATUS_OK: The callback was initialized successfully.
STATUS_ERROR: The callback was not initialized successfully.
Error codes:
INITIALIZE_ERR
DLL430_SYMBOL STATUS_T WINAPI MSP430_SetTargetArchitecture ( TARGET_ARCHITECTURE_t  architecture)
DLL430_SYMBOL STATUS_T WINAPI MSP430_LoadDeviceDb ( const char *  file)
STATUS_T MSP430_ClearDeviceDb ( )

Remove all loaded devices from the device database.

Returns
STATUS_OK: The device info was removed.
STATUS_ERROR: The device info was not removed.
STATUS_T MSP430_Initialize ( const char *  port,
int32_t *  version 
)

Initialize the interface.

Note
1. This function must be called first.
2. MSP430_VCC() must be called second (after MSP430_Initialize() is called).
3. When initializing the MSP-FET430UIF (TI USB FET) parameter 'version' could contain the value -1 or -3. This means that the Dll and the MSP-FET430UIF do not have the same version (-3 means a major internal update is required). MSP430_FET_FwUpdate() should be called. MSP430_FET_FwUpdate() is part of the Maintenance API of the Dll. When -3 was returned and calling MSP430_FET_FwUpdate(), the file CDC.log must exist in the directory of the executed binary and the content must be the string "True" without a newline. This file signals that a CDC driver is installed and prevents the update from making the MSP-FET430UIF unusable.
Parameters
port,:Interface port reference (application specific).
  • To initialize TI's MSP-FET430UIF USB Jtag adapter the parameter port should point to the string 'TIUSB' or just 'USB'.
  • TI's MSP-FET430UIF USB Jtag adapter create Virtual Com Ports (VCPs) on the PC system (see Device Manager). It is also possible to directly pass the name of a dedicated VCP via this parameter (e.g. 'COM4, COM23,...). This can be used to support multiple MSP-FET430UIF interfaces on one PC. The later generation of USB development tools (eZ430-RF2500) no longer uses the VCP approach. These tools enumerate as Human Interface Devices (HID) on the USB. Since DLL version 2.03.00.000 it is also possible to directly pass the name of a dedicated HID via this parameter. When using a v3 MSP-FET430UIF it is enumerated as Communication Device Class (CDC). Refer to MSP430_GetNumberOfUsbIfs() and MSP430_GetNameOfUsbIf() for more information on VCP, HID and CDC.
version,:The version number of the MSP430 DLL is returned (if version is not NULL). A value of -1 or -3 reports a version conflict between the Dll and USB FET f/w. In that case please refer to MSP430_FET_FwUpdate() on how to update the firmware of the MSP-FET430UIF.
Returns
STATUS_OK: The interface was initialized.
STATUS_ERROR: The interface was not initialized.
Error codes:
INITIALIZE_ERR
USB_FET_NOT_FOUND_ERR
USB_FET_BUSY_ERR
COMM_ERR
STATUS_T MSP430_Close ( int32_t  vccOff)

Close the interface.

Note
1. If called, this function must be called last.
Parameters
vccOff,:Turn off the device Vcc (0 volts) if TRUE.
Returns
STATUS_OK: The interface was closed.
STATUS_ERROR: The interface was not closed.
Error codes:
CLOSE_ERR
VCC_ERR
STATUS_T MSP430_GetJtagID ( int32_t *  JtagId)

Deprecated.

Note
This function is deprecated and will be removed. Do not use.
DLL430_SYMBOL STATUS_T WINAPI MSP430_GetFoundDevice ( uint8_t *  FoundDevice,
int32_t  count 
)
STATUS_T WINAPI MSP430_OpenDevice ( const char *  Device,
const char *  Password,
int32_t  PwLength,
int32_t  DeviceCode,
int32_t  setId 
)

Identify the device, and compare the found device to the expected device.

Note
1. MSP430_Initialize() and MSP430_VCC() must have been called prior to calling this function.
2. It is possible to successfully (i.e. return status: STATUS_OK) identify another device as set"FOUND_OTHER_DEVICE".
3. Use the setId parameter and MSP430_State(state, TRUE, FALSE) to stop a running device (without resetting it).
4. Following MSP430_OpenDevice():
  • the device is reset, is not executing, and is under JTAG control.
  • the JTAG interface is enabled and the JTAG signals are negated.
Parameters
Device,:Device, which should be initialized
Password,:JTAG password to access JTAG
PwLength,:Password length in WORDS
DeviceCode,:Activation code for devices. Example: L092 or C092
setId,:If setId is not DEVICE_UNKNOWN, the device is set to setId. Otherwise the device is determined.
Returns
STATUS_OK: Target device was connected and found in the database.
STATUS_ERROR: The device was not obtained.
Error codes:
PARAMETER_ERR
NO_DEVICE_ERR
DEVICE_UNKNOWN_ERR
READ_MEMORY_ERR
READ_FUSES_ERR
FUSE_BLOWN_ERR
CONFIGURATION_ERR
FOUND_OTHER_DEVICE
WRONG_PASSWORD
STATUS_T MSP430_Device ( int32_t  localDeviceId,
uint8_t *  buffer,
int32_t  count 
)

Obtain the device information.

Note
1. This function can be used to determine the devices supported by the driver; a device identification of NUMofDevices is returned to indicate that there are no additional devices.
Parameters
localDeviceId,:An index (from zero) used to specify the device.
buffer,:A pointer to a buffer where the device identity and information is stored. See DEVICE_T for details.
count,:The number of bytes to return in the buffer (i.e., the buffer size). Must be at least sizeof(DEVICE_T)
Returns
STATUS_OK: The device identify and information was obtained.
STATUS_ERROR: The device identity and information was not obtained.
Error codes:
PARAMETER_ERR
STATUS_T MSP430_Configure ( int32_t  mode,
int32_t  value 
)

Configure the mode(s) of the device and/or the software. Possible configuration modes are covered by the enum CONFIG_MODE. See notes for details of different modes to be configured.

Note
1. VERIFICATION_MODE value = TRUE : Verify data downloaded to FLASH memories. value = FALSE: No verification.
  1. EMULATION_MODE Configure F4xx emulation mode according the set value.
  2. CLK_CNTRL_MODE Configure the EEM Clock control register value. Do NOT use after calling MSP430_Eem_Init().
  3. MCLK_CNTRL_MODE Configure the EEM Module Clock control register value. Do NOT use after calling MSP430_Eem_Init().
  4. LOCKED_FLASH_ACCESS value = TRUE : Allows Locked Info Mem Segment A erase/write access. value = FALSE: Flash Segment stays locked during erase/write operations.
  5. EDT_TRACE_MODE Deprecated
  6. INTERFACE_MODE Configure JTAG interface protocol: JTAG or Spy-bi-Wire (see enum INTERFACE_TYPE)
  7. SET_MDB_BEFORE_RUN Configure a value that will be placed on the devices' MemoryDataBus right before the device gets released from JTAG. Used for Software Breakpoints.
  8. RAM_PRESERVE_MODE Configure whether RAM content should be preserved/restored in MSP430_Erase() and MSP430_Memory() or not. RAM_PRESERVE_MODE is set to ENABLE by default.
Parameters
mode,:Mode (enum CONFIG_MODE) to be configured. See notes above for details.
value,:Mode value.
Returns
STATUS_OK: Mode was configured.
STATUS_ERROR: Mode was not configured.
Error codes:
PARAMETER_ERR
UNLOCK_BSL_ERR
INTERFACE_SUPPORT_ERR
STATUS_T MSP430_VCC ( int32_t  voltage)

Set the device Vcc pin to voltage/1000 volts.
The USB JTAG adaptor also checks if external power is supplied to the traget device. If an external voltage is detected MSP430_VCC() returns STATUS_ERROR and one of the corresponding error codes.

Note
1. A "voltage" of zero (0) turns off voltage to the device.
2. This function must be called second (after MSP430_Initialize() is called).
Parameters
voltage,:The device Vcc pin is set to voltage/1000 volts.
Returns
STATUS_OK: The Vcc was set to voltage.
STATUS_ERROR: The Vcc was not set to voltage.
Error codes:
PARAMETER_ERR
VCC_ERR
LOW_EX_POWER
EX_POWER_OK
HIGH_EX_POWER
STATUS_T MSP430_GetCurVCCT ( int32_t *  voltage)

Report back the current voltage supplied to the target device.

Note
1. This function is only supported by the MSP-FET430UIF USB JTAG adaptor.
  1. Beeing called when using Parallel Port tool the function returns a dummmy value of 3000 in case MSP430_VCC() has been called prior.
Parameters
voltage,:The current voltage supplied to the device.
Returns
STATUS_OK: The current voltage is reported back.
STATUS_ERROR: The current voltage can not be reported back.
Error codes:
COMM_ERR
STATUS_T MSP430_GetExtVoltage ( int32_t *  voltage,
int32_t *  state 
)

Detect if external voltage is supplied to the target device. Report back the value of an external voltage as well as an corresponding state.

Note
1. This function is only supported by the MSP-FET430UIF USB JTAG adaptor.
  1. Beeing called when using Parallel Port tool the function returns a dummmy voltage value of 0 and NO_EX_POWER as the state value. Prallel Port tool is not be able to measure external power supply!
Parameters
voltage,:The current external voltage.
state,:External voltage can have one of the following states:
  • NO_EX_POWER, no external power was detected
  • LOW_EX_POWER, external power is too low
  • EX_POWER_OK, external power detected
  • HIGH_EX_POWER, external power too high
Returns
STATUS_OK: The function was executed successfully.
STATUS_ERROR: The function was not executed successfully.
Error codes:
COMM_ERR
STATUS_T MSP430_Reset ( int32_t  method,
int32_t  execute,
int32_t  releaseJTAG 
)

Reset the device using the specified method(s). Optionally start device execution, and release the JTAG control signals.

Note
1. It is possible to combine reset methods. The methods are applied in the following order: PUC then RST_NMI then VCC. If a reset operation fails, the next reset method (if any) is applied.
2. Following reset by RST/NMI and/or VCC, a PUC is automatically executed to reset the device in such a way that it does not begin to execute a resident program (or garbage).
3. The device registers are updated (for read using MSP430_Registers()) following MSP430_Reset().
Parameters
method,:The bit mask specifying the method(s) to use to reset the device:
  • PUC_RESET: The device is reset using PUC (i.e., a "soft" reset).
  • RST_RESET: The device is reset using the RST/NMI pin (i.e., a "hard" reset).
  • VCC_RESET: The device is reset by cycling power to the device.
  • FORCE_PUC_RESET, FORCE_RST_RESET, FORCE_VCC_RESET
execute,:Start device execution (when TRUE).
releaseJTAG,:Release the JTAG control signals (when TRUE). execute must be TRUE.
Returns
STATUS_OK: The device was reset (and optionally started [and JTAG control released])
STATUS_ERROR: The device was not reset (and optionally started [and JTAG control released]).
Error codes:
PARAMETER_ERR
RESET_ERR
RUN_ERR
NO_DEVICE_ERR
STATUS_T MSP430_Erase ( int32_t  type,
int32_t  address,
int32_t  length 
)

Erase the device FLASH/FRAM memory.

Note
1. MSP430_OpenDevice() must have been called prior to calling this function.
2. Use MSP430_Read_Memory() to determine the address of a failed erase operation.
3. If address+length extends beyond the segment containing address, intermediate segments are erased (and checked).
4. Following erasure of the memory, the device oscillator will be set to approx. 2.1MHz.
5. Some device families have a locked INFO memory segment (INFO A). MSP430_Configure(LOCKED_FLASH_ACCESS,...) can be used to unlock/lock this segment. Having parameter 'type' set to ERASE_ALL will erase the complete INFO memory in case the INFO A segment was unlocked prior. Otherwise only INFO segments B, C and D will be erased.
6. Some device families have a lockable BSL memory segment. MSP430_Configure(UNLOCK_BSL_MODE,...) can be used to unlock/lock this segment. Having parameter 'type' set to ERASE_ALL will erase the complete BSL memory in case the BSL memory was unlocked prior.
7. Devices using FRAM memory can be erased even though it is technically not necessary. Doing so will fill the erased memory with 0xFFFF to be consistent with FLASH devices.
Parameters
type,:The type parameter specifies what should be erased.
  • ERASE_SEGMENT: Erase the segment containing 'address'.
  • ERASE_MAIN: Erase the Main memory.
  • ERASE_ALL: Erase the Main, Information and Bootstrap Loader memory.
address,:Starting address of erase check operation. Must be word aligned.
length,:Length of erase check operation (even number of bytes).
Returns
STATUS_OK: The device FLASH/FRAM memory was erased.
STATUS_ERROR: The device FLASH/FRAM memory was not erased.
Error codes:
PARAMETER_ERR
PRESERVE_RESTORE_ERR
FREQUENCY_ERR
ERASE_ERR
STATUS_T MSP430_Memory ( int32_t  address,
uint8_t *  buffer,
int32_t  count,
int32_t  rw 
)

Read and write the device memory. "Device memory" includes the Special Function Registers (i.e., peripheral registers), RAM, Information (FLASH/FRAM) memory, Bootstrap Loader memory (BLS) and Main (FLASH/FRAM) memory.

Note
1. A data write operation can be verified by performing a data read operation followed by a comparison at the application level or by using MSP430_VerifyMem().
2. Usually, FLASH memory must be erased before the write to FLASH memory operation is performed. The write to FLASH memory operation DOES NOT erase the FLASH before the operation is performed. ***
3. Following a write to FLASH, the device oscillator will be set to approx. 2.1MHz.
Parameters
address,:The starting address of the device memory to be read or written.
buffer,:The buffer into which device memory is read, or from which device memory is written.
count,:The number of bytes of device memory read or written.
rw,:Specify a read (READ) or write (WRITE) operation.
Returns
STATUS_OK: The memory operation encountered no errors.
STATUS_ERROR: The memory operation encountered errors.
Error codes:
PARAMETER_ERR
NO_DEVICE_ERR
READ_MEMORY_ERR
WRITE_MEMORY_ERR
BSL_MEMORY_LOCKED_ERR
PRESERVE_RESTORE_ERR
FREQUENCY_ERR
STATUS_T MSP430_Secure ( void  )

The device is secured (i.e., the JTAG security fuse is blown).
MSP-FET430UIF USB JTAG adaptor >>> DOES <<< support this feature.

Note
1. MSP430_OpenDevice() must have been called prior to calling this function.
2. Once a device is secure, further communications via JTAG is not possible.
3. After MSP430_Secure(), the device is reset with Vcc set to ((MaxOp + MinOp) / 2) volts (*) and Vpp set to 0 volts (*). (*) Implementation dependent.
Returns
STATUS_OK: The device was secured.
STATUS_ERROR: The device was not secured.
Error codes:
DEVICE_UNKNOWN_ERR
BLOW_FUSE_ERR
STATUS_T MSP430_ReadOutFile ( int32_t  wStart,
int32_t  wLength,
const char *  lpszFileName,
int32_t  iFileType 
)

Read the specified range of device memory, and write it to the specified file.

Note
Parameters
wStart,:The starting address of the device memory to read.
wLength,:The length of the device memory to read (even number of bytes).
lpszFileName,:Pointer to the filename into which the read device memory is written.
iFileType,:The type of the file into which the read device memory is written:
  • TI text: FILETYPE_TI_TXT
  • Intel hex: FILETYPE_INTEL_HEX
Returns
STATUS_OK: The device memory was read and written to the specified file.
STATUS_ERROR: The device memory was not read or written to the specified file.
Error codes:
PARAMETER_ERR
NO_DEVICE_ERR
READ_MEMORY_ERR
FILE_IO_ERR
INTERNAL_ERR
STATUS_T MSP430_ProgramFile ( const char *  File,
int32_t  eraseType,
int32_t  verifyMem 
)

The contents of the specified file are input, and then written to the device. The device is optionally erased prior to being written. The device is optionally verified after being written.

Note
1. MSP430_OpenDevice() must have been called prior to calling this function.
2. The file type must be one of TI text or Intel hex.
3. verifyMem operation does not read the device memory and compare it to the file. Instead, this operation computes a checksum for the device memory, and then computes a checksum for the file, and finally compares the two checksums.
4. Following a write to FLASH/FRAM, the device oscillator will be set to approx. 2.1MHz.
5. Following verifyMem, the device is reset.
Parameters
File,:Pointer to filename.
eraseType,:Type of device erasure:
  • ERASE_ALL: Erase all Main and Information memories.
  • ERASE_MAIN: Erase all Main memories.
verifyMem,:Verify the device if TRUE.
Returns
STATUS_OK: The file contents were input and were written to the device.
STATUS_ERROR: The file contents were not input or were not written to the device.
Error codes:
DEVICE_UNKNOWN_ERR
NO_DEVICE_ERR
PARAMETER_ERR
FILE_OPEN_ERR
FILE_END_ERR
FILE_DETECT_ERR
FILE_IO_ERR
FILE_DATA_ERR
PRESERVE_RESTORE_ERR
FREQUENCY_ERR
ERASE_ERR
READ_MEMORY_ERR
WRITE_MEMORY_ERR
VERIFY_ERR
ERR_INTEL_HEX_CODE
STATUS_T MSP430_VerifyFile ( const char *  File)

Compare the MSP430 memory and the contents of the specified file.

Note
1. The file type must be one of TI text or Intel hex.
2. This function does not read the device memory and compare it to the file. Instead, this operation computes a checksum for the device memory, and then computes a checksum for the file, and finally compares the two checksums.
3. The device is reset following this operation.
Parameters
File,:Pointer to filename.
Returns
STATUS_OK: The file contents were input and compare with the device memory.
STATUS_ERROR: The file contents were not input or did not compare with the device memory.
Error codes:
PARAMETER_ERR
NO_DEVICE_ERR
FILE_OPEN_ERR
FILE_END_ERR
FILE_DETECT_ERR
FILE_IO_ERR
FILE_DATA_ERR
VERIFY_ERR
ERR_INTEL_HEX_CODE
DLL430_SYMBOL STATUS_T WINAPI MSP430_VerifyMem ( int32_t  StartAddr,
int32_t  Length,
const uint8_t *  DataArray 
)
STATUS_T MSP430_EraseCheck ( int32_t  StartAddr,
int32_t  Length 
)

Verify that the specified memory range is erased.

Note
1. This function does not read the specified memory region and compare it to erased data. Instead, this function computes a checksum for the specified memory region, and then computes a checksum for erased data, and finally compares the two checksums.
2. The device is reset following this operation.
Parameters
StartAddr,:Start address of memory to be verified (must be even).
Length,:Number of BYTEs to be verified (must be even).
Returns
STATUS_OK: The device memory in the specified range is erased.
STATUS_ERROR: The device memory in the specified range is not erased.
Error codes:
PARAMETER_ERR
NO_DEVICE_ERR
VERIFY_ERR
STATUS_T MSP430_Error_Number ( void  )

Determine the number of the error when a MSP430_xxx() function returns STATUS_ERROR.

Note
1. The error number is reset (to NO_ERR) after the error number is returned.
Returns
The number of the last error.
const char * MSP430_Error_String ( int32_t  errorNumber)

Determine the string associated with errorNumber.

Parameters
errorNumber,:Error number.
Returns
The string associated with errorNumber.
STATUS_T MSP430_GetNumberOfUsbIfs ( int32_t *  Number)

Returns the number of MSP-FET430UIF USB FETs connected to the PC system.

Parameters
Number,:Return parameter. Number of MSP-FET430UIFs connected.
Returns
STATUS_OK: USB was sucessfully scanned for connected MSP-FET430UIFs.
STATUS_ERROR: Could not scan USB for connected MSP-FET430UIFs.
Error codes:
INITIALIZE_ERR
PARAMETER_ERR
STATUS_T MSP430_GetNameOfUsbIf ( int32_t  Idx,
char **  Name,
int32_t *  Status 
)

Get the name of a Virtual Com Port (VCP), Human Interface Device (HID) or Communication Device Class (CDC) device index assigned to a certain MSP-FET430UIF USB FET. Also the status of the MSP-FET430UIF is returned (ENABLE/DISABLE).

Note
1. MSP430_GetNumberOfUsbIfs() must be called prior to this function.
Parameters
Idx,:Zero based index to the name of a certain MSP-FET430UIF. Must be a value between 0 and 'number' returned by MSP430_GetNumberOfUsbIfs();
Name,:Pointer to the MSP-FET430UIF's name string.
Status,:Status of the MSP-FET430UIF,
  • ENABLE (The MSP-FET430UIF is already used by another debugger instance)
  • DISABLE (The MSP-FET430UIF is free to be used)
Returns
STATUS_OK: MSP-FET430UIF information was returned.
STATUS_ERROR: MSP-FET430UIF information was NOT returned.
Error codes:
INITIALIZE_ERR
PARAMETER_ERR
USB_FET_NOT_FOUND_ERR
STATUS_T MSP430_GetInterface_Type ( enum INTERFACE_TYPE type)

Determine the type of interface for the connection to the device.

Returns
STATUS_OK: Connection type was returned.
STATUS_ERROR: Could not get the connection type.