Tool/software: TI-RTOS
If I define and initialize sectorbytes as:
uint8_t sectorbytes[4096] = {0};
Then in a buttonpresshandler function I have this code:
switch (pState->pinId)
{
case Board_BUTTON0:
if (pState->state) // Only do once per button press
{
if (OADTarget_open())
{
OADTarget_eraseFlash(1);
OADTarget_readFlash(1, 0, sectorbytes, 4096);
}
OADTarget_close();
Log_info1("%s", (IArg)"Erase and Read of sector 1");
}
ButtonService_SetParameter(BS_BUTTON0_ID,
sizeof(pState->state),
&pState->state);
break;
...
If I size sectorbytes as 3073 or greater, when the button is pressed, sectorbytes is set to 3072 0x00's and the rest 0xFF's
If I size sectorbytes as 3072 or less the resulting sectorbytes is all 0xFF's
My understanding of the MX25R8035F flash and of OADTarget_eraseFlash is that it erases one whole 4k sector at a time, so any read of an erased sector up to 4096 bytes should return all 0xFF's.
What is happening here or is there a better forum for this?
Thanks,
Dale
