Kerry
I had the same issue with IAR or GCC (on MIMXRT1010-EVK).
After some experimentation I found that I could overcome the problem on the i.MX RT 1011 by adding
extern void *uMemcpy(void *ptrTo, const void *ptrFrom, size_t Size)
{
void *buffer = ptrTo;
unsigned char *ptr1 = (unsigned char *)ptrTo;
unsigned char *ptr2 = (unsigned char *)ptrFrom;
while (Size-- != 0) {
#if defined iMX_RT1011
*ptr1++ = fnSynchronisedByteRead(ptr2++);
#else
*ptr1++ = *ptr2++;
#endif
}
return buffer;
}
synchronisation after each read access.
unsigned char fnSynchronisedByteRead(unsigned char *ptrByte)
{
unsigned char Value = *ptrByte;
__DMB()
__DSB();
return Value;
}
I don't need this when using the same code on any other i.MX RT parts.
Also I don't know whether it is the data or instruction synchronisationn that allows it to operate (I didn't experiment yet) but with these the operation has been fully reliable (and without it fails).
The workaround is acceptable for me for the moment.
Regards
Mark