Problem with reading Status Register of W25Q80DV with QSPI
Hello together! :)
I am trying to read the status register 1 of the QSPI Flash W25Q80DV via QSPI. Unfortunately I don't get any data in the buffer. I only get 0x00. The topic of QSPI is still very new to me, so I may have overlooked something obvious here...
Here is the important part of the main code:
/*
* PE7: IO0 = DI
* PE8: IO1 = DO
* PC11: CS
* PB2: CLK
*/
uint8_t txBuffer[3] = {0};
uint8_t rxBuffer[10] = {0};
txBuffer[0] = 0x05; //Read Status Register-01
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_11, 0); //Drive the CS low
HAL_QSPI_Transmit(&hqspi, txBuffer, 100);//INstructioncode 0x05 for status register 1 shifting to DI pin
HAL_QSPI_Receive(&hqspi, rxBuffer, 100);
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_11, 1);
static void MX_QUADSPI_Init(void)
{
/* USER CODE BEGIN QUADSPI_Init 0 */
/* USER CODE END QUADSPI_Init 0 */
/* USER CODE BEGIN QUADSPI_Init 1 */
/* USER CODE END QUADSPI_Init 1 */
/* QUADSPI parameter configuration*/
hqspi.Instance = QUADSPI;
hqspi.Init.ClockPrescaler = 255;
hqspi.Init.FifoThreshold = 1;
hqspi.Init.SampleShifting = QSPI_SAMPLE_SHIFTING_NONE;
hqspi.Init.FlashSize = 1;
hqspi.Init.ChipSelectHighTime = QSPI_CS_HIGH_TIME_1_CYCLE;
hqspi.Init.ClockMode = QSPI_CLOCK_MODE_0;
hqspi.Init.FlashID = QSPI_FLASH_ID_2;
hqspi.Init.DualFlash = QSPI_DUALFLASH_DISABLE;
if (HAL_QSPI_Init(&hqspi) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN QUADSPI_Init 2 */
/* USER CODE END QUADSPI_Init 2 */
}
Thank you very much!
