I want to write some data into a specific, not used by code, area of flash.
I'm using the functions included in the LpcOpen library v2.20, Chip_IAP_PreSectorForReadWrite, Chip_IAP_EraseSector and Chip_IAP_CopyRamToFlash.
I can prepare and erase sectors, but when copying data into flash it always returns 2 and data is not written (checked that)
Yes, I have interrupts disabled
I'm working on LPC 1519
The offending line is:
while( 0 != Chip_IAP_CopyRamToFlash((uint32_t)0x00020000, (uint32_t *)UpBuffer, 0x400) );
And UpBuffer is (for test purposes) defined and set up as:
static uint8_t UpBuffer[1024];
for(j=0; j<0x400; j++) UpBuffer[j] = (uint8_t)j;
Any ideas?
Solved! Go to Solution.
Solved... The return code was '2'. I read somewhere that this means busy but it's 'Source Address not in word boundary'
My source address was, unfortunately, an int8 array re-cast as int32.
After using a proper int32 array, everything is fine.
Solved... The return code was '2'. I read somewhere that this means busy but it's 'Source Address not in word boundary'
My source address was, unfortunately, an int8 array re-cast as int32.
After using a proper int32 array, everything is fine.