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

	/*
	 * Prepare the Write Buffer.
	 */
	WriteBuffer[BYTE1] = COMMAND_STATUSREG_READ;


	Status = XSpi_Transfer(SpiPtr, WriteBuffer, ReadBuffer,
						STATUS_READ_BYTES);
	if(Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
//
//	qspi_print_control(qspi_check_control());
//	qspi_print_status(qspi_check_status());
//	qspi_print_irstatus(qspi_check_irstatus());
//	u32 ask = Xil_In32(QSPI_BASEADDR + XSP_RFO_OFFSET);
//	u32 ask2 = Xil_In32(QSPI_BASEADDR + XSP_TFO_OFFSET);
//	drr = Xil_In32(QSPI_BASEADDR + AXI_QSPI_SPIDRR);

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

	return XST_SUCCESS;
}
/*****************************************************************************/
/**
*
* This function reads the Status register of the Winbond Flash.
*
* @param	SpiPtr is a pointer to the instance of the Spi device.
*
* @return	XST_SUCCESS if successful else XST_FAILURE.
*
* @note		The status register content is stored at the second byte pointed
*		by the ReadBuffer.
*
******************************************************************************/
This function reads the Status register of the Winbond Flash.
This function reads the Status register of the Winbond Flash .
int SpiFlashGetStatus(XSpi *SpiPtr)
{
	int Status;
	WriteBuffer[BYTE1] = COMMAND_STATUSREG_READ;
	Status = XSpi_Transfer(SpiPtr, WriteBuffer, ReadBuffer,
						STATUS_READ_BYTES);
	if(Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	if(ErrorCount != 0) {
		ErrorCount = 0;
		return XST_FAILURE;
	}
	return XST_SUCCESS;
}
int SpiFlashGetStatus ( XSpi * SpiPtr ) { int Status ; WriteBuffer [ BYTE1 ] = COMMAND_STATUSREG_READ ; Status = XSpi_Transfer ( SpiPtr , WriteBuffer , ReadBuffer , STATUS_READ_BYTES ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } if ( ErrorCount != 0 ) { ErrorCount = 0 ; return XST_FAILURE ; } return XST_SUCCESS ; }
This function reads the Status register of the Winbond Flash.
This function reads the Status register of the Winbond Flash .
/*
	 * Prepare the Write Buffer.
	 */ //
 //	qspi_print_control(qspi_check_control());
 //	qspi_print_status(qspi_check_status());
 //	qspi_print_irstatus(qspi_check_irstatus());
 //	u32 ask = Xil_In32(QSPI_BASEADDR + XSP_RFO_OFFSET);
 //	u32 ask2 = Xil_In32(QSPI_BASEADDR + XSP_TFO_OFFSET);
 //	drr = Xil_In32(QSPI_BASEADDR + AXI_QSPI_SPIDRR);
