Documentation ¶
Index ¶
- Constants
- func CloseUSB()
- func InitUsb() error
- func SetLogger(loggerInstance *logrus.Logger)
- type Buffer
- type Endian
- type MemoryBlockSize
- type RttDataCb
- type StLink
- func (h *StLink) Close()
- func (h *StLink) ConfigTrace(enabled bool, tpiuProtocol TpuiPinProtocolType, portSize uint32, ...) error
- func (h *StLink) ForceDebug() error
- func (h *StLink) GetIdCode() (uint32, error)
- func (h *StLink) GetRegister(register uint8) (uint32, error)
- func (h *StLink) GetRegisters() (*TargetRegisters, error)
- func (h *StLink) GetTargetVoltage() (float32, error)
- func (h *StLink) InitializeRtt(rttSearchRanges [][2]uint64) error
- func (h *StLink) PollTrace(buffer []byte, size *uint32) error
- func (h *StLink) ReadMem(addr uint32, bitLength MemoryBlockSize, count uint32, buffer *bytes.Buffer) error
- func (h *StLink) ReadRttChannels(callback RttDataCb) error
- func (h *StLink) Reset()
- func (h *StLink) SetSpeed(khz uint32, query bool) (uint32, error)
- func (h *StLink) UpdateRttChannels(readChannelNames bool) error
- func (h *StLink) UsbCurrentMode() (byte, error)
- func (h *StLink) UsbInitMode(connectUnderReset bool, initialInterfaceSpeed uint32) error
- func (h *StLink) UsbLeaveMode(mode StLinkMode) error
- func (h *StLink) UsbModeEnter(stMode StLinkMode) error
- func (h *StLink) UsbReadMem(addr uint32, len uint16, buffer *bytes.Buffer) error
- func (h *StLink) UsbReadMem16(addr uint32, len uint16, buffer *bytes.Buffer) error
- func (h *StLink) UsbReadMem32(addr uint32, len uint16, buffer *bytes.Buffer) error
- func (h *StLink) UsbReadMem8(addr uint32, len uint16, buffer *bytes.Buffer) error
- func (h *StLink) UsbWriteMem16(addr uint32, len uint16, buffer []byte) error
- func (h *StLink) UsbWriteMem32(addr uint32, len uint16, buffer []byte) error
- func (h *StLink) UsbWriteMem8(addr uint32, len uint16, buffer []byte) error
- func (h *StLink) WriteMem(address uint32, bitLength MemoryBlockSize, count uint32, buffer []byte) error
- type StLinkInterfaceConfig
- type StLinkMode
- type StmCpuInfo
- type TargetRegisters
- type TpuiPinProtocolType
- type TraceConfigType
Constants ¶
const ( StLinkModeUnknown StLinkMode = 0 StLinkModeDfu = 1 StLinkModeMass = 2 StLinkModeDebugJtag = 3 StLinkModeDebugSwd = 4 StLinkModeDebugSwim = 5 )
const ( Memory8BitBlock MemoryBlockSize = 1 Memory16BitBlock = 2 Memory32BitBlock = 4 )
const ( SeggerRttModeNoBlockSkip seggerRttMode = 0 SeggerRttModeNoBlockTrim = 1 SeggerRttModeBlockIfFifoFull = 2 )
const ( TraceConfigTypeDisabled TraceConfigType = 0 // tracing is disabled TraceConfigTypeExternal = 1 // trace output is captured externally TraceConfigTypeInternal = 2 // trace output is handled by OpenOCD adapter driver )
const ( TpuiPinProtocolSync TpuiPinProtocolType = 0 // synchronous trace output TpuiPinProtocolAsynManchester = 1 // asynchronous output with Manchester coding TpuiPinProtocolAsyncUart = 2 // asynchronous output with NRZ coding )
const AllSupportedPIds = 0xFFFF
const AllSupportedVIds = 0xFFFF
const (
DefaultRamStart = 0x20000000
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Buffer ¶
func (*Buffer) ReadUint16BE ¶
Read next 2 bytes as unsigned integer Big Endian !!! This differe from original source which buffer pointer is not advenced (ie. doest not Read from Buffer)
func (*Buffer) ReadUint16LE ¶
Read next 2 bytes as unsigned integer Little Endian !!! This differe from original source which buffer pointer is not advenced (ie. doest not Read from Buffer)
func (*Buffer) ReadUint32BE ¶
Read next 4 bytes as unsigned integer Big Endian !!! This differe from original source which buffer pointer is not advenced (ie. doest not Read from Buffer)
func (*Buffer) ReadUint32LE ¶
Read next 4 bytes as unsigned integer Little Endian !!! This differe from original source which buffer pointer is not advenced (ie. doest not Read from Buffer)
func (*Buffer) WriteUint16LE ¶
func (*Buffer) WriteUint32LE ¶
type MemoryBlockSize ¶
type MemoryBlockSize int // block size for read and write operations
type StLink ¶
type StLink struct {
// contains filtered or unexported fields
}
*
func NewStLink ¶
func NewStLink(config *StLinkInterfaceConfig) (*StLink, error)
func (*StLink) ConfigTrace ¶
func (*StLink) GetRegister ¶
Get one register content
func (*StLink) GetRegisters ¶
func (h *StLink) GetRegisters() (*TargetRegisters, error)
Get all registers content
func (*StLink) GetTargetVoltage ¶
func (*StLink) InitializeRtt ¶
func (*StLink) ReadRttChannels ¶
func (*StLink) UpdateRttChannels ¶
func (*StLink) UsbCurrentMode ¶
func (*StLink) UsbInitMode ¶
func (*StLink) UsbLeaveMode ¶
func (h *StLink) UsbLeaveMode(mode StLinkMode) error
func (*StLink) UsbReadMem ¶
Read len bytes from Target's memory, NO aligment needed for add and len
func (*StLink) UsbReadMem16 ¶
Read ((len/2) * 2) bytes from Target's memory, addr must be 16bit aligned
func (*StLink) UsbReadMem32 ¶
Read ((len/4) * 4) bytes from Target's memory, addr must be 32bit aligned
func (*StLink) UsbReadMem8 ¶
Read (len * 1) bytes from Target's memory
func (*StLink) UsbWriteMem16 ¶
func (*StLink) UsbWriteMem32 ¶
func (*StLink) UsbWriteMem8 ¶
type StLinkInterfaceConfig ¶
type StLinkInterfaceConfig struct {
// contains filtered or unexported fields
}
func NewStLinkConfig ¶
func NewStLinkConfig(vid gousb.ID, pid gousb.ID, mode StLinkMode, serial string, initialSpeed uint32, connectUnderReset bool) *StLinkInterfaceConfig
type StLinkMode ¶
type StLinkMode uint8 // stlink debug modes
type StmCpuInfo ¶
func GetCpuInformation ¶
func GetCpuInformation(cpuId string) *StmCpuInfo
type TargetRegisters ¶
type TpuiPinProtocolType ¶
type TpuiPinProtocolType int
type TraceConfigType ¶
type TraceConfigType int