159 #include <DLL430_SYMBOL.h>
162 #if defined(_WIN32) || defined(_WIN64)
166 #if defined(__cplusplus)
309 #define DEVICE_UNKNOWN 0
438 #define ERROR_DEFINITIONS \
439 ERROR_DEF(NO_ERR, "No error") \
440 ERROR_DEF(INITIALIZE_ERR, "Could not initialize device interface") \
441 ERROR_DEF(CLOSE_ERR, "Could not close device interface") \
442 ERROR_DEF(PARAMETER_ERR, "Invalid parameter(s)") \
443 ERROR_DEF(NO_DEVICE_ERR, "Could not find device (or device not supported)") \
444 ERROR_DEF(DEVICE_UNKNOWN_ERR, "Unknown device") \
445 ERROR_DEF(READ_MEMORY_ERR, "Could not read device memory") \
446 ERROR_DEF(WRITE_MEMORY_ERR, "Could not write device memory") \
447 ERROR_DEF(READ_FUSES_ERR, "Could not read device configuration fuses") \
448 ERROR_DEF(CONFIGURATION_ERR, "Incorrectly configured device; device derivative not supported") \
449 ERROR_DEF(VCC_ERR, "Could not set device Vcc") \
450 ERROR_DEF(RESET_ERR, "Could not reset device") \
451 ERROR_DEF(PRESERVE_RESTORE_ERR, "Could not preserve/restore device memory") \
452 ERROR_DEF(FREQUENCY_ERR, "Could not set device operating frequency") \
453 ERROR_DEF(ERASE_ERR, "Could not erase device memory") \
454 ERROR_DEF(BREAKPOINT_ERR, "Could not set device breakpoint") \
455 ERROR_DEF(STEP_ERR, "Could not single step device") \
456 ERROR_DEF(RUN_ERR, "Could not run device (to breakpoint)") \
457 ERROR_DEF(STATE_ERR, "Could not determine device state") \
458 ERROR_DEF(EEM_OPEN_ERR, "Could not open Enhanced Emulation Module") \
459 ERROR_DEF(EEM_READ_ERR, "Could not read Enhanced Emulation Module register") \
460 ERROR_DEF(EEM_WRITE_ERR, "Could not write Enhanced Emulation Module register") \
461 ERROR_DEF(EEM_CLOSE_ERR, "Could not close Enhanced Emulation Module") \
462 ERROR_DEF(FILE_OPEN_ERR, "File open error") \
463 ERROR_DEF(FILE_DETECT_ERR, "File type could not be identified") \
464 ERROR_DEF(FILE_END_ERR, "File end error") \
465 ERROR_DEF(FILE_IO_ERR, "File input/output error") \
466 ERROR_DEF(FILE_DATA_ERR, "File data error") \
467 ERROR_DEF(VERIFY_ERR, "Verification error") \
468 ERROR_DEF(BLOW_FUSE_ERR, "Could not secure the device") \
469 ERROR_DEF(FUSE_BLOWN_ERR, "The Debug Interface to the device has been secured") \
470 ERROR_DEF(INTEL_HEX_CODE_ERR, "Error within Intel Hex file") \
471 ERROR_DEF(WRITE_REGISTER_ERR, "Could not write device Register") \
472 ERROR_DEF(READ_REGISTER_ERR, "Could not read device Register") \
473 ERROR_DEF(INTERFACE_SUPPORT_ERR, "Not supported by selected Interface or Interface is not initialized") \
474 ERROR_DEF(COMM_ERR, "Interface Communication error") \
475 ERROR_DEF(NO_EX_POWER, "No external power supply detected") \
476 ERROR_DEF(LOW_EX_POWER, "External power too low") \
477 ERROR_DEF(EX_POWER_OK, "External power detected") \
478 ERROR_DEF(HIGH_EX_POWER, "External power too high") \
479 ERROR_DEF(SELFTEST_ERR, "Hardware Self Test Error") \
480 ERROR_DEF(FLASH_TIMEOUT_ERR, "Fast Flash Routine experienced a timeout") \
481 ERROR_DEF(THREAD_ERR, "Could not create thread for polling") \
482 ERROR_DEF(EEM_INIT_ERR, "Could not initialize Enhanced Emulation Module") \
483 ERROR_DEF(RESOURCE_ERR, "Insufficient resources") \
484 ERROR_DEF(CLK_CTRL_ERR, "No clock control emulation on connected device") \
485 ERROR_DEF(STATE_STOR_ERR, "No state storage buffer implemented on connected device") \
486 ERROR_DEF(READ_TRACE_ERR, "Could not read trace buffer") \
487 ERROR_DEF(VAR_WATCH_EN_ERR, "Enable the variable watch function") \
488 ERROR_DEF(SEQUENCER_ERR, "No trigger sequencer implemented on connected device") \
489 ERROR_DEF(SEQ_ENABLE_ERR, "Could not read sequencer state - Sequencer is disabled") \
490 ERROR_DEF(CLR_SEQ_TRIGGER, "Could not remove trigger - Used in sequencer") \
491 ERROR_DEF(SET_SEQ_TRIGGER, "Could not set combination - Trigger is used in sequencer") \
492 ERROR_DEF(SPMA_ACTIVE_ERR, "System Protection Module A is enabled - Device locked") \
493 ERROR_DEF(SPMA_INVALID_KEY_ERR, "Invalid SPMA key was passed to the target device - Device locked") \
494 ERROR_DEF(SPMA_MAX_TRIALS, "Device does not accept any further SPMA keys - Device locked") \
495 ERROR_DEF(USB_FET_BSL_ACTIVE_ERR, "MSP-FET430UIF Firmware erased - Bootloader active") \
496 ERROR_DEF(USB_FET_NOT_FOUND_ERR, "Could not find MSP-FET430UIF on specified COM port") \
497 ERROR_DEF(USB_FET_BUSY_ERR, "MSP-FET430UIF is already in use") \
498 ERROR_DEF(THREAD_ACTIVE_ERR, "EEM polling thread is already active") \
499 ERROR_DEF(THREAD_TERMINATE_ERR, "Could not terminate EEM polling thread") \
500 ERROR_DEF(UNLOCK_BSL_ERR, "Could not unlock BSL memory segments") \
501 ERROR_DEF(BSL_MEMORY_LOCKED_ERR, "Could not perform access, BSL memory segments are protected") \
502 ERROR_DEF(FOUND_OTHER_DEVICE, "Another device as selected was found") \
503 ERROR_DEF(WRONG_PASSWORD, "Could not enable JTAG wrong password") \
504 ERROR_DEF(UPDATE_MULTIPLE_UIF_ERR, "Only one UIF must be connected during update to v3") \
505 ERROR_DEF(CDC_UIF_ERR, "CDC-USB-FET-Driver was not installed. Please install the driver") \
506 ERROR_DEF(UIF_MANUAL_POWERCYCLE_NEEDED, "Manual reboot of USB-FET needed ! PLEASE unplug and reconnect your USB-FET!!") \
507 ERROR_DEF(INTERNAL_ERR, "Internal error") \
508 ERROR_DEF(FETRECOVERY_NEEDED, "One of the connected MSP-FETs / eZ-FETs debuggers needs recovery") \
509 ERROR_DEF(WRITE_EXTERNAL_MEM_ERR, "One of the connected MSP-FETs / eZ-FETs debuggers needs recovery") \
510 ERROR_DEF(FEATURE_NOT_SUPPORTED, "Feature not supported") \
511 ERROR_DEF(RECOVERY_MULTIPLE_UIF, "Only one MSP-FET / eZ-FET must be connected during recovery") \
512 ERROR_DEF(RECOVERY_FAILED, "MSP-FET / eZ-FET recovery failed") \
513 ERROR_DEF(UPDATE_CORE_ERR, "MSP-FET / eZ-FET core(communication layer) update failed") \
514 ERROR_DEF(UPDATE_MODULE_ERR, "MSP-FET / eZ-FET legacy module update failed") \
515 ERROR_DEF(ET_NOT_SUPPORTED, "EnergyTrace is not supported by the selected debugger") \
516 ERROR_DEF(HARDWARE_STATE_UNKNOWN, "Hardware State is unknown") \
517 ERROR_DEF(DEVICE_CRC_WRONG, "Device configuration data inconsistent. Please discontinue using/replace target device.") \
518 ERROR_DEF(EEM_NOT_ACCESSIBLE, "EEM module not accessible while running in Ultra Low Power Debug Mode - Deactivate Ultra Low Power Debug mode to enable this feature") \
519 ERROR_DEF(REMOVE_SOFTWARE_BREAKPOINT_ERR, "Failed to remove software breakpoints, please reprogram target device") \
520 ERROR_DEF(TRIGGER_CONFLICT_ERR, "Trigger configuration conflicts with existing triggers") \
521 ERROR_DEF(TARGET_RUNNING_ERR, "Operation not possible while device is running") \
522 ERROR_DEF(INCOMPATIBLE_WITH_SW_BREAKPOINT_API, "This function can not be used when software breakpoints are enabled") \
523 ERROR_DEF(SPEED_CONFIG_ERR, "JTAG/SBW speed configuration failed") \
524 ERROR_DEF(SWBP_CRITICAL_INSTRUCTION, "Software breakpoint can't be set (followed by critical value)") \
525 ERROR_DEF(ET_NOT_SUPPORTED_DEVICE, "EnergyTrace is not supported by selected MSP430 device") \
526 ERROR_DEF(ET_NOT_SUPPORTED_ULP_DEBUG, "EnergyTrace requires Ultra-Low Power debug / LPMx.5 enabled") \
527 ERROR_DEF(LEGACY_DEVICE_ERR, "Legacy version of silicon used, which is no longer supported. Please contact TI to obtain a newer version.") \
528 ERROR_DEF(SECURE_NOT_SUPPORTED_ERR, "Secure device via the IDE is not supported. See Device User Guide for further information.") \
529 ERROR_DEF(CYCLE_COUNTER_CONFLICT, "Cycle counter is in basic mode. Set to advanced mode to use this function.") \
530 ERROR_DEF(NO_LPT_SUPPORT, "Parallel port FET (MSP-FETP430IF) is no longer supported.") \
531 ERROR_DEF(WRONG_TARGET_ARCHITECTURE, "Wrong target architecture was selected – Valid architectures are MSP430 or MSP432_M4.") \
532 ERROR_DEF(MSP432_TOTAL_ERASE, "Mass erase executed. Please power-cycle your device and restart the debug session.") \
533 ERROR_DEF(POSSIBLE_OVERCURRENT, "Your connected hardware might drain too much power from the debugger.This results in an overcurrent.") \
534 ERROR_DEF(FET_UPDATE_FAILED, "MSP Tool firmware update failed. Please ensure the USB or Backchannel UART connection is not in use.") \
535 ERROR_DEF(INTERFACE_SUPPORT_ERR_MSP432, "MSP432 devices are not supported using the MSPFET430-UIF") \
536 ERROR_DEF(DAP_LOCK_WRONG_PROTOCOL, "DAP is locked or wrong debug protocol selected.") \
537 ERROR_DEF(DEVICE_DB_ERR, "Device database not loaded.") \
538 ERROR_DEF(INVALID_ERR, "Invalid error number")
541 #define ERROR_DEF(errorEnum, errorString) errorEnum,
676 DLL430_SYMBOL STATUS_T WINAPI
MSP430_Initialize(
const char* port, int32_t* version);
694 DLL430_SYMBOL STATUS_T WINAPI
MSP430_Close(int32_t vccOff);
758 DLL430_SYMBOL STATUS_T WINAPI
MSP430_OpenDevice(
const char* Device,
const char* Password, int32_t PwLength,int32_t DeviceCode, int32_t setId);
779 DLL430_SYMBOL STATUS_T WINAPI
MSP430_Device(int32_t localDeviceId, uint8_t* buffer, int32_t count);
826 DLL430_SYMBOL STATUS_T WINAPI
MSP430_Configure(int32_t mode, int32_t value);
851 DLL430_SYMBOL STATUS_T WINAPI
MSP430_VCC(int32_t voltage);
930 DLL430_SYMBOL STATUS_T WINAPI
MSP430_Reset(int32_t method, int32_t execute, int32_t releaseJTAG);
971 DLL430_SYMBOL STATUS_T WINAPI
MSP430_Erase(int32_t type, int32_t address, int32_t length);
1002 DLL430_SYMBOL STATUS_T WINAPI
MSP430_Memory(int32_t address, uint8_t* buffer, int32_t count, int32_t rw);
1004 #define MSP430_Read_Memory(ADDRESS, BUFFER, COUNT) MSP430_Memory(ADDRESS, BUFFER, COUNT, READ)
1005 #define MSP430_Write_Memory(ADDRESS, BUFFER, COUNT) MSP430_Memory(ADDRESS, BUFFER, COUNT, WRITE)
1050 #if ! defined(uController)
1051 DLL430_SYMBOL STATUS_T WINAPI
MSP430_ReadOutFile(int32_t wStart, int32_t wLength,
const char* lpszFileName, int32_t iFileType);
1095 #if ! defined(uController)
1096 DLL430_SYMBOL STATUS_T WINAPI
MSP430_ProgramFile(
const char* File, int32_t eraseType, int32_t verifyMem);
1126 #if ! defined(uController)
1152 DLL430_SYMBOL STATUS_T WINAPI
MSP430_VerifyMem(int32_t StartAddr, int32_t Length,
const uint8_t* DataArray);
1175 DLL430_SYMBOL STATUS_T WINAPI
MSP430_EraseCheck(int32_t StartAddr, int32_t Length);
1199 #if ! defined(uController)
1217 #if ! defined(uController)
1247 #if ! defined(uController)
1262 #if defined(__cplusplus)