17 December 2006

Eclipse for SDCC

Although I use MIDE-51 as a major IDE, I still seek for the best (free) IDE for developing Microcontroller Programming. The combination of Eclipse, CDT and SDCC is an alternation tools for 8051 Microcontroller C Programming.

Eclipse is an open source community whose projects are focused on building an open development platform comprised of extensible frameworks, tools and runtimes for building, deploying and managing software across the lifecycle. Eclipse is used for Enterprise Development, Embedded and Device Development, Rich Client Platform, Application Frameworks and Language IDE.

The CDT is Eclipse's C/C++ Development Tooling project. It is an industrial strength C/C++ IDE that also serves as a platform for others to provide value added tooling for C/C++ developers.

The eclipseSDCC project aims to provide full support for the open source Small Device C Compiler (SDCC) from within the eclipse/CDT development environment. This allows embedded 'C' applications for 8051 and Z80 devices to be developed using the fully featured eclipse IDE. EclipseSDCC supports CDT managed make projects. In managed make projects CDT manages the build process by creating and maintaining the underlaying makefiles. CDT keeps track of source dependencies and can automatically rebuild the target when needed.

To install (for Windows)

  1. It requires Java Runtime Environment (JRE), I download only JRE not SDK and install it.
  2. Downlaod Eclipse SDK 3.2.1 for Windows (120 MB) and extract it to c:/eclipse. In the directory it contains eclipse.exe which is an executable.
  3. Download CDT 3.1.1 (September 29, 2006) and extract it c:/eclipse, this will prompt to replace plugins and features directory.
  4. If you have already installed SDCC for Window, skip this step. If you have no SDCC installed, read this first.
  5. Download eclipseSDCC-1.0.0, when you extract the file, it contains plugins and features directory. Copy the two direct to c:\eclipse.
Now the installation have been completed and you can find its manual in c:/eclipse/plugins/net.sourceforge.eclipsesdcc_1.0.0/help/index.html.

Eclipse for SDCC is quite large when compared it MIDE-51. However, you can manage project in Eclipse whereas MIDE-51 still have no this feature in the present version. Here is a screen shot, you should see this dialog.

Related Links

23 comments:

Anonymous said...

Can i know what the limitation code generate by SDCC??? If i'm using KEIL its only 2K byte...

MCU Programmer said...

SDCC is free and opensource C Compiler under GPL license with no limitation of code size. You can compile the code as large as your hardware supported.

Anonymous said...

Thank you... i will try to migrate to sdcc...

Anonymous said...

One more thing... after the compilation... i was get the hex or ihx is bigger than if i'm using keil... any comment to avoiding generate the large file?

MCU Programmer said...

Yes! SDCC is not better than Keil. Everyone have complained about this. But personal reason: sdcc is suitable for student with limit of budget or a hobbyist.

Anonymous said...

OoOOOO... Thank you...

Pragmatic said...

is there any graphical simulator open source as keil? can i integrat it with eclipse?
thank you for very nice post

MCU Programmer said...

As I know, there are no graphical simulator which can be integrated to eclipse. However, there are free stand-alone graphical simulators (for 8051): Jsim-51 and edSim-51

They are pretty good for a freeware. If you are interested, please follow the link.

Pragmatic said...

frist thank you very much for very nice blog .
can i ask: if sdcc reliable for commercial application ?

MCU Programmer said...

SDCC is licensed under GNU GENERAL PUBLIC LICENSE Version 2, June 1991. It is the copyleft that only applies to the software and not to its output (unless that output is itself a derivative work of the program). In this case, you can sell .hex files or your code which can be compiled by SDCC, but you can not sell SDCC itself. See here, for reference.

Pragmatic said...

ok i know what you say thank you very much :).

but i ask another question :
i want to develop code for products using sdcc can i trust sdcc in this mission ?

MCU Programmer said...

Although I encourage people to use freeware, sdcc can not guarantee the successful. The resource about sdcc is rare. My suggestion is using commercial complier like Keil C. They have many online supports. By using sdcc, you can also fulfill your mission but you must work hard. If you are strong in ANSI-C programming, using sdcc will be efficient for your work and reduce your budget.

Unknown said...

Hi All !

I´m work with any types of uC´s and would like to use SDCC to integrate many programs into one IDE.
After install the Eclipse-SDCC, I can work with MCS51 only.
This is my question: what about the PIC and HC908 ?
Can I configure the Eclipse-SDCC to work with these uC´s ?

MCU Programmer said...

Hi Cicero,

I also have never tried Eclipse-SDCC on PIC and HC908. However, if SDCC supports PIC and HC908, Eclipse-SDCC doesn't matter. You can write the code for PIC and HC908. Eclipse works as an IDE, not compiler.

Anonymous said...

just try this one: Code::Blocks

http://www.codeblocks.org/

Mihir said...

G'day,

I have tried to install SDCC plugin for eclipse as guided on the page. it doesn't seems to work.

I have installed Eclipse Europa edition.

Thanks

MCU Programmer said...

Hi Mihir

Thanks for visiting. Could please describe more about why it doesn't work?

Audrey said...

I am trying to run this setup on Windows Vista and sh.exe keeps terminating abnormally. This is the shell in the eclipse SDCC plug-in. I can get this shell to be stable by setting all of running options to minimal - including 256 colors and 640x480 resolution, but my computer spends so much time switching resolutions that making in Eclipse is ridiculous. Any ideas?

MCU Programmer said...

Hello Audrey,

I've never tested on Vista before. I think the problem may be due to visual element in Vista. You may try to change Appearance Settings->Color scheme to Windows Vista Basic.

Anonymous said...

Hi
how can i use RTOs code with this eclipse SDCC?

Mihir said...

Follow up - 12/06/2007 2:29 PM

I am now seriously thinking of switching over to eclipse with SDCC integration.

Basically my problem last time was when i restarted eclipse after changes (extracting the plugins and features) and created a new project as specified under c project, i did not see the MCS51 as one of the option under the Project type.

do you have any idea on this line? what should i need to do to ?

Thanks,

-Mihir Patel.

I have got the SDCC installed and can compile the files (i am just lacking the GUI which eclipse can provide )

Mihir said...

Follow up : 5/29/2009 1:31 PM

Got that working after looking at the XML files and bit of investigation.

My Platform : Winxp
Eclipse : 3.4
CDT : 5

Basically you need to install the eclipseSDCC plugin from the help> software updates from eclipse.

for some strange reason it downloads the files for the plugin file/folder but does not download the files/ folders for the features.

when downloaded the plugin and extracted them in the features folder i can see the MCS51 options and it works just fine and compiles the hex without a problem.

I have learned a bit from the exercise. So, in case if you have problem. don't hesitate to post it. I will get back as soon as i can.

Thanks,
- Mihir Patel.

(I need to do the same under Ubuntu 9.04 s i am moving totally to linux now... free and open source is the way to go)

GJ said...

To integrate SDCC with Eclipse in ubuntu! Download the plugin eclipseSDCC and extract it, So you will get folders "features" & "plugins". copy the folders to /usr/lib/eclipse/features & ~/plugins!
Once you open your eclipse to create C project will get a option of SDCC toolchain... Its done!