- Setup
-
Don't use
sudo apt install platformiobut if you did, trysudo apt remove platformiobefore proceeding further. -
Install
python-venv:sudo apt-get install python3-venv -
Install PlatformIO :
curl -fsSL -o get-platformio.py https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py && python3 get-platformio.py
- It will be installed in
/home/YOUR_USERNAME/.platformio/penv/bin/platformio, so you need to include it into your PATH or SYMLINK it like below to usepioCLI command from Terminal.
-
Symlink into your
~/.local/bin:ln -s /home/YOUR_USERNAME/.platformio/penv/bin/platformio ~/.local/bin/pio -
Now try updating a library :
pio pkg update -g -p "ch32v"
** You now also may install PlatformIO plugin into your vscode.
-
Install
ch32vplatform package :pio pkg install -g -p https://github.com/Community-PIO-CH32V/platform-ch32v.git -
Create
udev-ruleforch32vusb access :sudo touch /etc/udev/rules.d/99-platformio-udev.rules -
Paste below lines into the rules :
SUBSYSTEM=="usb", ATTR{idVendor}="1a86", ATTR{idProduct}=="8010", GROUP="plugdev" SUBSYSTEM=="usb", ATTR{idVendor}="4348", ATTR{idProduct}=="55e0", GROUP="plugdev" SUBSYSTEM=="usb", ATTR{idVendor}="1a86", ATTR{idProduct}=="8012", GROUP="plugdev"
That's it. Enjoy !
References :