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

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

RE: [avr-gcc-list] String in flash access in Boot Loader Atmega1280


From: Yannick PODGORSKI
Subject: RE: [avr-gcc-list] String in flash access in Boot Loader Atmega1280
Date: Tue, 25 Sep 2007 12:50:38 +0200

Thanks for your answer.
I'll try to do it but I don't understand why I must create a particular section to access to string.
The pgm_read_byte_far() might do it...
I remember I used it on Atmega128.
Thanks.
 
Best regards,
 
Yannick PODGORSKI.
Kuantic.
 


De : Stu Bell [mailto:address@hidden
Envoyé : lundi 24 septembre 2007 21:34
À : address@hidden; address@hidden
Objet : RE: [avr-gcc-list] String in flash access in Boot Loader Atmega1280

As well as Martin's solution, you might also look at the solution I used for my ATmega2560.  It's posted on the AVRfreaks.net site:
 
    http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=48368&start=0
 
As always, there's moe than one way to do anything. :-)

Best regards,

Stu Bell
DataPlay (DPHI, Inc.)

 


From: address@hidden [mailto:address@hidden On Behalf Of Yannick PODGORSKI
Sent: Monday, September 24, 2007 8:50 AM
To: address@hidden
Subject: [avr-gcc-list] String in flash access in Boot Loader Atmega1280

Hello,
I try to program a boot loader on Atmega1280.
My configuration :
 - linux Fedora Core 7,
 - avr libc 1.4.6,
 - avrdude 5.3.1,
 - avrgcc 4.2.0.
I use the program in application section and there is no problem.
When I try to use it in boot loader section, the program starts but I can't access to string in flash.
I use pgm_read_byte_far().
 
I read in file pgmspace.h :
    \note If possible, put your constant tables in the lower 64 KB and use
    pgm_read_byte_near() or pgm_read_word_near() instead of
    pgm_read_byte_far() or pgm_read_word_far() since it is more efficient that
    way, and you can still use the upper 64K for executable code.
    All functions that are suffixed with a \c _P \e require their
    arguments to be in the lower 64 KB of the flash ROM, as they do
    not use ELPM instructions.  This is normally not a big concern as
    the linker setup arranges any program space constants declared
    using the macros from this header file so they are placed right after
    the interrupt vectors, and in front of any executable code.  However,
    it can become a problem if there are too many of these constants, or
    for bootloaders on devices with more than 64 KB of ROM.
    <em>All these functions will not work in that situation.</em>
 
Does that really mean that I can't use Boot loader in Atmega1280 ?
How can I access to string in flash ?
 
If someone can help.
Thanks for answers.
 
Yannick PODGORSKI.
Kuantic.

reply via email to

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