Using templates in a library (SOLVED)

Not 100% sure about what's wrong here, but this line in read()

 *pStore++ = (TYPE)(*pMemory);

looks suspicious to me.
You are "reconstructing" the type byte-by-byte, so you don't want to cast the bytes you read from the external memory to the full type.

Also, I noticed in write() you don't increase pData. I suspect you're writing only the first byte of "data".

Finally (this might be harmless):

const uint8_t *pData = (const uint8_t *)(const void *)&data;

Why a double cast ?

Disclaimer: I could have misunderstood your code... :stuck_out_tongue: