I have solved myself the problem using Demo FLASH example program. With small necessary changes to routines for checking OpStatus on the end:
bool WriteFlash(LDD_TDeviceData *DeviceData, LDD_TData* DataPtr, LDD_FLASH_TAddress FromAddress, LDD_FLASH_TDataSize Size, uint8_t* OpStatus)
{
*OpStatus = FALSE;
Error = FLASH1_Write(DeviceData, DataPtr, FromAddress, Size);
if (Error) {
return FALSE;
}
*OpStatus = FLASH1_GetOperationStatus(DeviceData);
while(*OpStatus != LDD_FLASH_IDLE); /* Wait while operation done */
return TRUE;
}
bool EraseFlash(LDD_TDeviceData *DeviceData, LDD_FLASH_TAddress FromAddress, LDD_FLASH_TDataSize Size, uint8_t* OpStatus)
{
*OpStatus = FALSE;
Error = FLASH1_Erase(DeviceData, FromAddress, Size);
if (Error) {
return FALSE;
}
*OpStatus = FLASH1_GetOperationStatus(DeviceData);
while(*OpStatus != LDD_FLASH_IDLE); /* Wait while operation done */
return TRUE;
}