In the SMALL program source code, you should have FLASH_BUFFER_ADDR = (FLASH_SIZE / 4)
In the LARGE program source code, you should have FLASH_BUFFER_ADDR = (3 * FLASH_SIZE / 4)
Is that what you have?
Which Teensy are you targeting? 3.5 or 3.6?
Now i just want to load my large program to 3.5 from your Flasher3d. FLASH_BUFFER_ADDR - is offset for addressing or availible flash size?
I think it is offset, so i tryed to set
#define FLASH_BUFFER_ADDR (FLASH_SIZE/4)
and got this
8193 :10FFF00022F000BFEBFE0100190002001900020010
8194 :020000022000DC
8195 :1000000015000200150002000D000200F8684042D1
address too large
so the problem is here
if (base_address + address + byte_count > FLASH_BUFFER_ADDR - RESERVE_FLASH) {
Serial.printf("address too large\n");
error = 2;
return -4;
}
I write to Serial FLASH_BUFFER_ADDR - RESERVE_FLASH, it is 131072, that is right (524288/4=131072)
but my lagre program have 18462 strokes x 16 bytes = 295392, so this condition (if (base_address + address + byte_count > FLASH_BUFFER_ADDR - RESERVE_FLASH)) will not be executed.
my research showed, that the condition must be
if (base_address + address + byte_count > FLASH_SIZE - FLASH_BUFFER_ADDR - RESERVE_FLASH) {
Serial.printf("address too large\n");
error = 2;
return -4;
}
now i can successfully load my large program.
Thanks a lot for your work. Now i will update my large program!