-
Notifications
You must be signed in to change notification settings - Fork 188
Description
I'm planning to use your Optiboot Flasher on the ATmega1284P, but there are a few things I don't understand:
-
I'm not sure what you're referring to by 'buffer' in the documentation in the header of SerialReadWrite.ino. When you say:
Buffer must be page aligned (see declaration of flash_buffer)
There is no flash_buffer in the code. I assume this means the block of flash you're writing to, flashSpace[]?
-
In:
Writing to EEPROM destroys temporary buffer You can write only once into one location of temporary buffer
By 'temporary buffer' do you mean:
uint8_t ramBuffer[SPM_PAGESIZE];
and by EEPROM do you mean flash? Why does it get destroyed by writing it to flash?
-
Why might you want to do fill-erase-write rather than erase-fill-write?
-
Instead of allocating the page(s) of flash in the middle of PROGMEM as you've done here, could I specify an explicit address for flashSpace?
For example, if I understand correctly the bootloader occupies two pages from word addresses 0xFF00 to 0xFFFF. I would like to write to one page of flash just below that, from word addresses 0xFE80 to 0xFEFF. So could I do this?
const *uint8_t flashSpace PROGMEM = 0xFE80;
-
Is it essential to use a RAM buffer, ramBuffer[256], or if I'm short of RAM could I write the data to flash byte by byte, treating it more like an SD card? I realise I would have to provide my own alternative to optiboot_writePage().
-
Finally, I'm puzzled by the code in optiboot_readPage() in optiboot.h:
if(read_character != 0 && read_character != 255) storage_array[j] = read_character;
Why is it skipping bytes if they are 0 or 255?
Sorry about the flood of questions!