Hello RadekS,
i have tried the DFlash partition for EEPROM Emulation in my controller board.
Now i have reflashed a new software where i am not requesting any partition, as I wanted to use the DFlash normally.
But when i am trying to do erase sector it is giving the ACCESS_ERROR,
if((FSTAT & (FSTAT_ACCERR_MASK | FSTAT_FPVIOL_MASK)) != 0) return ACCESS_ERROR;
i have given address as 0x100000 (DFlash), to the below function:
unsigned char FLASH_Erase_Sector(unsigned long int address)
{
//size of sector is 256B
while(FSTAT_CCIF == 0); //wait if command in progress
FSTAT = 0x30; //clear ACCERR and PVIOL
FCCOBIX = 0x00;
FCCOB = 0x1200 | ((address & 0x00FF0000UL)>>16);
FCCOBIX = 0x01;
FCCOB = (address & 0x0000FFF8UL);
Send_Command();
if((FSTAT & (FSTAT_ACCERR_MASK | FSTAT_FPVIOL_MASK)) != 0) return ACCESS_ERROR;
if(FSTAT_MGSTAT != 0) return VERIFICATION_FAILED;
return OK;
}
So could you please help me in solving this issue. I am not sure why now it is giving error, maybe because of previous partitioning done or something else.
I tried to flash multiple times with few changes, and finally i am getting BDM error. please see the attachement. i am not able to flash and not even able to unsecure.
please help me.