In cores/Arduino.h
and cores/Print.cpp
, pgm_read_byte()
and pgm_read_word()
are used to access program memory. This is fine as long as the memory being accessed is in the first 64KBytes of flash. However, those operations fail if this is not the case.
I encountered this issue when using the core library in a bootloader that was relocated past 64KBytes. Using pgm_read_byte_far()
and pgm_read_word_far()
fixed the issue.