Skip to main content
Visitor II
May 9, 2025
Question

Changing octospi to quadspi configuration on STM32H723

  • May 9, 2025
  • 5 replies
  • 876 views

Hello,

I am using QuadSPI in STM32H723ZGT6 which has OCTOSPI and I am changing octospi to quadspi in pin configuration and writing code also I had written same code for STM32H750VBT6 which only supports QUADSPI and I am using W25Q128JVSIQ Flash for this in H750 the same code is working but in H723 it is not working can anyone explain me why you can check my main.c file for both of the controllers I am attaching it below.

    This topic has been closed for replies.

    5 replies

    Technical Moderator
    May 9, 2025

    Hello @Aries16 ;

     

    The datasheet of the W25Q128JVSIQ is 128MBits = 16Mbytes. We see the bit 24 is set  meaning 2^24 =16 MBytes. In STM32CubeMx you need to set the device size field to 24.

    Also, it is recommended to enable Sample shifting (SSHT) in STR mode and disabled in DTR mode.
    Delay hold quarter cycle (DHQC) enabled in DTR mode and disabled in STR mode.

     

    Why do you use different sCommand.Instruction =0x94; //0x9F//?

    Thank you.

    Kaouthar

    Aries16Author
    Visitor II
    May 12, 2025

    Hii I made all the changes you told but sill it is not working. by the way I am using 0x9F command to read the manufacturing id of W25Q128JV. can you tell me what I can do now to solve this issue

    Technical Moderator
    May 12, 2025

    Hello @Aries16;

     

    To read manufacturer device ID Quad I/O you need to use 0x94 command.

    KDJEM1_0-1747057175072.png

     

    Could you please try with 94h command?

    In addition, I recommend to decrease the OCTOSPI frequency.

     

    Thank you.

    Kaouthar

     

    Aries16Author
    Visitor II
    May 12, 2025

    Hii I have also used 0x94 and I have tried to run octospi at different freq like at 64MHZ, 100mhz, 200mhz but still it is not working

    Technical Moderator
    May 12, 2025

    Hello @Aries16;

     

    Are you reading the manufacturer device ID with less than two cycles before the data?

    Please look at the errata sheet

    KDJEM1_1-1747059293926.png

    I think the "sCommand.InstructionSize" is missing in your code.

    Thank you.

    Kaouthar

    ST Employee
    June 25, 2025

    Hello @Aries16 ,

     

    First of all, please verify the pins assigned to the OCTOSPI by consulting the STM32H723 datasheet to ensure you are using the correct ones. If you are using the Nucleo board, also review the User Manual and its schematic to confirm that there are no solder bridges (SB) on the OCTOSPI lines.

    To read the JEDEC ID, please try with the following function:

    /**
     * @breif This function read the JEDEC ID
     * @param Ctx OSPI handle
     *
     */
    
    int32_t w25q128j_ReadJEDECID(OSPI_HandleTypeDef *Ctx)
    {
    
    	uint8_t JEDEC_ID[3];
    	OSPI_RegularCmdTypeDef sCommand = {0};
    
    	sCommand.OperationType = HAL_OSPI_OPTYPE_COMMON_CFG;
    	sCommand.FlashId = HAL_OSPI_FLASH_ID_1;
    
    	sCommand.Instruction 	 = 0x9F;
    
    	sCommand.InstructionMode = HAL_OSPI_INSTRUCTION_1_LINE;
    	sCommand.InstructionSize = HAL_OSPI_INSTRUCTION_8_BITS;
    	sCommand.InstructionDtrMode = HAL_OSPI_INSTRUCTION_DTR_DISABLE;
    
    	sCommand.Address = 0U;
    	sCommand.AddressMode = HAL_OSPI_ADDRESS_NONE;
    	sCommand.AddressSize = HAL_OSPI_ADDRESS_24_BITS;
    	sCommand.AddressDtrMode = HAL_OSPI_ADDRESS_DTR_DISABLE;
    
    	sCommand.AlternateBytes = 0U;
    	sCommand.AlternateBytesMode = HAL_OSPI_ALTERNATE_BYTES_NONE;
    	sCommand.AlternateBytesSize	 = HAL_OSPI_ALTERNATE_BYTES_8_BITS;
    	sCommand.AlternateBytesDtrMode = HAL_OSPI_ALTERNATE_BYTES_DTR_DISABLE;
    
    	sCommand.DataMode = HAL_OSPI_DATA_1_LINE;
    	sCommand.NbData = 3U;
    	sCommand.DataDtrMode = HAL_OSPI_DATA_DTR_DISABLE;
    
    	sCommand.DummyCycles = 0U;
    	sCommand.DQSMode = HAL_OSPI_DQS_DISABLE;
    	sCommand.SIOOMode = HAL_OSPI_SIOO_INST_EVERY_CMD;
    
    	/*Send the command*/
    	if(HAL_OSPI_Command(Ctx, &sCommand, HAL_OSPI_TIMEOUT_DEFAULT_VALUE))
    	{
    		return -1 ;
    	}
    
    	/* Read function */
    
    	if(HAL_OSPI_Receive(Ctx,JEDEC_ID, HAL_OSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
    	{
    		return - 1;
    	}
    
    	return 0;
    }