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

This file contains the DLL function headers and definitions to support the debugging functions of the MSP430.DLL. More...

Go to the source code of this file.

Classes

struct  EEM_GCLKCTRL
 
struct  EEM_MCLKCTRL
 

Typedefs

typedef enum DEVICE_REGISTERS DEVICE_REGISTERS_t
 Temporary work-around to #defines in stdconst.h (and others) More...
 
typedef enum RUN_MODES RUN_MODES_t
 Run modes. More...
 
typedef enum STATE_MODES STATE_MODES_t
 State modes. More...
 
typedef enum EMEX_MODE EMEX_MODE_t
 One of the following enumerations is returned in device.emulation. More...
 
typedef enum DEVICE_CLOCK_CONTROL DEVICE_CLOCK_CONTROL_t
 One of the following enumerations is returned in device.clockControl. More...
 
typedef struct EEM_GCLKCTRL EemGclkCtrl_t
 
typedef struct EEM_MCLKCTRL EemMclkCtrl_t
 

Enumerations

enum  DEVICE_REGISTERS {
  R0 = 0,
  R1 = 1,
  R2 = 2,
  R3 = 3,
  R4 = 4,
  R5 = 5,
  R6 = 6,
  R7 = 7,
  R8 = 8,
  R9 = 9,
  R10 = 10,
  R11 = 11,
  R12 = 12,
  R13 = 13,
  R14 = 14,
  R15 = 15,
  xPSR = 16,
  SPECIAL_REGISTERS = 17,
  MSP_SP = 18,
  PSP_SP = 19
}
 Temporary work-around to #defines in stdconst.h (and others) More...
 
enum  RUN_MODES {
  FREE_RUN = 1,
  SINGLE_STEP = 2,
  RUN_TO_BREAKPOINT = 3
}
 Run modes. More...
 
enum  STATE_MODES {
  STOPPED = 0,
  RUNNING = 1,
  SINGLE_STEP_COMPLETE = 2,
  BREAKPOINT_HIT = 3,
  LPMX5_MODE = 4,
  LPMX5_WAKEUP = 5
}
 State modes. More...
 
enum  EMEX_MODE {
  EMEX_NONE = 0,
  EMEX_LOW = 1,
  EMEX_MEDIUM = 2,
  EMEX_HIGH = 3,
  EMEX_EXTRA_SMALL_5XX = 4,
  EMEX_SMALL_5XX = 5,
  EMEX_MEDIUM_5XX =6,
  EMEX_LARGE_5XX = 7,
  EMEX_CORTEX_M4 = 8,
  EMEX_CORTEX_M0 = 9
}
 One of the following enumerations is returned in device.emulation. More...
 
enum  DEVICE_CLOCK_CONTROL {
  GCC_NONE = 0,
  GCC_STANDARD = 1,
  GCC_EXTENDED = 2,
  GCC_STANDARD_I = 3
}
 One of the following enumerations is returned in device.clockControl. More...
 

Functions

DLL430_SYMBOL STATUS_T WINAPI MSP430_Registers (int32_t *registers, int32_t mask, int32_t rw)
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_ExtRegisters (int32_t address, uint8_t *buffer, int32_t count, int32_t rw)
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_Register (int32_t *reg, int32_t regNb, int32_t rw)
 Read and write only one register of the device. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_Run (int32_t mode, int32_t releaseJTAG)
 Run the device using the specified mode. JTAG control signals are optionally released. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_State (int32_t *state, int32_t stop, int32_t *pCPUCycles)
 Determine the state of the device. The device is optionally stopped. During single step operations, a count of CPU cycles executed is maintained. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_CcGetClockNames (int32_t localDeviceId, EemGclkCtrl_t **CcClockNames)
 Returns the string descriptions of the devices' EEM General Clock Control register GENCLKCNTRL. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_CcGetModuleNames (int32_t localDeviceId, EemMclkCtrl_t **CcModuleNames)
 Returns the string descriptions of the devices' EEM Module Clock Control registers MCLKCTRL0 and MCLKCTRL1. More...
 

Detailed Description

This file contains the DLL function headers and definitions to support the debugging functions of the MSP430.DLL.

The MSP430.DLL provides the following debug functionalities:

Attention
The debugging functions of the DLL are made available only to third party tool developers. Using the Enhanced Emulation Module API strictly permits the usage of the functions provided via this header file. The functions are only made available due to downward compatibility reasons.
Project:
MSP430 JTAG Interface (MSP430.dll)
Developed using:
MS Visual C++ 2003/2010
Supported API calls:

Typedef Documentation

◆ DEVICE_REGISTERS_t

Temporary work-around to #defines in stdconst.h (and others)

Device registers.

◆ RUN_MODES_t

typedef enum RUN_MODES RUN_MODES_t

Run modes.

◆ STATE_MODES_t

typedef enum STATE_MODES STATE_MODES_t

State modes.

◆ EMEX_MODE_t

typedef enum EMEX_MODE EMEX_MODE_t

One of the following enumerations is returned in device.emulation.

◆ DEVICE_CLOCK_CONTROL_t

One of the following enumerations is returned in device.clockControl.

◆ EemGclkCtrl_t

typedef struct EEM_GCLKCTRL EemGclkCtrl_t

An array of NULL terminated string pointers that point to the string descriptions for each bit of the device EEM General Clock Control register GENCLKCNTRL.

◆ EemMclkCtrl_t

typedef struct EEM_MCLKCTRL EemMclkCtrl_t

An array of NULL terminated string pointer that point to the string descriptions for each bit of the device EEM Module Clock Control registers MCLKCTRL0 and MCLKCTRL1.

Enumeration Type Documentation

◆ DEVICE_REGISTERS

Temporary work-around to #defines in stdconst.h (and others)

Device registers.

Enumerator
R0 
R1 
R2 
R3 
R4 
R5 
R6 
R7 
R8 
R9 
R10 
R11 
R12 
R13 
R14 
R15 
xPSR 
SPECIAL_REGISTERS 
MSP_SP 
PSP_SP 

◆ RUN_MODES

enum RUN_MODES

Run modes.

Enumerator
FREE_RUN 

Run the device. Set breakpoints (if any) are disabled

SINGLE_STEP 

A single device instruction is executed. Interrupt processing is supported

RUN_TO_BREAKPOINT 

Run the device. Set breakpoints (if any) are enabled

◆ STATE_MODES

State modes.

Enumerator
STOPPED 

The device is stopped

RUNNING 

The device is running or is being single stepped

SINGLE_STEP_COMPLETE 

The device is stopped after the single step operation is complete

BREAKPOINT_HIT 

The device is stopped as a result of hitting an enabled breakpoint

LPMX5_MODE 

The device is in LPMx.5 low power mode

LPMX5_WAKEUP 

The device woke up from LPMx.5 low power mode

◆ EMEX_MODE

enum EMEX_MODE

One of the following enumerations is returned in device.emulation.

Enumerator
EMEX_NONE 

Device has no Emex module.

EMEX_LOW 

Device Emex module has two breakpoints.

EMEX_MEDIUM 

Device Emex module has three breakpoints and range comparison.

EMEX_HIGH 

Device Emex module has eight breakpoints, range comparison, state storage, and trigger sequencer,.

EMEX_EXTRA_SMALL_5XX 

Device Emex module has 2 breakpoints and range comparison.

EMEX_SMALL_5XX 

Device Emex module has 4 breakpoints and range comparison.

EMEX_MEDIUM_5XX 

Device Emex module has 6 breakpoints, range comparison and trigger sequencer,.

EMEX_LARGE_5XX 

Device Emex module has 8 or 10 breakpoints, range comparison, state storage, and trigger sequencer,.

EMEX_CORTEX_M4 
EMEX_CORTEX_M0 

◆ DEVICE_CLOCK_CONTROL

One of the following enumerations is returned in device.clockControl.

Enumerator
GCC_NONE 

Device has no clock control. The system clock continue to function when the device is stopped by JTAG

GCC_STANDARD 

Device has General Clock Control register

GCC_EXTENDED 

Device has Extended General Clock Control register and Module Clock Control register 0.

GCC_STANDARD_I 

Device has General Clock Control register (Note 1793)

Function Documentation

◆ MSP430_Registers()

DLL430_SYMBOL STATUS_T WINAPI MSP430_Registers ( int32_t *  registers,
int32_t  mask,
int32_t  rw 
)

◆ MSP430_ExtRegisters()

DLL430_SYMBOL STATUS_T WINAPI MSP430_ExtRegisters ( int32_t  address,
uint8_t *  buffer,
int32_t  count,
int32_t  rw 
)

◆ MSP430_Register()

STATUS_T MSP430_Register ( int32_t *  reg,
int32_t  regNb,
int32_t  rw 
)

Read and write only one register of the device.

Note
1. It is not possible to read and write registers CG1 and CG2.
2. This function does not read and write the actual device registers. Rather, copies of the device registers are read and written. The register copies are updated (for read) after a device reset, and after MSP430_State() indicates BREAKPOINT_HIT, SINGLE_STEP_COMPLETE, or STOPPED (after stopping a running device [stop = TRUE]). The register copies are written to the device prior to MSP430_Run() with FREE_RUN, SINGLE_STEP, and RUN_TO_BREAKPOINT.
Parameters
regThe destination of the register read from the device (rw = READ),
and the source of the register written to the device (rw = WRITE).
regNbNumber of the register to be read/written (0 - 15).
rwSpecify a read (READ) or write (WRITE) operation.
Returns
STATUS_OK: The register was read or written.
STATUS_ERROR: The register was not read or written.
Error codes:
PARAMETER_ERR

◆ MSP430_Run()

STATUS_T MSP430_Run ( int32_t  mode,
int32_t  releaseJTAG 
)

Run the device using the specified mode. JTAG control signals are optionally released.

Note
1. MSP430_OpenDevice() must have been called prior to calling this function.
2. Use MSP430_State() to determine the device state after an MSP430_Run() operation.
3. Use MSP430_State() to update the device registers before using MSP430_Registers() to read the device registers.
4. DO NOT call this function twice without stopping device's CPU in between by calling MSP430_State() with parameter 'stop' set to TRUE.
Parameters
modeThe specified run mode:
  • FREE_RUN: Run the device. Set breakpoints (if any) are disabled.
  • SINGLE_STEP: A single device instruction is executed. Interrupt processing is supported.
  • RUN_TO_BREAKPOINT: Run the device. Set breakpoints (if any) are enabled.
releaseJTAGThe JTAG control signals are released when TRUE.
Returns
STATUS_OK: The run operation encountered no errors.
STATUS_ERROR: The run operation encountered errors.
Error codes:
DEVICE_UNKNOWN_ERR
NO_DEVICE_ERR
THREAD_ACTIVE_ERR
STEP_ERR
RUN_ERR
BREAKPOINT_ERR
PARAMETER_ERR

◆ MSP430_State()

STATUS_T MSP430_State ( int32_t *  state,
int32_t  stop,
int32_t *  pCPUCycles 
)

Determine the state of the device. The device is optionally stopped. During single step operations, a count of CPU cycles executed is maintained.

Note
1. MSP430_OpenDevice() must have been called prior to calling this function.
2. Limitations:
  • After MSP430_Run() was called DO NOT call MSP430_State() other than with parameter 'stop' set to TRUE.
  • Calling MSP430_State() with parameter 'stop' set to TRUE will cause the device's CPU to be stopped. DLLv3 will block until the device is stopped.
  • When the device's CPU is not running (MSP430_Run() was not called prior) MSP430_State() can be called without any restrictions.
3. To determine the device state, the JTAG control signals are required. If the JTAG control signals were released, the signals are reconnected.
4. The number of CPU cycles executed is zeroed when the device is reset (MSP430_Reset()), and when the device is run (MSP430_Run()) with FREE_RUN and RUN_TO_BREAKPOINT.
5. Use MSP430_State() to update the device registers before using MSP430_Registers() to read the device registers.
Parameters
stateThe device state:
  • STOPPED: The device is stopped.
  • RUNNING: The device is running or is being single stepped.
  • SINGLE_STEP_COMPLETE: The device is stopped after completing the single step operation.
  • BREAKPOINT_HIT: The device is stopped as a result of hitting an enabled breakpoint.
stopThe device is stopped when TRUE.
pCPUCyclesThe cumulative number of CPU cycles executed during single step (or -1 if invalid).
Returns
STATUS_OK: The device state was determined.
STATUS_ERROR: The device state was not determined.
Error codes:
PARAMETER_ERR
STATE_ERR
STEP_ERR

◆ MSP430_CcGetClockNames()

STATUS_T WINAPI MSP430_CcGetClockNames ( int32_t  localDeviceId,
EemGclkCtrl_t **  CcClockNames 
)

Returns the string descriptions of the devices' EEM General Clock Control register GENCLKCNTRL.

Note
1. The reference of a pointer of the type EemGclkCtrl_t needs to be passed to this function as parameter 2 (see application example for details).
Parameters
localDeviceIdNot currently used. Always returns clock names for current device.
CcClockNamesA pointer to a pointer of the struct type EemGclkCtrl_t defined in MSP430_Debug.h (see application example).
Application example:
#include "MSP430_Debug.h"
EemGclkCtrl_t* globalCcClockNames;
MSP430_CcGetClockNames(deviceId, &globalCcClockNames);
Returns
STATUS_OK: The function was executed successfully.

◆ MSP430_CcGetModuleNames()

STATUS_T MSP430_CcGetModuleNames ( int32_t  localDeviceId,
EemMclkCtrl_t **  CcModuleNames 
)

Returns the string descriptions of the devices' EEM Module Clock Control registers MCLKCTRL0 and MCLKCTRL1.

Note
1. The reference of a pointer of the type EemMclkCtrl_t needs to be passed to this function as parameter 2 (see application example for details).
Parameters
localDeviceIdNot currently used. Always returns module names for current device.
CcModuleNamesA pointer to a pointer of the struct type EemMclkCtrl_t defined in MSP430_Debug.h (see application example).
Application example:
#include "MSP430_Debug.h"
EemMclkCtrl_t* globalCcModuleNames;
MSP430_CcGetModuleNames(deviceId, &globalCcModuleNames);
Returns
STATUS_OK: The function was executed successfully.