flash

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FlashDevice

func FlashDevice(device Device, envMap map[string]string, port string, verbose bool) error

FlashDevice flashes firmware to a device based on the device configuration

func GetPort

func GetPort(portFlag string, usbInterfaces []string) (string, error)

From tinygo/main.go getDefaultPort GetPort returns the default serial port depending on the operating system and USB interfaces.

Types

type Device

type Device struct {
	Serial     string   // Serial communication settings
	SerialPort []string // Available serial ports
	Flash      Flash    // Flash configuration for device programming
	MSD        MSD      // Mass Storage Device configuration
	OpenOCD    OpenOCD  // OpenOCD configuration for debugging/flashing
}

Device contains all flashing/debugging configuration for a device

type Flash

type Flash struct {
	Method            string // Flash method: "command", "openocd", "msd", "bmp"
	Command           string // Flash command template
	Flash1200BpsReset bool   // Whether to use 1200bps reset
}

Flash contains configuration for device flashing

type MSD

type MSD struct {
	VolumeName   []string // Names of the volumes
	FirmwareName string   // Firmware file name pattern
}

MSD contains configuration for Mass Storage Device flashing

type OpenOCD

type OpenOCD struct {
	Interface string // Interface configuration (e.g., "stlink")
	Transport string // Transport protocol (e.g., "swd", "jtag")
	Target    string // Target configuration (e.g., "stm32f4x")
}

OpenOCD contains configuration for OpenOCD debugging/flashing

Jump to

Keyboard shortcuts

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