AVR assembler on PlatformIO
- Install visual studio code
- Install PlatformIO plugin
- Add our user to dialout group
username@cpu:~$ sudo usermod -a -G dialout <username>
- Create in PlatformIO a project with
- Board : ATmega328P/PA
- framework : Arduino
- In the file Platformio.ini
- Delete the framework line. In order to use avr-gcc as compiler
- add the follow line to the file debug_tool = simavr
- Close vscode
- Go to the PlatformIO path. If you are already crate the project you will see the atmelavr folder
username@cpu:~$ cd ~/.platformio/platforms/atmelavr
- Create the path ~/.platformio/platforms/atmelavr/misc/svd
username@cpu:~/.platformio/platforms/atmelavr$ mkdir misc
username@cpu:~/.platformio/platforms/atmelavr$ cd misc
username@cpu:~/.platformio/platforms/atmelavr/misc$ mkdir svd
- Copy the file atmega328p.svd into the svd folder
username@cpu:~$ cp <path_to_this_repo>/atmega328p.svd ~/.platformio/platforms/atmelavr/misc/svd
- Change the file "~/.platformio/platforms/atmelavr/boards/ATmega328P.json" for the one given in this repository
username@cpu:~$ rm ~/.platformio/platforms/atmelavr/boards/ATmega328P.json
username@cpu:~$ cp <path_to_this_repo>/ATmega328P.json ~/.platformio/platforms/atmelavr/boards/
- Open vscode and change "src/main.cpp" to "src/main.S"
- Modify main.S with your assembler code. you can use the examples in this repository as a template