Go Down

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

stanleyhuang

What's your target? For Arduino MEGA 1280/2560, sketch is compiled with -O2 (optimize for speed) whereas Arduino IDE compiles with -Os (optimize for size). Faster code is normally larger.


The HEX files are also larger,  With the Arduino IDE the HEX file is 18,934 bytes whereas with CodeBlocks it's 21,573 bytes.

Looks like there's some more optimization to be done.
My Arduino blog: http://arduinodev.com/blog

KirAsh4

328P (genuine Arduino UNO)

I tried compiling a larger sketch and this time CodeBlocks came out about 100 bytes smaller:
Code: [Select]
Arduino IDE: 12,446 bytes
CodeBlocks: 12,322 bytes


For the HEX files
Code: [Select]
Arduino IDE: 35,019 bytes
CodeBlocks: 34,680 bytes


The previous sketch that I compiled has the same exact libraries included as this larger one, it just has less stuff written.

KirAsh4

Another question: in the Arduino IDE, I can add a new tab and add another file to the project which I can edit.  I do this to break up long sketches into separate, smaller chunks.  When I re-open the project, it re-opens all the necessary files in tabs for me to work on.  How do I accomplish this in CodeBlocks?

stanleyhuang

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

md10bldr

CodeBlocks Arduino slowing down?

I've noticed that Arduino CodeBlocks seems to be slowing down as the newer versions come out - has anyone else experienced this?

I've been using Arduino Codeblocks since release 10120127, and back then, the IDE moved right along - the last couple of versions leading up to 20130428 seem to "hesitate" more often. I've used the same versions on my laptop; with the earlier versions running smoothly, and the later ones hesitating for very noticeable periods of time. Checking the code blocks forums, it looked like the code completion plugin might be the culprit, and sure enough, disabling it has things running smoothly. However, I went back and checked 10120127, and it uses the same 1.0 version of code completion as 20130428, so plugin version isn't the issue. I'd hate to have to leave code completion disabled, as it's one of the real key feature of the IDE.

I've also checked the running processes in windows task manager, and can definitely say CodeBlocks is the only thing running.

Anyone else?


stanleyhuang

#65
May 13, 2013, 05:01 am Last Edit: May 13, 2013, 05:11 am by stanleyhuang Reason: 1
I didn't experience noticable slowing down on my end. I have been modifying and improving the building and uploading stage for Arduino but didn't change anything to the IDE's code editing and completion part.
My Arduino blog: http://arduinodev.com/blog

falcon74

@Stanley firstly, thanks for this excellent project. Came across this, thanks to another post on arduino forums.

Have gone through this entire thread, and did see one reference to what I was looking for, but no clear answer. So kindly bear with me on these questions about ArduinoDev CodeBlocks IDE (I call it ACI for rest of my mail).

1. Standard ArduinoIDE has settings to select the Arduino board type. How come, there is nothing similar (or that I could find) on ACI ? In the project creation Wizard, I see only 2 choices "Standard (8-bit AVR)" and "Due", however even between the 8-bit AVR boards/uC's there's a lot of difference in terms of peripherals, pins etc.

2. To use non-standard arduino-core's like MIT's High-Low Tech (HLT) arduino core for attiny45/85 or @CodingBadly's Arduino-tiny core ? Is there any way to use those cores ?

3. Was curious about how to add custom Arduino libraries, but I found the answer in one of the replies in this thread. (Just to show that I've read through :-) )

4. Do you plan to set up a FAQ re your IDE ? This thread is currently 5-pages long, and not difficult to miss some point in an answer. A FAQ, when you get time, would be so useful.

gabriel42

I am really looking forward to using this IDE. It is just what I was looking for. I having some issues with it right now, though. To use some library, I believe you said all you have to do is copy the files into your project folder and then include them.

So...I copied the normal Servo.h and Servo.cpp files into my project, and then added them to my project. However, when I build, I got four identical errors on four similar areas of code in Servo.cpp

Quote

error: cannot convert 'uint8_t* {aka unsigned char*}' to 'volatile uint16_t* {aka volatile short unsigned int*}' for argument '2' to 'void handle_interrupts(timer16_Sequence_t, volatile uint16_t*, volatile uint16_t*)'|


and the four pieces of code are identical, except the timer numbers are changed. the error is on the handle_interrupts line. If anyone is looking for this part of the Servo.cpp code, the first error is on line 105

Code: [Select]

#if defined(_useTimer1)
SIGNAL (TIMER1_COMPA_vect)
{
  handle_interrupts(_timer1, &TCNT1, &OCR1A);
}
#endif


I would love to get this working because this seems a much better IDE and i have been looking for an Arduino simulator.

Thanks
Gabriel

Graynomad

Question about CodeBlocks, does it grey out or otherwise highlight any non-functional code inside #if and #ifdef blocks ?

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

janleroux

Hi,

I just installed CodeBlocks (Revision 20130402), and I have tried to use it with my Arduino Mega 2560. It builds without any issues, but it gives an "error generating HEX file" message.

I have just created the default "LED on for one second, then off for one second" routine that is included by default when you create a new project. I saw some people asking the same questions before, but I can not see any specific resolution.

Can anyone please give some advice - or is this a known bug in CodeBlocks when using it with say Arduino Mega?

Thanks!

sean_8

How do you use the WIRE.h library with the simulator (ARDUSIM)? Cant find a way of adding libraries to a project.

syydbc

I have a question?
Serial.or::or->  How to automatically prompt members

MarsWarrior

I downloaded CodeBlocks and tried to open a simple test project and compiling it.

But nothing compiles, not even a single example:
- A lot of compiler errors which I could eliminate by setting -fpermissive. But why? Why no problems on Arduino IDE??
- A lot of cannot open/find/missing header file

I tried to add files to the project, but that only results in more compiler errors in the Arduino files (like malloc.c). Some of the header files still can't be found, although I added the complete Arduino libraries folder (recursively) to the project...

So I'm doing something wrong, but can't find any manual to setup codeblocks for the Arduino environment and get a WORKING environment that does compile existing sketches and libraries, just as the Arduino IDE...


Update @8 July:
I downloaded Stanleys ArduinoOBD / obdlogger, and was able to compile that project using Code::Blocks, so at least I know that the intallation of Code::Blocks is ok!
Now if I can find why this project compiles fine, and mine not, I guess I found the problem  :P

I really like Code::Blocks features, so must find a way to compile my own sketches and libraries!

zoomx


Quote

error: cannot convert 'uint8_t* {aka unsigned char*}' to 'volatile uint16_t* {aka volatile short unsigned int*}' for argument '2' to 'void handle_interrupts(timer16_Sequence_t, volatile uint16_t*, volatile uint16_t*)'|



I got the same error today.

damo1023

Hello,

I have exact same problem and didn't find answer.... can anybody help? If I start ArduinoBuilder manually and select file, it works. I guess there is a problem with settings in CodeBlocks? I tried some, but no success.

I've downloaded version  20130704, but when installed, it says ver 12.11 build nov 25 2012 !?

Thanks,

Damo



Hi,

I just installed CodeBlocks (Revision 20130402), and I have tried to use it with my Arduino Mega 2560. It builds without any issues, but it gives an "error generating HEX file" message.

I have just created the default "LED on for one second, then off for one second" routine that is included by default when you create a new project. I saw some people asking the same questions before, but I can not see any specific resolution.

Can anyone please give some advice - or is this a known bug in CodeBlocks when using it with say Arduino Mega?

Thanks!



Go Up