cancel
Showing results for 
Search instead for 
Did you mean: 

Nucleo-G474RE couldn't establish qspi connection with external Flash W25Q16JV

Radhai
Visitor

From Nucleo-G474RE I am not able to read the Read JEDEC ID of my external flash W25Q16JV ,chipselect not going low on sending command.Verified all connections and quadspi configuration multiple times

/* QUADSPI1 init function */
void MX_QUADSPI1_Init(void)
{

  /* USER CODE BEGIN QUADSPI1_Init 0 */

  /* USER CODE END QUADSPI1_Init 0 */

  /* USER CODE BEGIN QUADSPI1_Init 1 */

  /* USER CODE END QUADSPI1_Init 1 */
  hqspi1.Instance = QUADSPI;
  hqspi1.Init.ClockPrescaler = 1;
  hqspi1.Init.FifoThreshold = 4;
  hqspi1.Init.SampleShifting = QSPI_SAMPLE_SHIFTING_NONE;
  hqspi1.Init.FlashSize = 20;
  hqspi1.Init.ChipSelectHighTime = QSPI_CS_HIGH_TIME_4_CYCLE;
  hqspi1.Init.ClockMode = QSPI_CLOCK_MODE_0;
  hqspi1.Init.FlashID = QSPI_FLASH_ID_1;
  hqspi1.Init.DualFlash = QSPI_DUALFLASH_DISABLE;
  if (HAL_QSPI_Init(&hqspi1) != HAL_OK)
  {
    Error_Handler();
  }
  /* USER CODE BEGIN QUADSPI1_Init 2 */

  /* USER CODE END QUADSPI1_Init 2 */

}
HAL_StatusTypeDef QSPI_ReadID( )
{

    /* ###### READING DEVICE ID ######### */

    sCommand.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
    sCommand.Instruction       = 0x9F;
    sCommand.AddressMode       = QSPI_ADDRESS_NONE;
    sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
    sCommand.DataMode          = QSPI_DATA_1_LINE;
    sCommand.DummyCycles       = 0;
    sCommand.DdrMode           = QSPI_DDR_MODE_DISABLE;
    sCommand.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
    sCommand.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
    sCommand.NbData            = 3;

    if (HAL_QSPI_Command(&hqspi1, &sCommand, HAL_QSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
    {
    	return HAL_ERROR;
    }

    if (HAL_QSPI_Receive(&hqspi1, id, HAL_QSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
    {
    	return HAL_ERROR;
    }
    return HAL_OK;
}

 Would appreciate ,If I could get quadspi stmcube IDE project for Nucleoboard G474RE.Tried adding Dummy cycles also?

4 REPLIES 4
KDJEM.1
ST Employee

Hello @Radhai and welcome to the community;

 

I think you have the same issue posted in this post.

Could you please confirm that?

I recommend you to check the QUADSPI configuration and precisely the chip select high time.

You can find the QUADSPI examples here.

These examples have been tested with STM32G474E-EVAL Rev B board and can be easily tailored to any other supported device and development board.

 

I hope this help you.

Thank you for your contribution to the community.

Kaouthar

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Radhai
Visitor

Hi @KDJEM.1 ,

Yes,the same issue ,I am facing.I  tried the same QuadSPI configuration mentioned in example for STM32G474E-EVAL Rev B.Can I get example QuadSPI project for Nucleo-G474RE?.

Thank You,

Radhai

KDJEM.1
ST Employee

Hello @Radhai;

 

I prefer to follow this problem in an unique discussion. For that, please add your comment and any update in this post: W25Q16JV Flash Memory - no response on STM32G4... - STMicroelectronics Community.

 

Unfortunately, there are no QUADSPI examples in STM32Cube_FW_G4_V1.61. with Nucleo-G474RE board STM32CubeG4/Projects/NUCLEO-G474RE/Examples at master · STMicroelectronics/STM32CubeG4 · GitHub

 

Thank you.

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Please work together, and pick one amongst you to describe the issue.

Ideally provide a schematic or wiring diagram so that everyone understands exactly what you have built.

>>I get example QuadSPI project for Nucleo-G474RE?

Start with a pin diagram. Usually there aren't examples for every use case, part of the responsibility here is about porting to your own platform.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..