Hi chulsung and all :)
Humm, from your last message I have some questions
to have global view of problem...
On Keil (or other compiler and linker software)
there is certainly a Makefile (eg makefile.mak under Tasking chain)
Could you send your Makefile under Keil and under
SDCC (I recently migrate a project from Tasking to SDCC and the Makefiles
comparison is a good work for looking all compiler and linker options
About an another mail from this ML : I'm
interresting how do you compare your size code too ! (size of the .hex file
(not the good method) or map-memory after linking (good method to view the whole
If your code space passed from 10KB to 3KB with
SDCC (and stay at 5KB with Keil) what is your problem today ?
Personally my compil options are the follows :
# SDCCCFLAGS : (CFLAGS)
# -Wa : Warning All
-c : compil only (last option)
# -mmcs51 : cible type x51 << I work
under x51 heart microprocessor
# $(MODEL_PROJECT) --model-large : model large
<< my model
# -I$(INCLUDE_DIR) : directory headers ...
CFLAGS = -Wa -mmcs51 $(MODEL_PROJECT)
And my linker options are :
# Code Addr and size
CODE_ADDR = --code-loc
CODE_SIZE = --code-size 0x7FFC
LINK_CODE_OPT = $(CODE_ADDR)
# RAM Addr and size
DIRECT_RAM_ADDR = --data-loc
INDIRECT_RAM_ADR = --idata-loc 0x80
RAM_SIZE = --iram-size
LINK_RAM_OPT = $(DIRECT_RAM_ADDR) $(INDIRECT_RAM_ADR) $(RAM_SIZE)
External RAM Addr and size (on chip with EXTRAM = 0) (start at 0x0001 to avoid
NULL pointer tests on libs)
XRAM_ADDR = --xram-loc 0x0001
LINK_XRAM_OPT = $(XRAM_ADDR) $(XRAM_SIZE)
# Stack Addr
#STACK_ADDR= // Not specified
STACK_SIZE = --stack-size 80
# ouput format => Intel HEX
OUTPUT_FORMAT = --out-fmt-ihx
LDFLAGS = $(MODEL_PROJECT) $(OUTPUT_FORMAT)
$(DEBUG_OPT) $(LINK_CODE_OPT) $(LINK_RAM_OPT) $(LINK_XRAM_OPT) $(STACK_OPT)
I thinks It's a generaly Makefile's options
template (options can be change for adapting to target user)
I hope my message will give you some
> I feel obliged to report something to appreciate your
help and answer
> Vincent's questions.
> 1. What I am
> I am using a nRF24E1 (from www.nvlsi.com) microcontroller +
> We developed very tiny wireless sensor node using this
> For more details about our hardware, please refer to my
> I used the Keil compiler but I wanted to make use of SDCC for this
> 2. Keil compiler.
> the code size of the hex
file was 5KB. For compiler and linker options,
> at first I used
"Default". I made a change to (smallest code size) and
the code size wasn't really changed.
> 3. SDCC
the compile option (--model-small --opt-code-size), the code size
> than 10KB. But with these option it reduced to 3KB, which is
> what i get
> from Keil. One thing is that once I used
above compiler options, even though
> I don't
> type the options
again, SDCC still generate the hex code, which size is 3K.
> Do you guys
think I made some mistakes? To see what happened, I will
> and reinstall it. Any ideas about my observation?
That's all. Thank you again for your help.
> -----Original Message-----
> From: firstname.lastname@example.org
> [mailto:email@example.com] On Behalf Of BRACH
> Sent: Friday, October 07, 2005 12:33 AM
> To: firstname.lastname@example.org
> Subject: Re: [Sdcc-user] Code Size
> chulsung, what's your compiler and linker options ? (for
Keil and SDCC ;))
> Did you use some optimisations options
> > Hello,
> > I compiled the same source code using both SDCC and Keil.
> But the code size (hex file) of SDCC is twice or three times bigger
> > than that of Keil.
> > Does anybody have a
idea about how to reduce the code size?
> > Thank you in
> > chulsung