I had a big array of data that is stored in PROGMEM that is currently a u32. My project needs have expanded and I need to convert the array to u64. I have converted it already, but I cannot figure out how to read 64 bit values from it. In the previous version, I was using pgm_read_dword(). I cannot find a similar function to read 64 bit array entries. I thought I could read two 32 bit entries reading pgm_read_dword(index) and pgm_read_dword(index + 4 bytes), but I always just get the first 32 bits from the next array entry, rather than the last 32 bits of the 64 bit entry at index. Is there a way to get u64 data from the PROGMEM?
memcpy_P is fine, but I thought I'd mention that this is probably a classic "integer promotion" issue. If you have code that looks like:
uint64_t result = (pgm_read_dword(index+4)<<32) + pgm_read_dword(index);
then the two values on the right are both uint32, and the shift and add will be done with 32bit arithmetic. (Making x<<32 zero, since all the bits are shifted out.)
You should be able to do something like:
uint64_t result = ( ((uint64_t)pgm_read_dword(index+4)) <<32) + pgm_read_dword(index);