SpringCard SpringCore Library for .NET  20.04.16
High-level access to the SpringCore devices
SpringCard.SpringCore.Direct.DirectDevice.DFUI Class Reference

Implementation of the DFU class (https://docs.springcard.com/books/SpringCore/Host_interfaces/Logical/Direct_Protocol/DFU_class) More...

Inheritance diagram for SpringCard.SpringCore.Direct.DirectDevice.DFUI:
SpringCard.SpringCore.Direct.DirectDevice.ExchangeI

Public Types

enum  INS : byte {
  GetContext = 0x01, Reset = 0x02, GetRegister = 0x04, FlashPush = 0x07,
  FlashDump = 0x08, FlashClear = 0x09, McuPush = 0x0A
}
 INStructions exposed by this class. More...
 
enum  DfuPart : ushort {
  MCU = 0x0000, BGM = 0x0001, PN5180 = 0x0002, AUDIO = 0x0003,
  META = 0xFFFF
}
 Selection of the target part (MCU or other component) More...
 

Public Member Functions

delegate bool ProgressCallback (int percent, string message)
 Typedef of the delegate to follow the progression of the flash process. More...
 
bool MayWriteToMcu ()
 Check that a new firmware may be written directly into the MCU's internal flash. More...
 
bool MayWriteToFlash ()
 Check that a new firmware may be written directly into the storage memory (flash outside the MCU) More...
 
bool ReadContext (out byte[] context)
 Read bootloader flags. More...
 
bool ReadBackToFile (string FileName, long start_address, long end_address)
 Read-back the flash of the MCU to a file. More...
 
byte[] ReadBack (long start_address, long end_address)
 Read-back the flash of the MCU. More...
 
bool GetMetas (string FileName, out byte[] metas, out byte[] content)
 Get meta-data from a firmware file. More...
 
bool Write (byte[] content)
 Write a new firmware into the device. More...
 
bool Write (byte[] content, bool forceReset)
 Write a new firmware into the device. More...
 
bool Write (byte[] content, out bool alreadyUpToDate)
 Write a new firmware into the device. More...
 
bool Write (byte[] content, bool forceReset, out bool alreadyUpToDate)
 Write a new firmware into the device. More...
 
bool Reset ()
 Reset the device. More...
 
bool ResetInDFU ()
 Reset the device in bootloader mode. More...
 

Static Public Member Functions

static bool DumpContext (byte[] context)
 "Explain" a device DFU context More...
 
static bool DumpDfuMeta (byte[] meta)
 "Explain" a firmware file metadata More...
 
static bool DumpDfuMeta (byte[] firmware, uint offset, uint length)
 "Explain" a firmware file metadata More...
 
static bool DumpDfuMCU (byte[] firmware, uint offset, uint length)
 
static bool DumpDfuDetails (byte[] firmware)
 "Explain" a firmware file details More...
 
static bool FindDfuPart (byte[] firmware, DfuPart part, out uint crc32, out uint offset, out uint length)
 Detect whether a firmware file contains a firmware block for a given part. More...
 
static bool FindDfuPart (byte[] firmware, DfuPart part, out uint crc32, out byte[] content)
 Detect whether a firmware file contains a firmware block for a given part. More...
 
static bool ReadFile (string FileName, out byte[] metas, out byte[] content)
 Read a firmware file. More...
 
static bool ContentIsValid (byte[] content)
 Verify that a firmware file is valid. More...
 

Public Attributes

ProgressCallback OnProgress = null
 Delegate to follow the progression of the flash process. More...
 

Static Public Attributes

static bool UseLogger = false
 Forward debug information to underlying logger library? More...
 

Additional Inherited Members

- Protected Member Functions inherited from SpringCard.SpringCore.Direct.DirectDevice.ExchangeI
 ExchangeI (CLA _CLA, DirectDevice parent)
 
bool Exchange (CLA Cla, byte[] Cmd, out byte[] Rsp, ExchangeOptions options=null)
 
bool Exchange (byte Cmd, byte[] CmdData, out byte Sta, out byte[] RspData, ExchangeOptions options=null)
 
bool Exchange (byte Cmd, byte[] CmdData, out byte[] RspData, ExchangeOptions options=null)
 
bool Exchange (byte Cmd, byte[] CmdData, out byte Sta, ExchangeOptions options=null)
 
bool Exchange (byte Cmd, byte[] CmdData, ExchangeOptions options=null)
 
bool Exchange (byte Cmd, ExchangeOptions options=null)
 
bool Exchange (byte Cmd, out byte[] RspData, ExchangeOptions options=null)
 
- Properties inherited from SpringCard.SpringCore.Direct.DirectDevice.ExchangeI
DirectDevice parent [get]
 
CLA _CLA [get]
 

Detailed Description

Member Enumeration Documentation

◆ DfuPart

Selection of the target part (MCU or other component)

◆ INS

INStructions exposed by this class.

Member Function Documentation

◆ ContentIsValid()

static bool SpringCard.SpringCore.Direct.DirectDevice.DFUI.ContentIsValid ( byte[]  content)
static

Verify that a firmware file is valid.

◆ DumpContext()

static bool SpringCard.SpringCore.Direct.DirectDevice.DFUI.DumpContext ( byte[]  context)
static

"Explain" a device DFU context

◆ DumpDfuDetails()

static bool SpringCard.SpringCore.Direct.DirectDevice.DFUI.DumpDfuDetails ( byte[]  firmware)
static

"Explain" a firmware file details

◆ DumpDfuMeta() [1/2]

static bool SpringCard.SpringCore.Direct.DirectDevice.DFUI.DumpDfuMeta ( byte[]  firmware,
uint  offset,
uint  length 
)
static

"Explain" a firmware file metadata

◆ DumpDfuMeta() [2/2]

static bool SpringCard.SpringCore.Direct.DirectDevice.DFUI.DumpDfuMeta ( byte[]  meta)
static

"Explain" a firmware file metadata

◆ FindDfuPart() [1/2]

static bool SpringCard.SpringCore.Direct.DirectDevice.DFUI.FindDfuPart ( byte[]  firmware,
DfuPart  part,
out uint  crc32,
out byte[]  content 
)
static

Detect whether a firmware file contains a firmware block for a given part.

◆ FindDfuPart() [2/2]

static bool SpringCard.SpringCore.Direct.DirectDevice.DFUI.FindDfuPart ( byte[]  firmware,
DfuPart  part,
out uint  crc32,
out uint  offset,
out uint  length 
)
static

Detect whether a firmware file contains a firmware block for a given part.

◆ GetMetas()

bool SpringCard.SpringCore.Direct.DirectDevice.DFUI.GetMetas ( string  FileName,
out byte[]  metas,
out byte[]  content 
)

Get meta-data from a firmware file.

◆ MayWriteToFlash()

bool SpringCard.SpringCore.Direct.DirectDevice.DFUI.MayWriteToFlash ( )

Check that a new firmware may be written directly into the storage memory (flash outside the MCU)

◆ MayWriteToMcu()

bool SpringCard.SpringCore.Direct.DirectDevice.DFUI.MayWriteToMcu ( )

Check that a new firmware may be written directly into the MCU's internal flash.

◆ ProgressCallback()

delegate bool SpringCard.SpringCore.Direct.DirectDevice.DFUI.ProgressCallback ( int  percent,
string  message 
)

Typedef of the delegate to follow the progression of the flash process.

◆ ReadBack()

byte [] SpringCard.SpringCore.Direct.DirectDevice.DFUI.ReadBack ( long  start_address,
long  end_address 
)

Read-back the flash of the MCU.

◆ ReadBackToFile()

bool SpringCard.SpringCore.Direct.DirectDevice.DFUI.ReadBackToFile ( string  FileName,
long  start_address,
long  end_address 
)

Read-back the flash of the MCU to a file.

◆ ReadContext()

bool SpringCard.SpringCore.Direct.DirectDevice.DFUI.ReadContext ( out byte[]  context)

Read bootloader flags.

◆ ReadFile()

static bool SpringCard.SpringCore.Direct.DirectDevice.DFUI.ReadFile ( string  FileName,
out byte[]  metas,
out byte[]  content 
)
static

Read a firmware file.

◆ Reset()

bool SpringCard.SpringCore.Direct.DirectDevice.DFUI.Reset ( )

Reset the device.

◆ ResetInDFU()

bool SpringCard.SpringCore.Direct.DirectDevice.DFUI.ResetInDFU ( )

Reset the device in bootloader mode.

◆ Write() [1/4]

bool SpringCard.SpringCore.Direct.DirectDevice.DFUI.Write ( byte[]  content)

Write a new firmware into the device.

◆ Write() [2/4]

bool SpringCard.SpringCore.Direct.DirectDevice.DFUI.Write ( byte[]  content,
bool  forceReset 
)

Write a new firmware into the device.

◆ Write() [3/4]

bool SpringCard.SpringCore.Direct.DirectDevice.DFUI.Write ( byte[]  content,
bool  forceReset,
out bool  alreadyUpToDate 
)

Write a new firmware into the device.

◆ Write() [4/4]

bool SpringCard.SpringCore.Direct.DirectDevice.DFUI.Write ( byte[]  content,
out bool  alreadyUpToDate 
)

Write a new firmware into the device.

Member Data Documentation

◆ OnProgress

ProgressCallback SpringCard.SpringCore.Direct.DirectDevice.DFUI.OnProgress = null

Delegate to follow the progression of the flash process.

◆ UseLogger

bool SpringCard.SpringCore.Direct.DirectDevice.DFUI.UseLogger = false
static

Forward debug information to underlying logger library?


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