avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Stdio and Atmega256X


From: Andy Parkins
Subject: Re: [avr-gcc-list] Stdio and Atmega256X
Date: Thu, 7 Feb 2008 12:51:01 +0000
User-agent: KMail/1.9.7

On Thursday 2008 February 07, Sven Schlender wrote:

> I use printf() and redirect the output to the serial line. I have done it
> in my code like suggested in avr-libc.
> The problem is, that the function which puts the characters on RS232 is
> located in the bootloader (Word-Address 0x1F000).
> The application which uses the printf is located in the application section
> (Word-Adress 0x00000). In the __file structure of stdio is only a 16-Bit
> datatype for saving the function pointers for put and get functions. So if
> I call printf() in application the AVR jumps to the Black Forest.
>
> Do somebody has an idea how to fix this without patching the avr-libc?

Just have an intermediate function that _is_ in the 0000 section?

  void indirect_putch_at_0000(char ch)
  {
    putch_at_1f000(ch);
  }

I would imagine this could be significantly simplified by writing it in 
assembler as a __naked__ function; but you get the idea...


-- 
Dr Andy Parkins, M Eng (hons), MIET
address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]