You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Arduino Mega 2560]({{<ref "../microcontrollers/arduino-mega2560">}})) use 9600
68
+
instead.
69
+
70
+
`-target={name}`: If you have more than one microcontrollers attached, you can
71
+
sometimes just specify the target name and let `tinygo monitor` figure out the
72
+
port. Sometimes, this does not work and you have to explicitly use the `-port`
73
+
flag.
74
+
75
+
The serial monitor intercepts several control characters for its own use instead
76
+
of sending them to the microcontroller:
77
+
78
+
* Control-C: terminates the `tinygo monitor`
79
+
* Control-Z: suspends the `tinygo monitor` and drops back into shell
80
+
* Control-\\: terminates the `tinygo monitor` with a stack trace
81
+
* Control-S: flow control, suspends output to the console
82
+
* Control-Q: flow control, resumes output to the console
83
+
* Control-@: thrown away by `tinygo monitor`
84
+
85
+
**Note**: If you are using `os.Stdin` on the microcontroller, you may find that
86
+
a CR character on the host computer (also known as Enter, `^M`, or `\r`) is
87
+
transmitted to the microcontroller without conversion, so `os.Stdin` returns a
88
+
`\r` character instead of the expected `\n` (also known as `^J`, NL, or LF) to
89
+
indicate end-of-line. You may be able to get around this problem by hitting
90
+
`Control-J` in `tinygo monitor` to transmit the `\n` end-of-line character.
40
91
41
92
### gdb
42
93
Compile the program, optionally flash it to a microcontroller if it is a remote target, and drop into a GDB shell. From there you can set breakpoints, start the program with `run` or `continue` (`run` for a local program, `continue` for on-chip debugging), single-step, show a backtrace, break and resume the program with Ctrl-C/`continue`, etc. You may need to install extra tools (like `openocd` and `arm-none-eabi-gdb`) to be able to do this. Also, you may need a dedicated debugger to be able to debug certain boards if no debugger is integrated. Some boards (like the BBC micro:bit and most professional evaluation boards) have an integrated debugger.
0 commit comments