Tool/software: Code Composer Studio
Hi,
I made a PCB with CC2640R2F and MX25R8035F Flash ( the same used on the Texas demo board). I have 4 samples, and I tested my code on everyone (erase flash, write flash, read flash), and all is ok at first.
But after a few dozen of erase, write, read, one sample doesn't work.
I use the functions in ExtFlash.h script.
When I run the ExtFlash_test all is ok, but when I run for example ExtFlash_erase the execution code is blocked.
In particular, the ExtFlash_erase function recall ExtFlash_waitReady:
static int ExtFlash_waitReady(void)
{
const uint8_t wbuf[1] = { BLS_CODE_READ_STATUS };
int ret;
/* Throw away all garbage */
extFlashSelect();
Spi_flash();
extFlashDeselect();
for (;;)
{
uint8_t buf;
extFlashSelect();
Spi_write(wbuf, sizeof(wbuf));
ret = Spi_read(&buf,sizeof(buf));
extFlashDeselect();
if (ret)
{
/* Error */
return -2;
}
if (!(buf & BLS_STATUS_BIT_BUSY))
{
/* Now ready */
break;
}
}
return 0;
}
I noticed that the execution go in if (!(buf & BLS_STATUS_BIT_BUSY)) but don't return to ExtFlash_erase function.
Can you help me?
I heve use the ExtFlash_erase(0, 1048575) to erase all flash a few dozen times. Can this damaged the flash?
Thanks.
Best regards.
Giuseppe