BSL430.NET  1.3.4
Public Member Functions | Static Public Member Functions | Package Functions | Properties | Events | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
BSL430_NET.BSL430NET Class Reference

BSL430.NET is cross-platform toolkit to manage memory of MSP430 MCUs via UART (FTDI, libftdi), USB or Serial (COM) port. It is a cheap replacement for stock TI MSP-FET programmer without debug capability. It can Upload, Download, Erase and Scan. More...

Inheritance diagram for BSL430_NET.BSL430NET:
BSL430_NET.IBsl430Net

Public Member Functions

 BSL430NET ()
 Use this constructor to exec ScanAll method only. Any other methods will return error. More...
 
 BSL430NET (Mode Mode)
 Use this constructor for standard, lifelong library operations, and also when you dont know device already. More...
 
 BSL430NET (Bsl430NetDevice DefaultDevice)
 Use this constructor when target device is already known and Bsl430NetDevice object is present from previous scan. More...
 
 BSL430NET (string DefaultDeviceName)
 Use this constructor when target device name is already known eg. COM1, FTDI2, libftdi3, usb4. Case doesnt matter. More...
 
ScanAllResult ScanAllEx (ScanOptions ScanOpt=ScanOptions.None)
 Detailed Scan for all available devices in multimode (FTDI, libftdi, USB and Serial). Returns ScanAllResult with 4 specific ScanResult classes, each with Status and List of Devices - Bsl430NetDevice childs. More...
 
ScanResult< Bsl430NetDeviceScanAll (ScanOptions ScanOpt=ScanOptions.None)
 Scan for all available devices in multimode (FTDI, libftdi, USB and Serial). Returns generic ScanResult class with Status and List of Devices - Bsl430NetDevice. More...
 
ScanResult< Tdev > Scan< Tdev > (ScanOptions ScanOpt=ScanOptions.None)
 Detailed Scan for available devices in single mode (FTDI / libftdi / USB / Serial). Returns generic ScanResult class with Status and List of Devices - Bsl430NetDevice. More...
 
StatusEx Erase (Bsl430NetDevice Device=null)
 Erase deletes the entire flash memory area except Information Memory if protocol 5xx6xx is used. Please see MCU datasheet for detailed information, or TI BSL doc (slau319t.pdf). More...
 
StatusEx Erase (string DeviceName)
 Erase deletes the entire flash memory area except Information Memory if protocol 5xx6xx is used. Please see MCU datasheet for detailed information, or TI BSL doc (slau319t.pdf). device_name case dont matter. More...
 
StatusEx Upload (string FirmwarePath, Bsl430NetDevice Device=null, byte[] Password=null)
 Uploads data from firmware_path to target MCU. Supported file formats are TI-TXT, Intel-HEX and ELF. If none, null or invalid password is entered, mass erase is executed first. Password is last 16-byte (F543x-non-A only) or 32-byte (others) of IVT (FFE0-FFFF), if newer 5xx/6xx MCU is used. If MCU from older series is used (1xx/2xx/4xx), password is exactly 20-byte long. Mostly it is 32-byte. More...
 
StatusEx Upload (string FirmwarePath, string DeviceName, byte[] Password=null)
 Uploads data from firmware_path to target MCU. Supported file formats are TI-TXT, Intel-HEX and ELF. If none, null or invalid password is entered, mass erase is executed first. device_name case dont matter. Password is last 16-byte (F543x-non-A only) or 32-byte (others) of IVT (FFE0-FFFF), if newer 5xx/6xx MCU is used. If MCU from older series is used (1xx/2xx/4xx), password is exactly 20-byte long. Mostly it is 32-byte. More...
 
StatusEx Download (byte[] Password, int AddrStart, int DataSize, out List< byte > Data, Bsl430NetDevice Device=null)
 Downloads bytes from target MCU starting from address AddrStart to AddrStart + DataSize. If wrong password is entered, mass erase is auto executed as a safety measure, erasing entire flash. Password is last 16-byte (F543x-non-A only) or 32-byte (others) of IVT (FFE0-FFFF), if newer 5xx/6xx MCU is used. If MCU from older series is used (1xx/2xx/4xx), password is exactly 20-byte long. Mostly it is 32-byte. More...
 
StatusEx Download (byte[] Password, int AddrStart, int DataSize, out List< byte > Data, string DeviceName)
 Downloads bytes from target MCU starting from address AddrStart to AddrStart + DataSize. If wrong password is entered, mass erase is auto executed as a safety measure, erasing entire flash. device_name case dont matter. Password is last 16-byte (F543x-non-A only) or 32-byte (others) of IVT (FFE0-FFFF), if newer 5xx/6xx MCU is used. If MCU from older series is used (1xx/2xx/4xx), password is exactly 20-byte long. Mostly it is 32-byte. More...
 
Status SetBaudRate (BaudRate BaudRate)
 Sets baud rate. Default is 9600 bps. Baud rate is applicable only in UART mode and only in some BSL revs. More...
 
Status SetInvokeMechanism (InvokeMechanism InvokeMechanism)
 Sets invoke mechanism mode. Default is DTR_RST__RTS_TEST. Note that USB HID mode requires manual BSL invocation. More...
 
Status SetMCU (MCU Mcu)
 Sets MCU family. Default is MSP430_F5xx. Please see TI BSL doc (slau319t.pdf) for supported MCUs and their modes. More...
 
BaudRate GetBaudRate ()
 Returns currently set baud rate. More...
 
InvokeMechanism GetInvokeMechanism ()
 Returns currently set invoke mechanism. More...
 
MCU GetMCU ()
 Returns currently set MCU family. More...
 
Mode GetMode ()
 Returns current BSL430.NET instance operating mode (UART_FTDXX, UART_libftdi, UART_Serial, USB_HID). More...
 
void Dispose ()
 Closes device, disposes all handles and suppresses any errors. More...
 
override string ToString ()
 Returns string of current instance mode and default device name. More...
 

Static Public Member Functions

static void Interrupt ()
 Interrupts all current processes in all intances by initiating a throw of an exception, effectively breaking anything in progress. This method is just not recommended to call, however it is the only way how perform "valid" termination, when user requires immediate hard stop, without using stuff like thread terminate. It will invalidate current action, but resources will stay safe. Delay of effect is variable, but less than 1s. More...
 

Package Functions

 BSL430NET (Core CoreInjection)
 Dependecny injection constructor useful for unit testing. More...
 
 BSL430NET (object CoreInjection)
 Dependecny injection constructor useful for unit testing. More...
 
void ProgressUpdate (double Progress, Report Report)
 

Properties

Bsl430NetDevice DefaultDevice [get, set]
 DefaultDevice is useful when call public methods without explicitly declaring target device. More...
 
static bool Interrupted [get, set]
 

Events

Bsl430NetEventHandler ProgressChanged = null
 Event fired when progress of main action changes eg. Open -> Set -> Uploading 1 batch -> next batch ... More...
 

Private Member Functions

void Bsl430NetInit (Mode Mode, Bsl430NetDevice Device=null)
 

Private Attributes

IDevice dev
 
Mode mode
 
Bsl430NetDevice defaultDevice = new Bsl430NetDevice()
 

Static Private Attributes

static bool _Interrupted = false
 

Detailed Description

BSL430.NET is cross-platform toolkit to manage memory of MSP430 MCUs via UART (FTDI, libftdi), USB or Serial (COM) port. It is a cheap replacement for stock TI MSP-FET programmer without debug capability. It can Upload, Download, Erase and Scan.

Constructor & Destructor Documentation

◆ BSL430NET() [1/6]

BSL430_NET.BSL430NET.BSL430NET ( )

Use this constructor to exec ScanAll method only. Any other methods will return error.

◆ BSL430NET() [2/6]

BSL430_NET.BSL430NET.BSL430NET ( Mode  Mode)

Use this constructor for standard, lifelong library operations, and also when you dont know device already.

◆ BSL430NET() [3/6]

BSL430_NET.BSL430NET.BSL430NET ( Bsl430NetDevice  DefaultDevice)

Use this constructor when target device is already known and Bsl430NetDevice object is present from previous scan.

◆ BSL430NET() [4/6]

BSL430_NET.BSL430NET.BSL430NET ( string  DefaultDeviceName)

Use this constructor when target device name is already known eg. COM1, FTDI2, libftdi3, usb4. Case doesnt matter.

◆ BSL430NET() [5/6]

BSL430_NET.BSL430NET.BSL430NET ( Core  CoreInjection)
package

Dependecny injection constructor useful for unit testing.

◆ BSL430NET() [6/6]

BSL430_NET.BSL430NET.BSL430NET ( object  CoreInjection)
package

Dependecny injection constructor useful for unit testing.

Member Function Documentation

◆ Dispose()

void BSL430_NET.BSL430NET.Dispose ( )

Closes device, disposes all handles and suppresses any errors.

◆ Download() [1/2]

StatusEx BSL430_NET.BSL430NET.Download ( byte[]  Password,
int  AddrStart,
int  DataSize,
out List< byte >  Data,
Bsl430NetDevice  Device = null 
)

Downloads bytes from target MCU starting from address AddrStart to AddrStart + DataSize. If wrong password is entered, mass erase is auto executed as a safety measure, erasing entire flash. Password is last 16-byte (F543x-non-A only) or 32-byte (others) of IVT (FFE0-FFFF), if newer 5xx/6xx MCU is used. If MCU from older series is used (1xx/2xx/4xx), password is exactly 20-byte long. Mostly it is 32-byte.

Implements BSL430_NET.IBsl430Net.

◆ Download() [2/2]

StatusEx BSL430_NET.BSL430NET.Download ( byte[]  Password,
int  AddrStart,
int  DataSize,
out List< byte >  Data,
string  DeviceName 
)

Downloads bytes from target MCU starting from address AddrStart to AddrStart + DataSize. If wrong password is entered, mass erase is auto executed as a safety measure, erasing entire flash. device_name case dont matter. Password is last 16-byte (F543x-non-A only) or 32-byte (others) of IVT (FFE0-FFFF), if newer 5xx/6xx MCU is used. If MCU from older series is used (1xx/2xx/4xx), password is exactly 20-byte long. Mostly it is 32-byte.

Implements BSL430_NET.IBsl430Net.

◆ Erase() [1/2]

StatusEx BSL430_NET.BSL430NET.Erase ( Bsl430NetDevice  Device = null)

Erase deletes the entire flash memory area except Information Memory if protocol 5xx6xx is used. Please see MCU datasheet for detailed information, or TI BSL doc (slau319t.pdf).

Implements BSL430_NET.IBsl430Net.

◆ Erase() [2/2]

StatusEx BSL430_NET.BSL430NET.Erase ( string  DeviceName)

Erase deletes the entire flash memory area except Information Memory if protocol 5xx6xx is used. Please see MCU datasheet for detailed information, or TI BSL doc (slau319t.pdf). device_name case dont matter.

Implements BSL430_NET.IBsl430Net.

◆ GetBaudRate()

BaudRate BSL430_NET.BSL430NET.GetBaudRate ( )

Returns currently set baud rate.

Implements BSL430_NET.IBsl430Net.

◆ GetInvokeMechanism()

InvokeMechanism BSL430_NET.BSL430NET.GetInvokeMechanism ( )

Returns currently set invoke mechanism.

Implements BSL430_NET.IBsl430Net.

◆ GetMCU()

MCU BSL430_NET.BSL430NET.GetMCU ( )

Returns currently set MCU family.

Implements BSL430_NET.IBsl430Net.

◆ GetMode()

Mode BSL430_NET.BSL430NET.GetMode ( )

Returns current BSL430.NET instance operating mode (UART_FTDXX, UART_libftdi, UART_Serial, USB_HID).

Implements BSL430_NET.IBsl430Net.

◆ Interrupt()

static void BSL430_NET.BSL430NET.Interrupt ( )
static

Interrupts all current processes in all intances by initiating a throw of an exception, effectively breaking anything in progress. This method is just not recommended to call, however it is the only way how perform "valid" termination, when user requires immediate hard stop, without using stuff like thread terminate. It will invalidate current action, but resources will stay safe. Delay of effect is variable, but less than 1s.

◆ Scan< Tdev >()

ScanResult<Tdev> BSL430_NET.BSL430NET.Scan< Tdev > ( ScanOptions  ScanOpt = ScanOptions.None)

Detailed Scan for available devices in single mode (FTDI / libftdi / USB / Serial). Returns generic ScanResult class with Status and List of Devices - Bsl430NetDevice.

Exceptions
Bsl430NetException

Implements BSL430_NET.IBsl430Net.

Type Constraints
Tdev :Bsl430NetDevice 

◆ ScanAll()

ScanResult<Bsl430NetDevice> BSL430_NET.BSL430NET.ScanAll ( ScanOptions  ScanOpt = ScanOptions.None)

Scan for all available devices in multimode (FTDI, libftdi, USB and Serial). Returns generic ScanResult class with Status and List of Devices - Bsl430NetDevice.

Exceptions
Bsl430NetException

Implements BSL430_NET.IBsl430Net.

◆ ScanAllEx()

ScanAllResult BSL430_NET.BSL430NET.ScanAllEx ( ScanOptions  ScanOpt = ScanOptions.None)

Detailed Scan for all available devices in multimode (FTDI, libftdi, USB and Serial). Returns ScanAllResult with 4 specific ScanResult classes, each with Status and List of Devices - Bsl430NetDevice childs.

Exceptions
Bsl430NetException

Implements BSL430_NET.IBsl430Net.

◆ SetBaudRate()

Status BSL430_NET.BSL430NET.SetBaudRate ( BaudRate  BaudRate)

Sets baud rate. Default is 9600 bps. Baud rate is applicable only in UART mode and only in some BSL revs.

Implements BSL430_NET.IBsl430Net.

◆ SetInvokeMechanism()

Status BSL430_NET.BSL430NET.SetInvokeMechanism ( InvokeMechanism  InvokeMechanism)

Sets invoke mechanism mode. Default is DTR_RST__RTS_TEST. Note that USB HID mode requires manual BSL invocation.

Implements BSL430_NET.IBsl430Net.

◆ SetMCU()

Status BSL430_NET.BSL430NET.SetMCU ( MCU  Mcu)

Sets MCU family. Default is MSP430_F5xx. Please see TI BSL doc (slau319t.pdf) for supported MCUs and their modes.

Implements BSL430_NET.IBsl430Net.

◆ ToString()

override string BSL430_NET.BSL430NET.ToString ( )

Returns string of current instance mode and default device name.

◆ Upload() [1/2]

StatusEx BSL430_NET.BSL430NET.Upload ( string  FirmwarePath,
Bsl430NetDevice  Device = null,
byte[]  Password = null 
)

Uploads data from firmware_path to target MCU. Supported file formats are TI-TXT, Intel-HEX and ELF. If none, null or invalid password is entered, mass erase is executed first. Password is last 16-byte (F543x-non-A only) or 32-byte (others) of IVT (FFE0-FFFF), if newer 5xx/6xx MCU is used. If MCU from older series is used (1xx/2xx/4xx), password is exactly 20-byte long. Mostly it is 32-byte.

Implements BSL430_NET.IBsl430Net.

◆ Upload() [2/2]

StatusEx BSL430_NET.BSL430NET.Upload ( string  FirmwarePath,
string  DeviceName,
byte[]  Password = null 
)

Uploads data from firmware_path to target MCU. Supported file formats are TI-TXT, Intel-HEX and ELF. If none, null or invalid password is entered, mass erase is executed first. device_name case dont matter. Password is last 16-byte (F543x-non-A only) or 32-byte (others) of IVT (FFE0-FFFF), if newer 5xx/6xx MCU is used. If MCU from older series is used (1xx/2xx/4xx), password is exactly 20-byte long. Mostly it is 32-byte.

Implements BSL430_NET.IBsl430Net.

Property Documentation

◆ DefaultDevice

Bsl430NetDevice BSL430_NET.BSL430NET.DefaultDevice
getset

DefaultDevice is useful when call public methods without explicitly declaring target device.

Event Documentation

◆ ProgressChanged

Bsl430NetEventHandler BSL430_NET.BSL430NET.ProgressChanged = null

Event fired when progress of main action changes eg. Open -> Set -> Uploading 1 batch -> next batch ...


The documentation for this class was generated from the following file: