avr-chat
[Top][All Lists]
Advanced

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

RE: [avr-chat] BOOTLOADER on ATMega644


From: Weddington, Eric
Subject: RE: [avr-chat] BOOTLOADER on ATMega644
Date: Mon, 22 Dec 2008 06:57:06 -0700

 

> -----Original Message-----
> From: address@hidden 
> [mailto:address@hidden
>  On Behalf Of Robert von Knobloch
> Sent: Monday, December 22, 2008 2:56 AM
> To: address@hidden
> Subject: [avr-chat] BOOTLOADER on ATMega644
> 
> 
> 
> A second issue (to do with compiler features) is the following:
> 
> I am aware that the compiler has problems with Harvard 
> architecture and
> note that the storage of objects in the flash memory has somewhat
> limited support.
> 
> I wish to be able to create an array of un-initialised, but 
> dimensioned
> structs in the flash, which I can later fill out by writing 
> (page-wise)
> into them.
> 
> The values for the objects would be loaded from a host PC by 
> means of a
> menu-driven interface in the Mega644, communication over RS232 to a
> terminal program (minicom) on the PC.
> 
> The structs would be approximately as follows:
> 
> struct Tiny13 {
> char title[] = "Tiny13 project #1";
> uint8_t flash[1024];
> unsigned int flashsize;   // actual flash used
> uint8_t eeprom[64];
> uint8_t fuses[2];
> uint8_t signature[3];
> uint8_t pagesize[16];
> uint8_t numpages[32];
> } tiny13projects[4];
> 
> and a similar struct array for Tiny24 projects.
> 
> Ideally, as shown, a mix of dimensioned and initialised members, but
> just dimensioned would also be ok.
> 
> Has anyone any thoughts how I could approach this ?
> 

How often do you expext to write this in the flash area? According to the 
datasheet, the flash memory has a limited number of writes.

- Find a fixed address in flash where you expect to write this, and the 
application know where to read from.
- Your bootloader could would have to accept the data and write the data to 
flash
- In your application, you could read this block of data using the memcpy_P() 
function found in <avr/pgmspace.h>. See the avr-libc user manual for details.




reply via email to

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