QSPI_SRECBootloader/bootloader.c
int SpiFlashWriteEnable(XSpi *SpiPtr)
{
	int Status;

	/*
	 * Wait while the Flash is busy.
	 */
	Status = SpiFlashWaitForFlashReady();
	if(Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	/*
	 * Prepare the WriteBuffer.
	 */
	WriteBuffer[BYTE1] = COMMAND_WRITE_ENABLE;

	/*
	 * Initiate the Transfer.
	 */
	Status = XSpi_Transfer(SpiPtr, WriteBuffer, NULL,
				WRITE_ENABLE_BYTES);
	if(Status != XST_SUCCESS) {
		return XST_FAILURE;
	}



	if(ErrorCount != 0) {
		ErrorCount = 0;
		return XST_FAILURE;
	}

	return XST_SUCCESS;
}
/*****************************************************************************/
/**
*
* This function enables writes to the Winbond Serial Flash memory.
*
* @param	SpiPtr is a pointer to the instance of the Spi device.
*
* @return	XST_SUCCESS if successful else XST_FAILURE.
*
* @note		None
*
******************************************************************************/
This function enables writes to the Winbond Serial Flash memory.
This function enables writes to the Winbond Serial Flash memory .
int SpiFlashWriteEnable(XSpi *SpiPtr)
{
	int Status;
	Status = SpiFlashWaitForFlashReady();
	if(Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	WriteBuffer[BYTE1] = COMMAND_WRITE_ENABLE;
	Status = XSpi_Transfer(SpiPtr, WriteBuffer, NULL,
				WRITE_ENABLE_BYTES);
	if(Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	if(ErrorCount != 0) {
		ErrorCount = 0;
		return XST_FAILURE;
	}
	return XST_SUCCESS;
}
int SpiFlashWriteEnable ( XSpi * SpiPtr ) { int Status ; Status = SpiFlashWaitForFlashReady ( ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } WriteBuffer [ BYTE1 ] = COMMAND_WRITE_ENABLE ; Status = XSpi_Transfer ( SpiPtr , WriteBuffer , NULL , WRITE_ENABLE_BYTES ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } if ( ErrorCount != 0 ) { ErrorCount = 0 ; return XST_FAILURE ; } return XST_SUCCESS ; }
This function enables writes to the Winbond Serial Flash memory.
This function enables writes to the Winbond Serial Flash memory .
/*
	 * Wait while the Flash is busy.
	 */ /*
	 * Prepare the WriteBuffer.
	 */ /*
	 * Initiate the Transfer.
	 */