2025-02-13 06:19 AM
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?
2025-02-13 06:47 AM - edited 2025-02-13 06:47 AM
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.
2025-02-13 07:10 AM
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
2025-02-13 07:34 AM - edited 2025-02-13 07:43 AM
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.
2025-02-13 08:22 AM
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.