picoboot

package
v0.4.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2025 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Reboot2 types
	RebootNormal      uint32 = 0x0
	RebootBootsel     uint32 = 0x2
	RebootRAMImage    uint32 = 0x3
	RebootFlashUpdate uint32 = 0x4
	RebootPCSP        uint32 = 0xd

	// Optional flags that can be ORed to the type
	RebootToARM   uint32 = 1 << 4
	RebootToRISCV uint32 = 1 << 5
)
View Source
const (
	InfoSys            uint32 = 1
	Partition          uint32 = 2
	UF2TargetPartition uint32 = 3
	UF2Status          uint32 = 4
)

GetInfo information type (args[0])

View Source
const (
	ChipInfo     uint32 = 1 << 0
	Critical     uint32 = 1 << 1
	CPUInfo      uint32 = 1 << 2
	FlashDevInfo uint32 = 1 << 3
	BootRandom   uint32 = 1 << 4
	BootInfo     uint32 = 1 << 6
)

GetInfo InfoSys flags (args[1])

View Source
const (
	PTInfo                    uint32 = 1 << 0
	PartitionLocationAndFlags uint32 = 1 << 4
	PartitionID               uint32 = 1 << 5
	PartitionFamilyIDs        uint32 = 1 << 6
	PartitionName             uint32 = 1 << 7
	SinglePartition           uint32 = 1 << 15
)

GetInfo Partition flgs (args[1])

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
	// contains filtered or unexported fields
}

func Connect

func Connect(busAddr string) (conn *Conn, err error)

Connect connects to the USB device in PICOBOOT mode. You can connect to the concrete device on the USB bus by providing BUS:DEV string where both BUS and DEV are decimal unsigned integers. If busAddr is empty connect will try to find a PICOBOOT device on the bus (it will return an error if there are more than one such devices).

func (*Conn) Close

func (c *Conn) Close() (err error)

func (*Conn) ExclusiveAccess

func (c *Conn) ExclusiveAccess(ea bool) (err error)

func (*Conn) ExitXIP

func (c *Conn) ExitXIP() (err error)

func (*Conn) FlashErase

func (c *Conn) FlashErase(addr uint32, size int) (err error)

func (*Conn) GetCommandStatus

func (c *Conn) GetCommandStatus() (token uint32, done bool, err error)

func (*Conn) GetInfo

func (c *Conn) GetInfo(info []uint32, args ...uint32) (err error)

func (*Conn) InterfaceReset

func (c *Conn) InterfaceReset() (err error)

func (*Conn) Read

func (c *Conn) Read(p []byte) (n int, err error)

Read performs n-byte PICOBOOT read transaction (if err == nil then n is always equal to len(p)) starting just after the last read address (see also SetReadAddr).

func (*Conn) ReadAddr

func (c *Conn) ReadAddr() uint32

func (*Conn) Reboot2

func (c *Conn) Reboot2(rebootType uint32, delay time.Duration, p0, p1 uint32) (err error)

func (*Conn) SetReadAddr

func (c *Conn) SetReadAddr(addr uint32)

func (*Conn) SetWriteAddr

func (c *Conn) SetWriteAddr(addr uint32)

func (*Conn) Token

func (c *Conn) Token() uint32

Token returns a token associated to the last command.

func (*Conn) Write

func (c *Conn) Write(p []byte) (n int, err error)

func (*Conn) WriteAddr

func (c *Conn) WriteAddr() uint32

type Error

type Error struct {
	Op  string
	Err error
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type StatusError

type StatusError struct {
	Cmd    string
	Status string
}

func (*StatusError) Error

func (e *StatusError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL