tinygo-org / tinygo

Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.
https://tinygo.org
Other
15.43k stars 911 forks source link

There is a problem after writing atsamd / nrf5 with openocd #1320

Open sago35 opened 4 years ago

sago35 commented 4 years ago

1310 makes it easier to write from openocd with feather-m4 and others.

However, two problems remain.

1. touchSerialPortAt1200bps() is executed when programmer is specified

As for 1, the following json does not have the flash-1200-bps-reset setting and will not cause a problem. However, it is not reasonable to separate json, so you need to set flash-1200-bps-reset = false when -programmer is specified.

{
    "inherits": ["atsamd51j19a"],
    "build-tags": ["sam", "atsamd51j19a", "feather_m4"]
}

If you solve this problem, we will be able to write to the board in panic state. (Normally flash-1200-bps-reset cannot be performed on a board in panic state.)

Also, we will be able to do rewrites very quickly.

2. Sometimes bootloader mode is triggered after writing

I think the reason for this problem is that the reset is performed multiple times when writing. I don't know why, but changing program *.hex reset exit to program *.hex verify reset exit solved the problem. I don't know if this is the right solution, but I'd like to fix it in some way.

sago35 commented 4 years ago

Both issues 1 and 2 also occurred with feather-nrc52840.

sago35 commented 4 years ago
  1. touchSerialPortAt1200bps() is executed when programmer is specified

fixed. (flash: call PortReset only on other than openocd #1335)

deadprogram commented 4 years ago

This issue was corrected in v0.15.0 which was just released. Now closing.

sago35 commented 4 years ago
  1. Sometimes bootloader mode is triggered after writing This one is still unresolved.

If I check with feather-m4 and wioterminal now, it's almost certainly a bootloader state. The writes are successful, so when I reset it, it starts working normally.

Trying it with feather-nrf52840 and xiao did not reproduce the problem.

deadprogram commented 3 years ago

@sago35 is this still an issue?

sago35 commented 3 years ago

Sometimes bootloader mode is triggered after writing This one is still unresolved.

@deadprogram

For the adafruit board, updating the bootloader fixed the problem. However, I still have the following problem with wioterminal.

I would like #1397 to be merged.

However, at this point, I still don't know why adding verify eliminates the problem. This is a problem with openocd, and the same problem occurs when I run openocd directly without tinygo.

niaow commented 2 years ago

Is this still an issue now that #1397 is merged?