J-Rios / vscode-skelly-avr

VSCode AVR skelleton base example project to work (develop) with Microchip-Atmel AVR microcontrollers on a Linux system without the need of a full IDE.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vscode-skelly-avr

VSCode AVR skelleton base example project to work (develop) with Microchip-Atmel AVR microcontrollers on a Linux system without the need of a full IDE.

This project example target an atmega328p microcontroller, but the repository can be used as a reference to create new projects for other targets.

Requirements

  • Install required toolchain components:
sudo apt-get update
sudo apt-get -y install binutils
sudo apt-get -y install make
sudo apt-get -y install gcc-avr
sudo apt-get -y install avr-libc
sudo apt-get -y install cflow
  • Install Flashing Tool:
sudo apt-get -y install avrdude
  • Give execute permissions to tools scripts:
chmod +x vscode-skelly-avr/tools/*

How to Create a AVR project supported by vscode

Here is the steps that has been followed to create current project:

  1. Create project directories and setup current project:
mkdir ~/vscode-skelly-avr
cd ~/vscode-skelly-avr
mkdir bin build doc inc lib src test tools
  1. Create src/main.cpp source file with some basic application (i.e. blink).

  2. Create a build/Makefile with expected targets and configurations to build the project.

  3. Create a ./vscode/c_cpp_properties.json file and setup C & C++ standard versions, Defines, compiler arguments that are used in project, and the include paths to system installed AVR libc to setup correctly intellisense functionality.

  4. Create a ./vscode/tasks.json file and setup make commands to execute for each available tasks to be used from vscode.

  5. Create a ./vscode/launch.json file and setup vscode project Run and Debug behaviour.

Usage

Build:

  1. Physically connect the hardware programmer to target device and the PC.

  2. Using a shell, go to build/ directory and run make to see build instructions.

  3. Run make build DEVICE=X F_CPU=X to launch the Build.

  4. Run make flash PROGRAMMER=X to build and flash the firmware into target device.

About

VSCode AVR skelleton base example project to work (develop) with Microchip-Atmel AVR microcontrollers on a Linux system without the need of a full IDE.

License:GNU Lesser General Public License v2.1


Languages

Language:Makefile 54.0%Language:Shell 24.7%Language:C 13.6%Language:C++ 7.6%