Hi.
At programming ATMEGA2561 Flash up to 127,9 kb all OK.
If it is more 127,9 kb the program in the controller does not work.
It is a problem AVR-Doper?
Thanks.
AVR-Doper problems prog ATMEGA2561
AVR-Doper is not compatible with devices larger than 128 kB. The ISP protocol we have implemented only supports 16 bit word addresses.
If you know how to extend this protocol, please provide a patch. See the file isp.c in AVR-Doper's firmware source code and search for "stkAddress". This yields all places where the device address is accessed. These should be extended to more than 16 bits where applicable.
If you know how to extend this protocol, please provide a patch. See the file isp.c in AVR-Doper's firmware source code and search for "stkAddress". This yields all places where the device address is accessed. These should be extended to more than 16 bits where applicable.
Well, I've found the declaration of stkAddress
What should I change here to solve the problem?
Code: Select all
typedef union{
unsigned long dword;
uchar bytes[4];
}utilDword_t;
What should I change here to solve the problem?
In avr068.pdf there is a note about address:
"If bit 31 is set, this indicates that the following read/write operation will be performed on a memory that is larger than 64KBytes. This is an indication to STK500 that to load extended address must be executed. "
For mega2561 that ISP command is 4D 00 addr 00.
So, I think, at the beginning of "ispReadMemory" or "ispProgramMemory" it is needed to insert something like this:
if (stkAddress.bytes[3] & 0x80) {
cmdBuffer[0] = 0x4d;
cmdBuffer[1] = 0x00;
cmdBuffer[2] = stkAddress.bytes[2];
cmdBuffer[3] = 0x00;
ispBlockTransfer(cmdBuffer, 4);
}
"If bit 31 is set, this indicates that the following read/write operation will be performed on a memory that is larger than 64KBytes. This is an indication to STK500 that to load extended address must be executed. "
For mega2561 that ISP command is 4D 00 addr 00.
So, I think, at the beginning of "ispReadMemory" or "ispProgramMemory" it is needed to insert something like this:
if (stkAddress.bytes[3] & 0x80) {
cmdBuffer[0] = 0x4d;
cmdBuffer[1] = 0x00;
cmdBuffer[2] = stkAddress.bytes[2];
cmdBuffer[3] = 0x00;
ispBlockTransfer(cmdBuffer, 4);
}