cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to get proper QSPI output with NUCLEO-H743ZI2

SScot
Associate

0690X000009YarKQAS.pngFigure 1: QUADSPI General Parameters

0690X000009YasXQAS.png

Figure 2: QSPI GPIO Settings

OS: Linux Mint 64-bit Tessa (19.1)

IDE: cubeMX IDE 1.0.1

code generator: cubeMX 5.2.1

MCU: STM32H743ZIT6U

DevBoard: NUCLEO-H743ZI2

Target: FPGA (Not assembled, currently prototyping the driver. FPGA Interface is being design parallel to my work. All work here is for the Saleae timing analysis.)

Using cubeMX to initialize my system, I am unable to get QSPI to give me valid output.

Steps to setup:

  1. Configure the clock so that QSPI is driven by HCLK3 at 240MHz (Should be scaled down to 48MHz after pre-scaler).
  2. Enable QSPI for Bank 1 using the following parameters (Figure 1).
  3. Enable NVIC for QSPI Interrupts.
  4. Set GPIO to 'Very High' maximum output speed (Figure 2).

Once the code has been generated, I do the following to set up the QSPI command:

0690X000009YatVQAS.png

Then, once in the main while loop, I do the following where I will get blocked on that while loop. Debugger reports that halStatus is HAL_ERROR. Note: txBuff is a buffer of size BUFFER_SIZE filled with sequencing 0xAA and 0x55.

0690X000009YatuQAC.png

By looking through the HAL_QSPI_Transmit function, I've determined the following has been causing the error.

0690X000009Yau4QAC.png

Where QSPI_WaitFlagStateUntilTimeout() fails due to timeout (seemingly independent of the timeout duration!). It seems to me that the hardware is never setting QSPI_FLAG_TC, and this will always fail. I get the following output with this set up on my saleae.

0690X000009YauYQAS.png

I've been hitting my head against this for some time I'm running out of options. I'm hoping someone here can shed some light on my problem.

Please and Thank you,

Skye~

1 REPLY 1
stm32user1
Associate

I had a similar problem (QSPI_FLAG_TC timeout) with the following configuration. Writing a command followed by a single byte transmission (NbData = 1) worked, but writing a command + multiple bytes did not.

  hqspi.Instance = QUADSPI;
  hqspi.Init.ClockPrescaler = 8;
  hqspi.Init.FifoThreshold = 16;
  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_1;
  hqspi.Init.DualFlash = QSPI_DUALFLASH_DISABLE;

	qspiDefaultCmd.Address = 0;
	qspiDefaultCmd.AddressMode = QSPI_ADDRESS_NONE;
	qspiDefaultCmd.AddressSize = QSPI_ADDRESS_8_BITS;
	qspiDefaultCmd.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
	qspiDefaultCmd.AlternateBytes = 0;
	qspiDefaultCmd.AlternateBytesSize = QSPI_ALTERNATE_BYTES_8_BITS;
	qspiDefaultCmd.DataMode = QSPI_DATA_4_LINES;
	qspiDefaultCmd.DdrHoldHalfCycle = QSPI_DDR_HHC_HALF_CLK_DELAY;
	qspiDefaultCmd.DdrMode = QSPI_DDR_MODE_DISABLE;
	qspiDefaultCmd.DummyCycles = 0;
	qspiDefaultCmd.Instruction = 0x00;
	qspiDefaultCmd.InstructionMode = QSPI_INSTRUCTION_4_LINES;
	qspiDefaultCmd.NbData = 1;
	qspiDefaultCmd.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;

Setting

  hqspi.Init.FlashSize = 7;

fixed the issue.