Development Tools
  MCU IDE 4.01 with SDCC

Post New Topic  Post A Reply
profile | register | preferences | faq | search

UBBFriend: Email This Page to Someone! next newest topic | next oldest topic
Author Topic:   MCU IDE 4.01 with SDCC
wss
New Member
posted July 20, 2010 09:46 AM     Click Here to See the Profile for wss     Edit/Delete Message
I use SDCC with the IDE 4.01 with C8051F330. Looks like it picks up C8051F330.h from C:\silabs\MCU\INC\C8051F330.h rather than C:\Program Files\SDCC\include\mcs51\C8051F330.h

It causes problem. I have to rename the one in C:\silabs\MCU\INC to other name in order to solve the problem.

Wandering if anyone has the same problem.

IP: Logged

vanmierlo
Member
posted July 21, 2010 01:27 PM     Click Here to See the Profile for vanmierlo   Click Here to Email vanmierlo     Edit/Delete Message
Under Project / Tool Chain Integration / Compiler you'll find this include directory added to the command line flags. If you don't want it, remove it.

Maarten

IP: Logged

wss
New Member
posted July 21, 2010 10:09 PM     Click Here to See the Profile for wss     Edit/Delete Message
Thanks for pointing out. Did not done enough investigation when I found this strange behaviour deviating from older version. Just realize the reason for it yesterday too.

I feel that the need to turn off that optino manually is troublesome. I have more than 400 students using the tool. If it can be transparent, it would be great.

Wondering why ver 4.01 added this as default. The need to remove this flag every time starting a project is very troublesome.

Also wondering if the header files there could be compiler independent. Notice that there is "c8051f330_defs.h" which would require one to also include "compiler_defs.h".

Why not make "c8051f330.h" same as "c8051f330_defs.h" but with an additional line of "include " at its top to save user to need to do it.

Ops, realize that "c8051f330_defs.h" did not define TI, RI, SBUF but only TI0, RI0, SBUF0 ... My lab experiment uses only TI ... Also realize that "c8051f330_defs.h" has a bit of conflict with the library I give to students as the library was built using "c8051f330h" supplied with SDCC.

I feel that the IDE should not default to have -I"C:\SiLabs\MCU\Inc" in the compiler option. Instead users can always copy necessary files from there when need arises.

My current solution now is to ask students to rename the file in C:\SiLabs\MCU\Inc to a different name like c8051f330orig.h so that things become transparent again.

Thanks for the help.

IP: Logged

wss
New Member
posted July 30, 2010 08:12 PM     Click Here to See the Profile for wss     Edit/Delete Message
Did more experiments....
[By the way, we use C8051F330 because it had a DIP version which is extremely easy to do prototyping on breadboard by students (I believe hobbyist too). Sad that there is now no longer any DIP version of MCU from Silabs.]

I suppose the -I"C:\SiLabs\MCU\Inc" was added to ensure that all newer MCUs header files are picked up.

The linking problem I encountered was due to a error in SDCC header file:
__sbit __at (0xCD) TF2CEN ; /* TMR2CN.5 - TIMER 2 LOW-FREQ OSC CAPTURE ENABLE*/
should be
__sbit __at (0xCC) TF2CEN ; /* TMR2CN.4 - TIMER 2 LOW-FREQ OSC CAPTURE ENABLE*/

This conflicts with the correct definition in "c8051f330_defs.h"
Once changed, there is no problem mixing the use of SDCC "c8051f330.h" and files compiled using
#include
#include

There is an improvement when one creates a new MCU specific C project project.

Older IDE copies c8051f330.h that is Keil C specific to the project folder causing serious problem with SDCC. We had to tell students NOT TO CREATE MCU specific C project to overcome the problem. The new IDE copies only c8051f330_defs.h. It is now "safe" to have "include " with SDCC. However, -I"C:\SiLabs\MCU\Inc" bring back the same problem as it now picks up Keil C specific c8051f330.h from Silab INC folder!

Another problem: We use config wizard a lot. The codes generated has "#include ". The new IDE environment with -I"C:\SiLabs\MCU\Inc" causes it to pickup Keil C header file again !

My conclusion is that the c8051f330.h should contain only these:
// c8051f330.h
// This header file works for different compilers
#include
#include

Now our program can just use "#include ".

IP: Logged

wss
New Member
posted July 30, 2010 08:18 PM     Click Here to See the Profile for wss     Edit/Delete Message
Ops, not sure why portions of the previous post has contents disappeared. Trying to correct it..

..config wizard .. codes .. has "#include "..

.. c8051f330.h should contain only these:
// ..compilers
#include
#include

Now our program can just use "#include ".

IP: Logged

wss
New Member
posted July 30, 2010 08:21 PM     Click Here to See the Profile for wss     Edit/Delete Message
Not sure why the last portion of the previous post has contents disappeared. Trying to correct it..

..config wizard .. codes .. has "#include "..

.. c8051f330.h should contain only these:
// ..compilers
#include
#include

Now our program can just use "#include ".

IP: Logged

wss
New Member
posted July 31, 2010 01:38 AM     Click Here to See the Profile for wss     Edit/Delete Message
This is terrible. Same problem. Sorry for the mess. Looks like the diamond brackets causes problem. I would just remove them.

..config wizard .. codes .. has "#include c8051f330.h"..

.. c8051f330.h should contain only these:
#include compiler_defs.h
#include c8051f330_defs.h

Now our program can just use "#include c8051f330.h".

IP: Logged

vanmierlo
Member
posted July 31, 2010 04:40 AM     Click Here to See the Profile for vanmierlo   Click Here to Email vanmierlo     Edit/Delete Message
The forum treats <anything> as HTML tags. Either replace < with &lt; and > with &gt; or insert some spaces < anything > when posting.

IP: Logged

vanmierlo
Member
posted July 31, 2010 04:48 AM     Click Here to See the Profile for vanmierlo   Click Here to Email vanmierlo     Edit/Delete Message
If you want the IDE, the Config Wizard or the distributed files changed, I suggest to report to SiLabs directly instead of complaining in the user forum as they do not visit it regularly.

If you find a bug in SDCC or its files it's better to report a bug at sourceforge.

IP: Logged

All times are CT (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | MCU User Forum

Have you seen our MCU Knowledge Base?


Ultimate Bulletin Board 5.47b