Go Down

Topic: CodeBlocks Arduino IDE - real C++ IDE for Arduino development (rev.20130827) (Read 77354 times) previous topic - next topic

CodeBlocks Arduino IDE is a complete out-of-box C++ IDE for Arduino development. It will be liked by software engineers demanding a more powerful IDE and those who need to heavily modify or develop Arduino libraries. I have been maintaining the project basically to provide myself a productive and flexible Arduino development environment. Right now I only release for Windows builds, while someone else has forked my code (but seems not updating often) and provdes some instructions how to use the IDE on Linux.

Download Latest Release


Release 20130428

   Improved Arduino Builder integration with CodeBlocks (no need to close the window after uploading)
   Updated several Arduino libraries (OBD, MPU6050, MultiLCD)
   Compile with -O2 instead of -Os when target MCU has 64KB or larger program memory

Release 20130401

   Fixed stop running button not terminating simulation process bug
   All compiled files now stored in build directory in project path
   Improving user experience of project wizard in several aspects
   Re-added "Simulator - Debug" target for debugging in simulation

Release 20130329

   Automatically building referenced Arduino libraries
   Built Arduino core files now cached for improving project building speed
   Fixed issues with Microduino
   Fixed a bug causing wrong board type choice on uploading
   Arduino Builder 0.8.3

Release 20130324

   Updated Arduino core and library files to 1.0.4
   Arduino Builder 0.8.1

Release 20130322

   Including project folder in include file search path by default
   Arduino Builder 0.8.0

Release 20130319

   Added opening serial terminal right after uploading
   Updated Arduino Uploader to 0.7.1

Release 20130318

   Added MCU operating frequency option (16/12/8 Mhz)
   Added support for Microduino Core+ (ATMega644PA)
   Updated Arduino Uploader to 0.7.0

Release 20130308

   Windows XP compatibility issue fixed
   Arduino Uploader updated
   Added "-lm" option in linking command line

Release 20130302

   Using Arduino Uploader GUI version for uploading
   Changed default sketch file extension from .cpp to .ino

Something about the simulator

As you may have noticed (in the screenshot above, there are two simulator targets in every Arduino project created with the project wizard. These are for building and running an Arduino sketch on PC. The idea is to re-write the underlying Arduino core files (and some AVR C routines) to simulate the behavior of a AVR chip (SFR, interrupts) and Arduino (digital/analog pins, serial UART). As an Arduino sketch is built with AVR-GCC, the code can be compiled with x86-GCC with no modification and so are the most libraries. As is running on PC as a native program, the program logic can be debugged more easily within the IDE (by GDB, with break point, single step, variable watch etc.). For the hardware simulation, right now I have only implemented serial UART simulation with hardware serial port on PC. This is useful for debugging code dealing with any serial devices by connecting the device directly to PC via a USB-TTL adapter. I have managed to run a sketch based on TinyGPS with a USB GPS receiver.
For example, to use PC serial port COM5 to simulate Arduino's Serial1, you can do like this in the sketch:
Code: [Select]
Serial1.begin(115200, 5);
This will open PC serial port COM5 and subsequential calls to Serial1 will act on the PC serial port.

I will keep working on this API-level simulator and the next hardware to be simulated will be LCD and SD device. Progress will always be published together with the release of IDE distribution as the simlator is useless without the IDE. It's source code is located in ardusim sub-directory of the package.
My Arduino blog: http://arduinodev.com/blog

Updated again.
The latest release now supports uploading to Arduino by clicking IDE's run button (or press F9 to build and run). This is like running a compiled binary on PC.
The simulation target (which simulate Arduino API) is also being developed as a portion of the IDE now.
My Arduino blog: http://arduinodev.com/blog

I've made some progress in the API-level Arduino simulator, which is also included in the new release. Serial UART can be simulated now with hardware serial port on PC. This will be very useful to debug serial communication.
My Arduino blog: http://arduinodev.com/blog

Revision 20130306 fixed Windows XP compatibility issues.
My Arduino blog: http://arduinodev.com/blog

Delta 3D Printer with Auto Bed Leveling - http://www.kickstarter.com/projects/ttstam/openbeam-kossel-pro-a-new-type-of-3d-printer/posts

Just installed this, works great! So much better than the official Arduino IDE! Thanks a lot!

Mar 17, 2013, 03:48 pm Last Edit: Mar 17, 2013, 05:30 pm by stanleyhuang Reason: 1
Thanks for your compliment. An update is just released.
The IDE maybe a little bit tricky for non-progreammers but once you grab it, it's definitely more efficient. I will write some tutorials in future.
My Arduino blog: http://arduinodev.com/blog


This version does everything I need.  It allows me to specify a 12 MHz clock rate for my project which is a 3.3v ATmega328p which does not support 16 MHz clock.  My project can now proceed.  I just put a scope on my 10 millisecond interrupt and it happens every 10 ms, which proves the code now is using a 12 MHz clock.  Thank you Stanley.  Nice job and thank you for the great tool you have generously provided.
Douglas S. Basberg, MSEE, PE
Embedded Controls Consultant
DSB Engineering, Inc.

My Arduino blog: http://arduinodev.com/blog


Great project, but how can i add a custom library ?

In Arduino Ide, i put the files to "E:\Eigene Dateien\Arduino\libraries" and i can work with it.

How does this work in codeblocks?


Of course.
Simply place the library files in the sketch folder and add the .cpp file into the project (choose menu Project->Add Files).
My Arduino blog: http://arduinodev.com/blog


Thanks, but did not work.

Starting codeblocks, create new arduino project "test".
Copy folder "RTClib" to folder "C:\arduino\test".
Add "RTClib\RTClib.h" + "RTClib\RTClib.cpp"  to project.
edit "scetch.ino"
#include <Wire.h>
#include "RTClib.h"

C:\arduino\test\RTClib\RTClib.cpp|4|fatal error: Wire.h: No such file or directory|

RTClib.cpp 4:  #include <Wire.h>

Mar 20, 2013, 04:19 pm Last Edit: Mar 20, 2013, 05:35 pm by stanleyhuang Reason: 1
I bet you have not changed build target from "Simulator" to an actual arduino board type. You also need to enable compile and link option for Wire library (right click the Wire.cpp in libraries sub-folder in project view).
My Arduino blog: http://arduinodev.com/blog


You are right, now Build target "Mega260" , sorry about that.

sketch.ino|3|error: RTClib.h: No such file or directory.

Ok, set up a search path to RTClib - directory under build options.

its working now.

Thanks a lot.



Hi, I'd like to know if somehow we can use the simulator to mock digitalRead/analogRead/interupt signals?

CodeBlocks Arduino IDE is a complete out-of-box C++ IDE for Arduino development most suitable for software engineers demanding a more powerful IDE and those who need to heavily modify or develop Arduino libraries. I have been maintaining the project basically to provide myself a productive and flexible Arduino development environment. Now I mainly release for Windows only, while someone else has forked my code on github and maintain the linux port.


Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131