boot sector on ATmega128
Posted: Tue Dec 02, 2008 5:10 pm
The latest version (20081126) doesn't work from the boot sector in ATmega128 and probably other devices when the code needs to read from Flash at >64k. As a workaround, I modified usbportability.h to use far reads (ELPM instead of LPM), but it's not elegant, as non-boot code should use the faster near reads (LPM).
Code: Select all
#if defined (__AVR_ATmega128__)
#define USB_READ_FLASH(addr) pgm_read_byte_far(addr)
#else
#define USB_READ_FLASH(addr) pgm_read_byte(addr)
#endif