Skip to content

Demo project CLion + Arduino Mega2560 + AVR-GCC compiler

License

Notifications You must be signed in to change notification settings

elmot/clion-avr-c-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demo project CLion + Arduino Uno + AVR-GCC compiler

Note Debug is not supported yet

Prerequirements

Hardware

All platforms(MAC, Linux, Windows)

Windows only

HOWTO

Use the project

  • Open the project with CLion
  • Setup a new CLion Toolchain (i.e. set compilators and debugger location) with your AVR8 GNU installation (Settings -> Build, Execution, Deployment -> Toolchains). You may use either avr-gdb-py or avr-gdb. First one is better but requires Python to be installed.
Screenshot 1

CLion Settings Part I

  • Use the toolchain for the project (Settings -> Build, Execution, Deployment -> CMake -> Toolchain:)
Screenshot 2

CLion Settings Part II

  • Adjust CMakeLists.txt settings, such as avrdude location and actual COM port
  • Select FLASH run configuration
  • Build it. Arduino yellow LED should start blinking about 1Hz

Use simulator(simavr)

Screenshot 3

CLion Run Configuration

  • Set a breakpoint somewhere in your main()
  • Select SIMAVR Run Configuaration
  • Click Debug
  • Enjoj!

Diagnose problems

  • Uncomment avrdude verbose switch

Use another AVR-based board

  • Check if this repository contains a branch dedicated to your CPU
  • Clone this project
  • Make adjustments as in "Use the project"
  • Open the project with CLion
  • Correct CMakeLists.txt
    • Project name in add_executable() clause
    • List of source files in add_executable clause
    • add include_directories() clause(s) if needed
    • TARGET_CPU
    • FLASH custom target command line to reflect another hardware

About

Demo project CLion + Arduino Mega2560 + AVR-GCC compiler

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published