I'm currently working on storing some data into flash on the K60D without FlexNVM, and I was hoping to get a clarification of the documentation for the FLASH1_Erase parameter. The documentation in Processor Expert 10.4 states:
Breaking down into code, I notice that it will attempt to re-issue a sector erase if the size is greater than 4. In otherwords, If I made the following call:
FLASH1_Erase(FLASH1_DeviceDriver, SOME_ADDRESS, BLOCK1_ERASABLE_UNIT_SIZE);
On my setup, I then get a read collision error/read while write error (RWW) which confuses me as the code calling the erase is definitely safe and called with interrupts disabled. Any help would be greatly appreciated.
Solved! Go to Solution.
Hi overdamped,
The LDD_DLASH_TDataSize has units of sectors. You figure out how many sectors you need to erase and enter that number of sectors in bytes. I tested this on a TWR-K70F120M using MQX4.1.1 and the PE FLASH_LDD Component.
When I wanted to erase 2 sectors I enter in a size of 2*0x1000 since a sector is 0x1000 in size.
Regards,
David
Hello,
Thank you for reporting of this issue. We would like to analyze the problem but we need to know what Processor Expert product are you using and we need you project (project settings, memory map setting and the source code).
I suppose that you are using the Processor Expert Driver Suite 10.4. Could you provide us you application for the issue analysis, please?
Best Regards,
Marek Neuzil
I fixed the problem. Erase was trying to erase the same block that some interrupt code was executing in. I guess my remaining question is what does size in the Flash1_Erase mean? Is it sector size? Byte size?
Hi overdamped,
The LDD_DLASH_TDataSize has units of sectors. You figure out how many sectors you need to erase and enter that number of sectors in bytes. I tested this on a TWR-K70F120M using MQX4.1.1 and the PE FLASH_LDD Component.
When I wanted to erase 2 sectors I enter in a size of 2*0x1000 since a sector is 0x1000 in size.
Regards,
David
Thank you !