targets: refactor flash/gdb target configuration
Instead of specifying explicit commands, most of these commands have been replaced by more specific properties. This is work that will be necessary for an eventual -programmer flag to the compiler, with which it is possible to select which programmer to use to flash or debug a chip. That's not very useful for boards that already include a programmer or bootloader for that purpose, but is very useful for novel boards or single-purpose boards that are not already included in TinyGo.
Этот коммит содержится в:
родитель
52bac4d75b
коммит
2a71aa90bc
23 изменённых файлов: 208 добавлений и 112 удалений
103
main.go
103
main.go
|
@ -403,24 +403,34 @@ func Flash(pkgName, target, port string, config *BuildConfig) error {
|
||||||
// determine the type of file to compile
|
// determine the type of file to compile
|
||||||
var fileExt string
|
var fileExt string
|
||||||
|
|
||||||
|
switch spec.FlashMethod {
|
||||||
|
case "command", "":
|
||||||
switch {
|
switch {
|
||||||
case strings.Contains(spec.Flasher, "{hex}"):
|
case strings.Contains(spec.FlashCommand, "{hex}"):
|
||||||
fileExt = ".hex"
|
fileExt = ".hex"
|
||||||
case strings.Contains(spec.Flasher, "{elf}"):
|
case strings.Contains(spec.FlashCommand, "{elf}"):
|
||||||
fileExt = ".elf"
|
fileExt = ".elf"
|
||||||
case strings.Contains(spec.Flasher, "{bin}"):
|
case strings.Contains(spec.FlashCommand, "{bin}"):
|
||||||
fileExt = ".bin"
|
fileExt = ".bin"
|
||||||
case strings.Contains(spec.Flasher, "{uf2}"):
|
case strings.Contains(spec.FlashCommand, "{uf2}"):
|
||||||
fileExt = ".uf2"
|
fileExt = ".uf2"
|
||||||
default:
|
default:
|
||||||
return errors.New("invalid target file - did you forget the {hex} token in the 'flash' section?")
|
return errors.New("invalid target file - did you forget the {hex} token in the 'flash-command' section?")
|
||||||
|
}
|
||||||
|
case "msd":
|
||||||
|
if spec.FlashFilename == "" {
|
||||||
|
return errors.New("invalid target file: flash-method was set to \"msd\" but no msd-firmware-name was set")
|
||||||
|
}
|
||||||
|
fileExt = filepath.Ext(spec.FlashFilename)
|
||||||
|
case "openocd":
|
||||||
|
fileExt = ".hex"
|
||||||
|
case "native":
|
||||||
|
return errors.New("unknown flash method \"native\" - did you miss a -target flag?")
|
||||||
|
default:
|
||||||
|
return errors.New("unknown flash method: " + spec.FlashMethod)
|
||||||
}
|
}
|
||||||
|
|
||||||
return Compile(pkgName, fileExt, spec, config, func(tmppath string) error {
|
return Compile(pkgName, fileExt, spec, config, func(tmppath string) error {
|
||||||
if spec.Flasher == "" {
|
|
||||||
return errors.New("no flash command specified - did you miss a -target flag?")
|
|
||||||
}
|
|
||||||
|
|
||||||
// do we need port reset to put MCU into bootloader mode?
|
// do we need port reset to put MCU into bootloader mode?
|
||||||
if spec.PortReset == "true" {
|
if spec.PortReset == "true" {
|
||||||
err := touchSerialPortAt1200bps(port)
|
err := touchSerialPortAt1200bps(port)
|
||||||
|
@ -432,7 +442,25 @@ func Flash(pkgName, target, port string, config *BuildConfig) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// this flashing method copies the binary data to a Mass Storage Device (msd)
|
// this flashing method copies the binary data to a Mass Storage Device (msd)
|
||||||
if spec.FlashMethod == "msd" {
|
switch spec.FlashMethod {
|
||||||
|
case "", "command":
|
||||||
|
// Create the command.
|
||||||
|
flashCmd := spec.FlashCommand
|
||||||
|
fileToken := "{" + fileExt[1:] + "}"
|
||||||
|
flashCmd = strings.Replace(flashCmd, fileToken, tmppath, -1)
|
||||||
|
flashCmd = strings.Replace(flashCmd, "{port}", port, -1)
|
||||||
|
|
||||||
|
// Execute the command.
|
||||||
|
cmd := exec.Command("/bin/sh", "-c", flashCmd)
|
||||||
|
cmd.Stdout = os.Stdout
|
||||||
|
cmd.Stderr = os.Stderr
|
||||||
|
cmd.Dir = sourceDir()
|
||||||
|
err := cmd.Run()
|
||||||
|
if err != nil {
|
||||||
|
return &commandError{"failed to flash", tmppath, err}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
case "msd":
|
||||||
switch fileExt {
|
switch fileExt {
|
||||||
case ".uf2":
|
case ".uf2":
|
||||||
err := flashUF2UsingMSD(spec.FlashVolume, tmppath)
|
err := flashUF2UsingMSD(spec.FlashVolume, tmppath)
|
||||||
|
@ -449,24 +477,23 @@ func Flash(pkgName, target, port string, config *BuildConfig) error {
|
||||||
default:
|
default:
|
||||||
return errors.New("mass storage device flashing currently only supports uf2 and hex")
|
return errors.New("mass storage device flashing currently only supports uf2 and hex")
|
||||||
}
|
}
|
||||||
|
case "openocd":
|
||||||
|
args, err := spec.OpenOCDConfiguration()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
args = append(args, "-c", "program "+tmppath+" reset exit")
|
||||||
// Create the command.
|
cmd := exec.Command("openocd", args...)
|
||||||
flashCmd := spec.Flasher
|
|
||||||
fileToken := "{" + fileExt[1:] + "}"
|
|
||||||
flashCmd = strings.Replace(flashCmd, fileToken, tmppath, -1)
|
|
||||||
flashCmd = strings.Replace(flashCmd, "{port}", port, -1)
|
|
||||||
|
|
||||||
// Execute the command.
|
|
||||||
cmd := exec.Command("/bin/sh", "-c", flashCmd)
|
|
||||||
cmd.Stdout = os.Stdout
|
cmd.Stdout = os.Stdout
|
||||||
cmd.Stderr = os.Stderr
|
cmd.Stderr = os.Stderr
|
||||||
cmd.Dir = sourceDir()
|
err = cmd.Run()
|
||||||
err := cmd.Run()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &commandError{"failed to flash", tmppath, err}
|
return &commandError{"failed to flash", tmppath, err}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
default:
|
||||||
|
return fmt.Errorf("unknown flash method: %s", spec.FlashMethod)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -485,9 +512,33 @@ func FlashGDB(pkgName, target, port string, ocdOutput bool, config *BuildConfig)
|
||||||
}
|
}
|
||||||
|
|
||||||
return Compile(pkgName, "", spec, config, func(tmppath string) error {
|
return Compile(pkgName, "", spec, config, func(tmppath string) error {
|
||||||
if len(spec.OCDDaemon) != 0 {
|
// Find a good way to run GDB.
|
||||||
|
gdbInterface := spec.FlashMethod
|
||||||
|
switch gdbInterface {
|
||||||
|
case "msd", "command", "":
|
||||||
|
if gdbInterface == "" {
|
||||||
|
gdbInterface = "command"
|
||||||
|
}
|
||||||
|
if spec.OpenOCDInterface != "" && spec.OpenOCDTarget != "" {
|
||||||
|
gdbInterface = "openocd"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Run the GDB server, if necessary.
|
||||||
|
var gdbCommands []string
|
||||||
|
switch gdbInterface {
|
||||||
|
case "native":
|
||||||
|
// Run GDB directly.
|
||||||
|
gdbCommands = append(gdbCommands, "run")
|
||||||
|
case "openocd":
|
||||||
|
gdbCommands = append(gdbCommands, "target remote :3333", "monitor halt", "load", "monitor reset", "c")
|
||||||
|
|
||||||
// We need a separate debugging daemon for on-chip debugging.
|
// We need a separate debugging daemon for on-chip debugging.
|
||||||
daemon := exec.Command(spec.OCDDaemon[0], spec.OCDDaemon[1:]...)
|
args, err := spec.OpenOCDConfiguration()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
daemon := exec.Command("openocd", args...)
|
||||||
if ocdOutput {
|
if ocdOutput {
|
||||||
// Make it clear which output is from the daemon.
|
// Make it clear which output is from the daemon.
|
||||||
w := &ColorWriter{
|
w := &ColorWriter{
|
||||||
|
@ -512,6 +563,10 @@ func FlashGDB(pkgName, target, port string, ocdOutput bool, config *BuildConfig)
|
||||||
// Maybe we should send a .Kill() after x seconds?
|
// Maybe we should send a .Kill() after x seconds?
|
||||||
daemon.Wait()
|
daemon.Wait()
|
||||||
}()
|
}()
|
||||||
|
case "msd":
|
||||||
|
return errors.New("gdb is not supported for drag-and-drop programmable devices")
|
||||||
|
default:
|
||||||
|
return fmt.Errorf("gdb is not supported with interface %#v", gdbInterface)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ignore Ctrl-C, it must be passed on to GDB.
|
// Ignore Ctrl-C, it must be passed on to GDB.
|
||||||
|
@ -526,7 +581,7 @@ func FlashGDB(pkgName, target, port string, ocdOutput bool, config *BuildConfig)
|
||||||
// By default: gdb -ex run <binary>
|
// By default: gdb -ex run <binary>
|
||||||
// Exit GDB with Ctrl-D.
|
// Exit GDB with Ctrl-D.
|
||||||
params := []string{tmppath}
|
params := []string{tmppath}
|
||||||
for _, cmd := range spec.GDBCmds {
|
for _, cmd := range gdbCommands {
|
||||||
params = append(params, "-ex", cmd)
|
params = append(params, "-ex", cmd)
|
||||||
}
|
}
|
||||||
cmd := exec.Command(spec.GDB, params...)
|
cmd := exec.Command(spec.GDB, params...)
|
||||||
|
|
58
target.go
58
target.go
|
@ -42,13 +42,16 @@ type TargetSpec struct {
|
||||||
LDFlags []string `json:"ldflags"`
|
LDFlags []string `json:"ldflags"`
|
||||||
ExtraFiles []string `json:"extra-files"`
|
ExtraFiles []string `json:"extra-files"`
|
||||||
Emulator []string `json:"emulator"`
|
Emulator []string `json:"emulator"`
|
||||||
Flasher string `json:"flash"`
|
FlashCommand string `json:"flash-command"`
|
||||||
OCDDaemon []string `json:"ocd-daemon"`
|
OCDDaemon []string `json:"ocd-daemon"`
|
||||||
GDB string `json:"gdb"`
|
GDB string `json:"gdb"`
|
||||||
GDBCmds []string `json:"gdb-initial-cmds"`
|
|
||||||
PortReset string `json:"flash-1200-bps-reset"`
|
PortReset string `json:"flash-1200-bps-reset"`
|
||||||
FlashMethod string `json:"flash-method"`
|
FlashMethod string `json:"flash-method"`
|
||||||
FlashVolume string `json:"flash-msd-volume-name"`
|
FlashVolume string `json:"msd-volume-name"`
|
||||||
|
FlashFilename string `json:"msd-firmware-name"`
|
||||||
|
OpenOCDInterface string `json:"openocd-interface"`
|
||||||
|
OpenOCDTarget string `json:"openocd-target"`
|
||||||
|
OpenOCDTransport string `json:"openocd-transport"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// copyProperties copies all properties that are set in spec2 into itself.
|
// copyProperties copies all properties that are set in spec2 into itself.
|
||||||
|
@ -91,8 +94,8 @@ func (spec *TargetSpec) copyProperties(spec2 *TargetSpec) {
|
||||||
if len(spec2.Emulator) != 0 {
|
if len(spec2.Emulator) != 0 {
|
||||||
spec.Emulator = spec2.Emulator
|
spec.Emulator = spec2.Emulator
|
||||||
}
|
}
|
||||||
if spec2.Flasher != "" {
|
if spec2.FlashCommand != "" {
|
||||||
spec.Flasher = spec2.Flasher
|
spec.FlashCommand = spec2.FlashCommand
|
||||||
}
|
}
|
||||||
if len(spec2.OCDDaemon) != 0 {
|
if len(spec2.OCDDaemon) != 0 {
|
||||||
spec.OCDDaemon = spec2.OCDDaemon
|
spec.OCDDaemon = spec2.OCDDaemon
|
||||||
|
@ -100,9 +103,6 @@ func (spec *TargetSpec) copyProperties(spec2 *TargetSpec) {
|
||||||
if spec2.GDB != "" {
|
if spec2.GDB != "" {
|
||||||
spec.GDB = spec2.GDB
|
spec.GDB = spec2.GDB
|
||||||
}
|
}
|
||||||
if len(spec2.GDBCmds) != 0 {
|
|
||||||
spec.GDBCmds = spec2.GDBCmds
|
|
||||||
}
|
|
||||||
if spec2.PortReset != "" {
|
if spec2.PortReset != "" {
|
||||||
spec.PortReset = spec2.PortReset
|
spec.PortReset = spec2.PortReset
|
||||||
}
|
}
|
||||||
|
@ -112,6 +112,18 @@ func (spec *TargetSpec) copyProperties(spec2 *TargetSpec) {
|
||||||
if spec2.FlashVolume != "" {
|
if spec2.FlashVolume != "" {
|
||||||
spec.FlashVolume = spec2.FlashVolume
|
spec.FlashVolume = spec2.FlashVolume
|
||||||
}
|
}
|
||||||
|
if spec2.FlashFilename != "" {
|
||||||
|
spec.FlashFilename = spec2.FlashFilename
|
||||||
|
}
|
||||||
|
if spec2.OpenOCDInterface != "" {
|
||||||
|
spec.OpenOCDInterface = spec2.OpenOCDInterface
|
||||||
|
}
|
||||||
|
if spec2.OpenOCDTarget != "" {
|
||||||
|
spec.OpenOCDTarget = spec2.OpenOCDTarget
|
||||||
|
}
|
||||||
|
if spec2.OpenOCDTransport != "" {
|
||||||
|
spec.OpenOCDTransport = spec2.OpenOCDTransport
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// load reads a target specification from the JSON in the given io.Reader. It
|
// load reads a target specification from the JSON in the given io.Reader. It
|
||||||
|
@ -248,9 +260,8 @@ func defaultTarget(goos, goarch, triple string) (*TargetSpec, error) {
|
||||||
Compiler: "clang",
|
Compiler: "clang",
|
||||||
Linker: "cc",
|
Linker: "cc",
|
||||||
GDB: "gdb",
|
GDB: "gdb",
|
||||||
GDBCmds: []string{"run"},
|
|
||||||
PortReset: "false",
|
PortReset: "false",
|
||||||
FlashMethod: "command",
|
FlashMethod: "native",
|
||||||
}
|
}
|
||||||
if goos == "darwin" {
|
if goos == "darwin" {
|
||||||
spec.LDFlags = append(spec.LDFlags, "-Wl,-dead_strip")
|
spec.LDFlags = append(spec.LDFlags, "-Wl,-dead_strip")
|
||||||
|
@ -277,6 +288,33 @@ func defaultTarget(goos, goarch, triple string) (*TargetSpec, error) {
|
||||||
return &spec, nil
|
return &spec, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// OpenOCDConfiguration returns a list of command line arguments to OpenOCD.
|
||||||
|
// This list of command-line arguments is based on the various OpenOCD-related
|
||||||
|
// flags in the target specification.
|
||||||
|
func (spec *TargetSpec) OpenOCDConfiguration() (args []string, err error) {
|
||||||
|
if spec.OpenOCDInterface == "" {
|
||||||
|
return nil, errors.New("OpenOCD programmer not set")
|
||||||
|
}
|
||||||
|
if !regexp.MustCompile("^[\\p{L}0-9_-]+$").MatchString(spec.OpenOCDInterface) {
|
||||||
|
return nil, fmt.Errorf("OpenOCD programmer has an invalid name: %#v", spec.OpenOCDInterface)
|
||||||
|
}
|
||||||
|
if spec.OpenOCDTarget == "" {
|
||||||
|
return nil, errors.New("OpenOCD chip not set")
|
||||||
|
}
|
||||||
|
if !regexp.MustCompile("^[\\p{L}0-9_-]+$").MatchString(spec.OpenOCDTarget) {
|
||||||
|
return nil, fmt.Errorf("OpenOCD target has an invalid name: %#v", spec.OpenOCDTarget)
|
||||||
|
}
|
||||||
|
if spec.OpenOCDTransport != "" && spec.OpenOCDTransport != "swd" {
|
||||||
|
return nil, fmt.Errorf("unknown OpenOCD transport: %#v", spec.OpenOCDTransport)
|
||||||
|
}
|
||||||
|
args = []string{"-f", "interface/" + spec.OpenOCDInterface + ".cfg"}
|
||||||
|
if spec.OpenOCDTransport != "" {
|
||||||
|
args = append(args, "-c", "transport select "+spec.OpenOCDTransport)
|
||||||
|
}
|
||||||
|
args = append(args, "-f", "target/"+spec.OpenOCDTarget+".cfg")
|
||||||
|
return args, nil
|
||||||
|
}
|
||||||
|
|
||||||
// Return the TINYGOROOT, or exit with an error.
|
// Return the TINYGOROOT, or exit with an error.
|
||||||
func sourceDir() string {
|
func sourceDir() string {
|
||||||
// Use $TINYGOROOT as root, if available.
|
// Use $TINYGOROOT as root, if available.
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"inherits": ["atsamd21g18a"],
|
"inherits": ["atsamd21g18a"],
|
||||||
"build-tags": ["sam", "atsamd21g18a", "arduino_nano33"],
|
"build-tags": ["sam", "atsamd21g18a", "arduino_nano33"],
|
||||||
"flash": "bossac -d -i -e -w -v -R --port={port} --offset=0x2000 {bin}",
|
"flash-command": "bossac -d -i -e -w -v -R --port={port} --offset=0x2000 {bin}",
|
||||||
"flash-1200-bps-reset": "true"
|
"flash-1200-bps-reset": "true"
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,5 +15,5 @@
|
||||||
"targets/avr.S",
|
"targets/avr.S",
|
||||||
"src/device/avr/atmega328p.s"
|
"src/device/avr/atmega328p.s"
|
||||||
],
|
],
|
||||||
"flash": "avrdude -c arduino -p atmega328p -P {port} -U flash:w:{hex}"
|
"flash-command": "avrdude -c arduino -p atmega328p -P {port} -U flash:w:{hex}"
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
"extra-files": [
|
"extra-files": [
|
||||||
"src/device/stm32/stm32f103xx.s"
|
"src/device/stm32/stm32f103xx.s"
|
||||||
],
|
],
|
||||||
"flash": "openocd -f interface/stlink-v2.cfg -f target/stm32f1x.cfg -c 'program {hex} reset exit'",
|
"flash-method": "openocd",
|
||||||
"ocd-daemon": ["openocd", "-f", "interface/stlink-v2.cfg", "-f", "target/stm32f1x.cfg"],
|
"openocd-interface": "stlink-v2",
|
||||||
"gdb-initial-cmds": ["target remote :3333", "monitor halt", "load", "monitor reset", "c"]
|
"openocd-target": "stm32f1x"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"inherits": ["atsamd21g18a"],
|
"inherits": ["atsamd21g18a"],
|
||||||
"build-tags": ["sam", "atsamd21g18a", "circuitplay_express"],
|
"build-tags": ["sam", "atsamd21g18a", "circuitplay_express"],
|
||||||
"flash": "{uf2}",
|
|
||||||
"flash-1200-bps-reset": "true",
|
"flash-1200-bps-reset": "true",
|
||||||
"flash-method": "msd",
|
"flash-method": "msd",
|
||||||
"flash-msd-volume-name": "CPLAYBOOT"
|
"msd-volume-name": "CPLAYBOOT",
|
||||||
|
"msd-firmware-name": "firmware.uf2"
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,5 +15,5 @@
|
||||||
"targets/avr.S",
|
"targets/avr.S",
|
||||||
"src/device/avr/attiny85.s"
|
"src/device/avr/attiny85.s"
|
||||||
],
|
],
|
||||||
"flash": "micronucleus --run {hex}"
|
"flash-command": "micronucleus --run {hex}"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"inherits": ["atsamd21g18a"],
|
"inherits": ["atsamd21g18a"],
|
||||||
"build-tags": ["sam", "atsamd21g18a", "feather_m0"],
|
"build-tags": ["sam", "atsamd21g18a", "feather_m0"],
|
||||||
"flash": "{uf2}",
|
|
||||||
"flash-1200-bps-reset": "true",
|
"flash-1200-bps-reset": "true",
|
||||||
"flash-method": "msd",
|
"flash-method": "msd",
|
||||||
"flash-msd-volume-name": "FEATHERBOOT"
|
"msd-volume-name": "FEATHERBOOT",
|
||||||
|
"msd-firmware-name": "firmware.uf2"
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"ldflags": [
|
"ldflags": [
|
||||||
"-T", "targets/hifive1b.ld"
|
"-T", "targets/hifive1b.ld"
|
||||||
],
|
],
|
||||||
"flash": "{hex}",
|
|
||||||
"flash-method": "msd",
|
"flash-method": "msd",
|
||||||
"flash-msd-volume-name": "HiFive"
|
"msd-volume-name": "HiFive",
|
||||||
|
"msd-firmware-name": "firmware.hex"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"inherits": ["atsamd21g18a"],
|
"inherits": ["atsamd21g18a"],
|
||||||
"build-tags": ["sam", "atsamd21g18a", "itsybitsy_m0"],
|
"build-tags": ["sam", "atsamd21g18a", "itsybitsy_m0"],
|
||||||
"flash": "{uf2}",
|
|
||||||
"flash-1200-bps-reset": "true",
|
"flash-1200-bps-reset": "true",
|
||||||
"flash-method": "msd",
|
"flash-method": "msd",
|
||||||
"flash-msd-volume-name": "ITSYBOOT"
|
"msd-volume-name": "ITSYBOOT",
|
||||||
|
"msd-firmware-name": "firmware.uf2"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"inherits": ["atsamd51g19a"],
|
"inherits": ["atsamd51g19a"],
|
||||||
"build-tags": ["sam", "atsamd51g19a", "itsybitsy_m4"],
|
"build-tags": ["sam", "atsamd51g19a", "itsybitsy_m4"],
|
||||||
"flash": "{uf2}",
|
|
||||||
"flash-1200-bps-reset": "true",
|
"flash-1200-bps-reset": "true",
|
||||||
"flash-method": "msd",
|
"flash-method": "msd",
|
||||||
"flash-msd-volume-name": "ITSYM4BOOT"
|
"msd-volume-name": "ITSYM4BOOT",
|
||||||
|
"msd-firmware-name": "firmware.uf2"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
{
|
{
|
||||||
"inherits": ["nrf51"],
|
"inherits": ["nrf51"],
|
||||||
"build-tags": ["microbit"],
|
"build-tags": ["microbit"],
|
||||||
"flash": "openocd -f interface/cmsis-dap.cfg -f target/nrf51.cfg -c 'program {hex} reset exit'",
|
|
||||||
"ocd-daemon": ["openocd", "-f", "interface/cmsis-dap.cfg", "-f", "target/nrf51.cfg"],
|
|
||||||
"gdb-initial-cmds": ["target remote :3333", "monitor halt", "load", "monitor reset", "c"],
|
|
||||||
"flash-method": "msd",
|
"flash-method": "msd",
|
||||||
"flash-msd-volume-name": "MICROBIT"
|
"openocd-interface": "cmsis-dap",
|
||||||
|
"msd-volume-name": "MICROBIT",
|
||||||
|
"msd-firmware-name": "firmware.hex"
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,5 +14,6 @@
|
||||||
"extra-files": [
|
"extra-files": [
|
||||||
"lib/nrfx/mdk/system_nrf51.c",
|
"lib/nrfx/mdk/system_nrf51.c",
|
||||||
"src/device/nrf/nrf51.s"
|
"src/device/nrf/nrf51.s"
|
||||||
]
|
],
|
||||||
|
"openocd-target": "nrf51"
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,5 +15,6 @@
|
||||||
"extra-files": [
|
"extra-files": [
|
||||||
"lib/nrfx/mdk/system_nrf52.c",
|
"lib/nrfx/mdk/system_nrf52.c",
|
||||||
"src/device/nrf/nrf52.s"
|
"src/device/nrf/nrf52.s"
|
||||||
]
|
],
|
||||||
|
"openocd-target": "nrf51"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
{
|
{
|
||||||
"inherits": ["nrf52840"],
|
"inherits": ["nrf52840"],
|
||||||
"build-tags": ["nrf52840_mdk"],
|
"build-tags": ["nrf52840_mdk"],
|
||||||
"flash": "openocd -f interface/cmsis-dap.cfg -f target/nrf51.cfg -c 'program {hex} reset exit'",
|
"flash-method": "openocd",
|
||||||
"ocd-daemon": ["openocd", "-f", "interface/cmsis-dap.cfg", "-f", "target/nrf51.cfg"],
|
"openocd-interface": "cmsis-dap"
|
||||||
"gdb-initial-cmds": ["target remote :3333", "monitor halt", "load", "monitor reset", "c"]
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,5 +15,6 @@
|
||||||
"extra-files": [
|
"extra-files": [
|
||||||
"lib/nrfx/mdk/system_nrf52840.c",
|
"lib/nrfx/mdk/system_nrf52840.c",
|
||||||
"src/device/nrf/nrf52840.s"
|
"src/device/nrf/nrf52840.s"
|
||||||
]
|
],
|
||||||
|
"openocd-target": "nrf51"
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
"extra-files": [
|
"extra-files": [
|
||||||
"src/device/stm32/stm32f103xx.s"
|
"src/device/stm32/stm32f103xx.s"
|
||||||
],
|
],
|
||||||
"flash": "openocd -f interface/stlink-v2-1.cfg -f target/stm32f1x.cfg -c 'program {hex} reset exit'",
|
"flash-method": "openocd",
|
||||||
"ocd-daemon": ["openocd", "-f", "interface/stlink-v2-1.cfg", "-f", "target/stm32f1x.cfg"],
|
"openocd-interface": "stlink-v2-1",
|
||||||
"gdb-initial-cmds": ["target remote :3333", "monitor halt", "load", "monitor reset", "c"]
|
"openocd-target": "stm32f1x"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
{
|
{
|
||||||
"inherits": ["nrf51"],
|
"inherits": ["nrf51"],
|
||||||
"build-tags": ["pca10031"],
|
"build-tags": ["pca10031"],
|
||||||
"flash": "nrfjprog -f nrf51 --sectorerase --program {hex} --reset",
|
"flash-command": "nrfjprog -f nrf51 --sectorerase --program {hex} --reset",
|
||||||
"ocd-daemon": ["openocd", "-f", "interface/cmsis-dap.cfg", "-f", "target/nrf51.cfg"],
|
"openocd-interface": "cmsis-dap"
|
||||||
"gdb-initial-cmds": ["target remote :3333", "monitor halt", "load", "monitor reset", "c"]
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
{
|
{
|
||||||
"inherits": ["nrf52"],
|
"inherits": ["nrf52"],
|
||||||
"build-tags": ["pca10040"],
|
"build-tags": ["pca10040"],
|
||||||
"flash": "nrfjprog -f nrf52 --sectorerase --program {hex} --reset",
|
"flash-method": "openocd",
|
||||||
"ocd-daemon": ["openocd", "-f", "interface/jlink.cfg", "-c", "transport select swd", "-f", "target/nrf51.cfg"],
|
"flash-command": "nrfjprog -f nrf52 --sectorerase --program {hex} --reset",
|
||||||
"gdb-initial-cmds": ["target remote :3333", "monitor halt", "load", "monitor reset", "c"]
|
"openocd-interface": "jlink",
|
||||||
|
"openocd-transport": "swd"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
{
|
{
|
||||||
"inherits": ["nrf52840"],
|
"inherits": ["nrf52840"],
|
||||||
"build-tags": ["pca10056"],
|
"build-tags": ["pca10056"],
|
||||||
"flash": "nrfjprog -f nrf52 --sectorerase --program {hex} --reset",
|
"flash-method": "command",
|
||||||
"ocd-daemon": ["openocd", "-f", "interface/cmsis-dap.cfg", "-f", "target/nrf51.cfg"],
|
"flash-command": "nrfjprog -f nrf52 --sectorerase --program {hex} --reset",
|
||||||
"gdb-initial-cmds": ["target remote :3333", "monitor halt", "load", "monitor reset", "c"]
|
"msd-volume-name": "JLINK",
|
||||||
|
"msd-firmware-name": "firmware.hex"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
{
|
{
|
||||||
"inherits": ["nrf52840"],
|
"inherits": ["nrf52840"],
|
||||||
"build-tags": ["reelboard"],
|
"build-tags": ["reelboard"],
|
||||||
"flash": "openocd -f interface/cmsis-dap.cfg -f target/nrf51.cfg -c 'program {hex} reset exit'",
|
"flash-method": "msd",
|
||||||
"ocd-daemon": ["openocd", "-f", "interface/cmsis-dap.cfg", "-f", "target/nrf51.cfg"],
|
"msd-volume-name": "reel-board",
|
||||||
"gdb-initial-cmds": ["target remote :3333", "monitor halt", "load", "monitor reset", "c"]
|
"msd-firmware-name": "firmware.hex",
|
||||||
|
"openocd-interface": "cmsis-dap"
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
"extra-files": [
|
"extra-files": [
|
||||||
"src/device/stm32/stm32f407.s"
|
"src/device/stm32/stm32f407.s"
|
||||||
],
|
],
|
||||||
"flash": "openocd -f interface/stlink-v2.cfg -f target/stm32f4x.cfg -c 'program {hex} reset exit'",
|
"flash-method": "openocd",
|
||||||
"ocd-daemon": ["openocd", "-f", "interface/stlink.cfg", "-f", "target/stm32f4x.cfg"],
|
"openocd-interface": "stlink-v2",
|
||||||
"gdb-initial-cmds": ["target remote :3333", "monitor halt", "load", "monitor reset", "c"]
|
"openocd-target": "stm32f4x"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"inherits": ["atsamd21e18a"],
|
"inherits": ["atsamd21e18a"],
|
||||||
"build-tags": ["sam", "atsamd21e18a", "trinket_m0"],
|
"build-tags": ["sam", "atsamd21e18a", "trinket_m0"],
|
||||||
"flash": "{uf2}",
|
|
||||||
"flash-1200-bps-reset": "true",
|
"flash-1200-bps-reset": "true",
|
||||||
"flash-method": "msd",
|
"flash-method": "msd",
|
||||||
"flash-msd-volume-name": "TRINKETBOOT"
|
"msd-volume-name": "TRINKETBOOT",
|
||||||
|
"msd-firmware-name": "firmware.uf2"
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче