Skip to content

Commit 75ad45f

Browse files
soypatdeadprogram
authored andcommitted
Create tinygo-flash-errors.md
move file to guides
1 parent d48c669 commit 75ad45f

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
title: "Tinygo flash errors"
3+
weight: 11
4+
description: |
5+
Solving common problems when flashing your first TinyGo program.
6+
---
7+
8+
Flashing to a port may be a source of pain with a unconfigured computer. Here are some common problems when trying to get your first program on a device.
9+
10+
* [Serial port permission problems (Linux)](#permission-denied-linux)
11+
12+
### Permission Denied (Linux)
13+
14+
This error is usually encountered when flashing your first program, here's a typical error:
15+
```
16+
avrdude: ser_open(): can't open device "/dev/ttyACM0": Permission denied
17+
```
18+
19+
The above error may be followed by `ioctl` errors too.
20+
21+
To fix this we must make sure our user is included in the group with access to serial ports. On ubuntu and Debian this is the **dialout** group.
22+
23+
First we can check if we are not already part of the `dialout` group:
24+
25+
```shell
26+
groups
27+
```
28+
The output should look something like `youruser adm cdrom sudo dip plugdev lpadmin lxd sambashare`. If dialout is not present in the groups we can add ourselves to it with the following command:
29+
30+
```shell
31+
sudo usermod -aG dialout $(whoami)
32+
```
33+
This will add our current user to dialout group. **Log out and log in again to complete the procedure**. You should now be able to flash to your device.
34+
35+
As a last resort if this does not work you can try to modify the permissions with `chmod`. For the error above we may try `sudo chmod a+rw /dev/ttyACM0` where `/dev/ttyACM0` is the serial port we are trying to flash to.

0 commit comments

Comments
 (0)