Compiler options in Arduino

I've had some memory problems in a couple of applications I do with Arduino. Trying to solve these problems I've seen that in Arduino environment it is not possible to specify compiler flags (they are "hardwired" in the java source code).

I was wondering if it would it be too complicated to allow the Arduino user to specify its own compiler flags. I mean, it would be nice if the user could specify those flags in the preferences window, for example, or in the preferences file, or wherever. That way, we could use -Map options to see the RAM already allocated (although not enough to see if a program gets out of RAM, it would help), or change optimizatoin options from size (-Os) to speed (-O2 or whatever), or whichever other flag an experienced user could need. On the other hand, it would be something hidden for the non-experienced user, so the "easiness" of the environment wouldn´t change.

Thanks

If you go the Gui-less route you can use the Makefile to build and upload your sketches. You can also edit the Makefile to your heart's content.
http://www.arduino.cc/en/Hacking/CommandLine (but get the 10 release instead).

I'm an avid emacs user and C programmer and this approach works fantastically well for me.

Charlieb

Of course you can use the GUI-less route. In my case, I don't use emacs, but normally gvim (not the same, but enough), and it is also posible to make the sketch within the editor. But if I work in other PC where I have not vim nor emacs installed, then I have to install Arduino and emacs/vim, or if I want to explain my students how this stuff works, then I have to explain them more things, or if I don't want to do any set-up and start working quickly... well, I think there could be many reasons to stay within Arduino.

I think the success of the Arduino platform (both hardware and software) is mainly based on its simplicity; almost Plug&Program. You go with your Arduino in your pocket, an USB cable, and a connection to Internet (or the Arduino soft in a pendrive) and that's all you need. Of course, we can use more sofisticated tools like AVR Studio, IAR, development kits, emacs, etc... and you should better use them instead of Arduino if you are developing a minimally complex application (I mean, if you need debugging), but still I find Arduino is better suited for simple applications and of course for non experienced users.

I think that including the compiler flags in the preferences file wouldn't be difficult, and could help to people that, like me, don't want to jump to more complex environments if the application doesn't require it.

Yanque

I agree. This is something I'm planning to add, though I'm not quite sure when. It would also give people the ability, for example, to link in the floating point printf routine, and other useful things. And it will give us a way to see what abilities people need, which could then end up available in the IDE without needing to mess with the preferences file.

Right, yes, that is a very good suggestion for added gui functionality I was trying to help solve your immediate problem. I wouldn't like to have to introcude beginngers to emacs/vim, Makefiles, electronics and programming all at once either :wink:

I was trying to help solve your immediate problem.

Thanks Charlieb :smiley: