Main Page | Data Structures | File List | Data Fields | Globals

MSP430_Debug.h File Reference


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:

Go to the source code of this file.

Data Structures

struct  EEM_GCLKCTRL
struct  EEM_MCLKCTRL

Typedefs

typedef enum DEVICE_REGISTERS DEVICE_REGISTERS_t
 Device registers.

typedef enum RUN_MODES RUN_MODES_t
 Run modes.

typedef enum STATE_MODES STATE_MODES_t
 State modes.

typedef enum EMEX_MODE EMEX_MODE_t
 One of the following enumerations is returned in device.emulation.

typedef enum DEVICE_CLOCK_CONTROL DEVICE_CLOCK_CONTROL_t
 One of the following enumerations is returned in device.clockControl.

typedef EEM_GCLKCTRL EemGclkCtrl_t
typedef 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
}
 Device registers. 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
}
 One of the following enumerations is returned in device.emulation. More...

enum  DEVICE_CLOCK_CONTROL {
  GCC_NONE = 0,
  GCC_STANDARD = 1,
  GCC_EXTENDED = 2
}
 One of the following enumerations is returned in device.clockControl. More...


Functions

DLL430_SYMBOL STATUS_T WINAPI MSP430_Registers (LONG *registers, LONG mask, LONG rw)
DLL430_SYMBOL STATUS_T WINAPI MSP430_ExtRegisters (LONG address, CHAR *buffer, LONG count, LONG rw)
DLL430_SYMBOL STATUS_T WINAPI MSP430_Register (LONG *reg, LONG regNb, LONG rw)
 Read and write only one register of the device.

DLL430_SYMBOL STATUS_T WINAPI MSP430_Run (LONG mode, LONG releaseJTAG)
 Run the device using the specified mode. JTAG control signals are optionally released.

DLL430_SYMBOL STATUS_T WINAPI MSP430_State (LONG *state, LONG stop, LONG *pCPUCycles)
 Determine the state of the device. The device is optionally stopped. During single step operations, a count of CPU cycles executed is maintained.

STATUS_T WINAPI MSP430_CcGetClockNames (LONG localDeviceId, EemGclkCtrl_t **CcClockNames)
 Returns the string descriptions of the devices' EEM General Clock Control register GENCLKCNTRL.

DLL430_SYMBOL STATUS_T WINAPI MSP430_CcGetModuleNames (LONG localDeviceId, EemMclkCtrl_t **CcModuleNames)
 Returns the string descriptions of the devices' EEM Module Clock Control registers MCLKCTRL0 and MCLKCTRL1.


Typedef Documentation

typedef enum DEVICE_REGISTERS DEVICE_REGISTERS_t
 

Device registers.

typedef enum RUN_MODES RUN_MODES_t
 

Run modes.

typedef enum STATE_MODES STATE_MODES_t
 

State modes.

typedef enum EMEX_MODE EMEX_MODE_t
 

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

typedef enum DEVICE_CLOCK_CONTROL DEVICE_CLOCK_CONTROL_t
 

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

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.

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

enum DEVICE_REGISTERS
 

Device registers.

Enumeration values:
R0 
R1 
R2 
R3 
R4 
R5 
R6 
R7 
R8 
R9 
R10 
R11 
R12 
R13 
R14 
R15 

enum RUN_MODES
 

Run modes.

Enumeration values:
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

enum STATE_MODES
 

State modes.

Enumeration values:
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

enum EMEX_MODE
 

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

Enumeration values:
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,.

enum DEVICE_CLOCK_CONTROL
 

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

Enumeration values:
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.


Function Documentation

DLL430_SYMBOL STATUS_T WINAPI MSP430_Registers LONG *  registers,
LONG  mask,
LONG  rw
 

DLL430_SYMBOL STATUS_T WINAPI MSP430_ExtRegisters LONG  address,
CHAR *  buffer,
LONG  count,
LONG  rw
 

STATUS_T MSP430_Register LONG *  reg,
LONG  regNb,
LONG  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:
reg: The destination of the register read from the device (rw = READ),
and the source of the register written to the device (rw = WRITE).
regNb: Number of the register to be read/written (0 - 15).
rw: Specify 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

STATUS_T MSP430_Run LONG  mode,
LONG  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:
mode: The 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.
releaseJTAG: The 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

STATUS_T MSP430_State LONG *  state,
LONG  stop,
LONG *  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:
state: The 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.
stop: The device is stopped when TRUE.
pCPUCycles: The 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

STATUS_T WINAPI MSP430_CcGetClockNames LONG  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:
localDeviceId: Not currently used. Always returns clock names for current device.
CcClockNames: A 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.

STATUS_T MSP430_CcGetModuleNames LONG  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:
localDeviceId: Not currently used. Always returns module names for current device.
CcModuleNames: A 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.