2

I find KDevelop a very good IDE overall and I already have a good experience using it for cross-compiling and debugging software for ARM9 CPUs running embedded Linux. Now that I got some Arduino boards for smaller projects, I found them a very nice and easy platform, but its IDE is far behind Kdevelop in functionality, code introspection and so on, so I'd like to adapt Kdevelop to compile and program arduino boards instead.

The goal is to enable software development in pure C/C++ or regular C++ using arduino libraries as well (this answer helps a lot in making this possible), bypassing arduino's artificial limitations imposed to make it easy for begginers. I intend to use CMake as the build system, for it integrates well with Kdevelop and allows for easy cross-compilation. As a side note, you could use this toolchain file for making CMake use the avr-gcc cross-compiler:

INCLUDE(CMakeForceCompiler)

# the name of the target operating system
#SET(CMAKE_SYSTEM_NAME Linux)

# which C and C++ compiler to use
CMAKE_FORCE_C_COMPILER(avr-gcc GNU)
CMAKE_FORCE_CXX_COMPILER(avr-g++ GNU)

# here is the target environment located
SET(CMAKE_FIND_ROOT_PATH  /usr/avr) 

# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search 
# programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

Since arduino uses avr-gcc and avrdude behind the scenes to compile and program the target AVR microcontrollers, I found some interesting directions such as AVR Tutorial, Programming Arduino Uno in pure C and Program Arduino with AVR-GCC, but I still don't know how to add a button on Kdevelop's interface to call avrdude in order to upload the compiled binary to the microcontrollers' flash memory. Anyone can help me out doing that?

Community
  • 1
  • 1
Claudio
  • 2,191
  • 24
  • 49
  • Hmm! Although my CMakeLists.txt file is ready and working for my project, this might be a good alternative to putting an upload button on KDevelop: https://github.com/queezythegreat/arduino-cmake – Claudio Jul 28 '13 at 21:10
  • 1
    update for 2019, this appears to be the most upto date arduino-cmake project https://github.com/arduino-cmake/Arduino-CMake-NG – Enetheru May 24 '19 at 01:29
  • That's nice! I'll take some time to look over that again soon... thanks for pointing out! – Claudio May 26 '19 at 21:03

0 Answers0