Skip to content

Commit

Permalink
cmd/mecha: add stack-size=8kb as default for flashing boards
Browse files Browse the repository at this point in the history
Signed-off-by: deadprogram <[email protected]>
  • Loading branch information
deadprogram committed Mar 1, 2024
1 parent 59def5e commit cc2fcda
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/mecha/flash.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ func flash(cCtx *cli.Context) error {

var cmd *exec.Cmd
if cCtx.Bool("monitor") {
cmd = exec.Command("tinygo", "flash", "-size", "short", "-target", targetName, "-monitor", ".")
cmd = exec.Command("tinygo", "flash", "-size", "short", "-stack-size", "8kb", "-target", targetName, "-monitor", ".")
} else {
cmd = exec.Command("tinygo", "flash", "-size", "short", "-target", targetName, ".")
cmd = exec.Command("tinygo", "flash", "-size", "short", "-stack-size", "8kb", "-target", targetName, ".")
}

var stdoutBuf, stderrBuf bytes.Buffer
cmd.Stdout = io.MultiWriter(os.Stdout, &stdoutBuf)
cmd.Stderr = io.MultiWriter(os.Stderr, &stderrBuf)

if err := cmd.Run(); err != nil {
log.Fatalf("tinygo flash -size short -target %s .: %v\n", targetName, err) //, stderr.Bytes())
log.Fatalf("tinygo flash -size short -stack-size 8kb -target %s .: %v\n", targetName, err) //, stderr.Bytes())
}

// print the monitoring output
Expand Down

0 comments on commit cc2fcda

Please sign in to comment.