Re: sdcc/PIC howto, first draft is up

David McNab <[email protected]>
Newsgroups gmane.comp.hardware.microcontrollers.gnupic
Message-ID <[email protected]>
Peter Onion wrote:
>>I think that having section 4.3 "I had to do it my way" section is not a
>>good idea.

I tried your approach. It worked ok for the simplest programs which
print to tty and blink the led.

(Note that I manually had to manually copy libio18f452.lib from the sdcc
source tree to the install lib dir, because that file was omitted by
'make install'.)

I then tried it on my LCDtest program, and it went off the rails. Same
for a simple program that calls printf with 6 arguments.

However, building those exact same sources using my modified crt0 and
linker script, and according to the instructions posted gave me reliable
running programs.

Until the sdcc devs and/or users more clueful than myself fix that
aspect of the toolchain and doco, I'll stand by the instructions I have
posted.

If any sdcc devs want a copy of the crashing program, please contact me
off-list and I'll send you a copy.


>>The instructions should be generic with any variations given
>>later.    I don't need the modified crt0 and as a consequence your
>>istructions have left me high-and-dry.

> Right I've been working on this and here's what I've found....
> With one simple modification your "helloled.c" code can be compiled and
> linked without the need for a custom makefile or modified crt0 or linker
> script.
> 
> The addition is "#pragma stack 0x200,64"
> 
> With that added "sdcc -V -mpic16 -p18f452 helloled.c" is all that is
> needed to produce a helloled.hex.  I havn't got my programmer working
> with 18F devices yet, but the compiled code "does the right thing" when
> run with gpsim.
> 
> I think it is better to document the simplest case first and include any
> variations in the following sections of the document. 
> 
> Peter 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
> 
> 

-- 
Cheers
David
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.