Hi Loris,
Are you only trying to access the Flash program space?
If yes, then you can do one of the following as you do not need any special flash read function call:
| #define READ8(address) | ((uint8_t)(*(vuint8_t*)(address))) |
| #define READ16(address) | ((uint16_t)(*(vuint16_t*)(address))) |
| #define READ32(address) | ((uint32_t)(*(vuint32_t*)(address))) |
for example, you can use the following code to access flash no matter whether the flash save data or code.
| uint16_t value, i, *pSrc, *pDest; |
pSrc=0xxxxxxxx;
value=READ16(pSrc);
pSrc++;
OR
| | unsigned int *read_flash; |
| | volatile unsigned int temp; |
| | |
| | read_flash = *((unsigned int *)0x0003FFE0); |
| | temp = ((unsigned int *)read_flash); |
Regards,
David