CodeBlocks Arduino IDE - real C++ IDE for Arduino development (rev.20130827)

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

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!

Did you choose the board type?

Stanley, board is selected properly in Codeblocks and in Arduino builder (mega2560).

It works ok, if I compile, build in Codeblocks and then manually start Arudino builder, choose hex file manually and upload.

I guess something is wrong in codeblocks porting to arduino builder, but all is original settings, I tried some alterations, but no success, then I owerwrite it with original.

Damo

So error only occurs when you use Arduino Builder manually?
I recommend downloading a complete Arduino Builder if you want to use it manually.
http://www.downloadbestsoft.com/Arduino-Builder.html

No, when I use it manually it works ok.

When it is called from codeblocks error happens.

Hello,

me again :). Stupid windows 7, I think from XP they are getting worse and worse.

I solved the problem - project shouldn't be in the c:\users folder!

Ok, and how do you recompile-rebuild so that the hack starts to work?

TIA,

Fernando.

stanleyhuang:
Actully my long-term goal is to implement a simulator which acts like a http server and use HTML to render the simulation.
About hacking into arduino core files, taking digitalWrite as an example, I just added one line at the end like this:

void digitalWrite(uint8_t pin, uint8_t val)

{
uint8_t timer = digitalPinToTimer(pin);
uint8_t bit = digitalPinToBitMask(pin);
uint8_t port = digitalPinToPort(pin);
volatile uint8_t *out;

if (port == NOT_A_PIN) return;

// If the pin that support PWM output, we need to turn it off
// before doing a digital write.
if (timer != NOT_ON_TIMER) turnOffPWM(timer);

out = portOutputRegister(port);

uint8_t oldSREG = SREG;
cli();

if (val == LOW) {
	*out &= ~bit;
} else {
	*out |= bit;
}

SREG = oldSREG;

#ifdef ARDUSIM
    fprintf(stderr, "[MCU] Pin %d state changed to %s\n", pin, val ? "HIGH" : "LOW");
#endif
}





> tianshuo:
> I see them alright, but I'm not sure where should I start from. I guess maybe the simulator could listen to a port for signals?
> Could someone give an example using wiring_analog.c?

The simulation code is in the core files (a different version). There is no need to rebuild. It is built and linked with sketch.

@stanleyhuang:

Hmmm... if this is a reply to my question, maybe I didn't ask it in the right way. I was asking about your suggestion for hacking the simulator by using code inside

#ifdef ARDUSIM
...
...
#endif

which actually I did. However, when I open the ardusim.cbp with the Code::Blocks you provide I obtain a lot of errors (I could send the compiler-linker report, just ask). I've finally got to simulate a digital pin input from file, but doing some extra-hacking stuff, which I prefer not to send, since I think I'm doing something wrong with ardusim.cbp and I would like to fix it.

TIA,

Fernando.

stanleyhuang:
The simulation code is in the core files (a different version). There is no need to rebuild. It is built and linked with sketch.

Newbie here...testing driving the Arduino CB IDE...how does one send a command/message via the Arduino Builder serial interface??? I can upload the sketch successfully, and can open a serial port at the desired baudrate, but how do I send a command to the Arduino??? Serial.print()?
I am working on a exercise where you instruct RGB LED's to turn on to a set level....using the serial interface in Arduino IDE I can successfully change the LEDs but at a sticking point via the CB Arduino IDE...thanks.

Stan -

Great work on the Code::Blocks for Arduino. I had some difficulty getting the software to work on Windows 7 at first, however I was able to find a work around. Here is was my original problem. When I try to do a "build and run" from Code::Blocks for the blink example, the Arduino Builder pops up. Afterwards, I click COM3 but it gives me the following message: "Error generating HEX file."

My alternative solution was this. I did a "build" only using the blink example. Afterwards, I open the Arduino Builder, click Load Sketch / HEX and then click COM3. This solution worked. Although this solution is a bit slower, it still works. Do you have any suggestions/ideas why the build and run is not working from the Code::Blocks IDE?

On another note, I am attempting to get the CB for Arduino to work on Ubuntu 12. No luck so far but I will let you know if I have anymore luck.

Ok, pretend I'm new at this.
I downloaded the file CodeBlocks-Arduino-20130827.7z now what do I do with it? It's not an a Plugin, but it's not going to install it's self either. I see people taking about having just installed it. I though it would be a plugin for CodeBlocks... Help, I want in on the fun

Am I just getting to the wrong file?

.

Hi chj_sullivan,

The ".7z" extension on the file name means it has been compressed with 7-Zip. You will need to locate, download, and install 7-Zip in order to decompress the file. What to do next depends on what you get after the decompression. If it is only a couple files, one having a ".exe" extension, then it has an installer. Just run the file with that extension and a wizard will guide you through the process. If instead you end up with hundreds of files in a dozen or more directories folders, then this is the actual program, and you just need to move it to a convenient location where you have read/write access. I don't remember which it is as it was a while ago that I tried it. I should also mention that this is a complete Code::Blocks package, not just a plug-in. Hope this helps.

microcat:
Hi chj_sullivan,

The ".7z" extension on the file name means it has been compressed with 7-Zip. You will need to locate, download, and install 7-Zip in order to decompress the file. What to do next depends on what you get after the decompression. If it is only a couple files, one having a ".exe" extension, then it has an installer. Just run the file with that extension and a wizard will guide you through the process. If instead you end up with hundreds of files in a dozen or more directories folders, then this is the actual program, and you just need to move it to a convenient location where you have read/write access. I don't remember which it is as it was a while ago that I tried it. I should also mention that this is a complete Code::Blocks package, not just a plug-in. Hope this helps.

microcat,

Thank you!! 8) Been using C::B for school. Taking beginners C as par of my freshman classes, and to improve my projects, most of the class uses MSVS, C::B is much smoother and easier to use. When I saw Stanley's offering I was stoked!! Best of both worlds. Embarrassed about the .7z thing though. Doh!
Now to see if I can use my FTDI Basic..... :cold_sweat:

rsk22:
Stan -

Great work on the Code::Blocks for Arduino. I had some difficulty getting the software to work on Windows 7 at first, however I was able to find a work around. Here is was my original problem. When I try to do a "build and run" from Code::Blocks for the blink example, the Arduino Builder pops up. Afterwards, I click COM3 but it gives me the following message: "Error generating HEX file."

I had the same issue and I found the cause was the file path.
I had a "-" in the path and when I removed it, the problem was solved.
"space" in the path is also a error generator.

Original path : C:\DEV_ELEC\Paul - Arduino\Programme_test\V2 - fonctionnel
=> error hex
Fixed path : C:\DEV_ELEC\Paul\Programme_test\V2_fonctionnel
=> Works

Hope my message is understandable
Paul

I remember I have fixed a similar issue in the latest version. Which version are you using?

stanleyhuang:
I remember I have fixed a similar issue in the latest version. Which version are you using?

20130827, the last one according to Sourceforge.

But I work on two computers and only one of them has the problem.

is it possible to add Arduino compatible boards to the IDE build target?

like this one e-Gizmo Technical Blog: Patch Files to Add gizDuino in Arduino IDE Board List Menu (Updated October 1,2016)
a patch file to be copied in the Arduino IDE installation folder that will add compatible boards and appear to the Arduino IDE>Board list

Hi:

Pretty noob here.

I am having a problem uploading the sketch to the Arduino. I compile in C:B, start the Arduino builder, select the com port and the builder does it's thing. The last line in the window is "error linking objects" and the error message I get when it tries to send is "upload not successful, error code -5"

The only libraries I am using is Arduino.h and AFMotor.h, and the sketch compiles with no errors/warnings in C:B.

I am using Code:Blocks for Arduino, version 12.11. I am using Arduino builder v0.8.6 on Windows 8.

It's obviously looking for something that it's not finding, but I don't know what. Any help would be appreciated.

Thanks!
Scott

stanley-

Great project, great idea! The Arduino IDE is lacking in several aspects, I'm not a fan. However for my current project I am building a custom board, so I need the ability to define this board (in the typical Arduino way), then have it appear in the menu selection list so that I can download sketches to it. Is there any consideration to implementing such a feature?

Thanks!