2019-07-09 01:38 PM
Figure 1: QUADSPI General Parameters
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:
Once the code has been generated, I do the following to set up the QSPI command:
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.
By looking through the HAL_QSPI_Transmit function, I've determined the following has been causing the error.
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.
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~
2019-08-12 04:49 AM
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.