2020-07-23 10:20 AM
If I configure more than four bytes, the qspi do nothing, it also happens if I set as address any other value than zero.
I carefully read the application note 'AN4760' and it doesn't seem I'm doing anything wrong
s_command.InstructionMode = QSPI_INSTRUCTION_1_LINE;
s_command.Instruction = QUAD_INOUT_FAST_READ_CMD;
s_command.AddressMode = QSPI_ADDRESS_4_LINES;
s_command.AddressSize = QSPI_ADDRESS_24_BITS;
s_command.Address = 0x000000; //address;
s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
s_command.DataMode = QSPI_DATA_4_LINES;
s_command.DummyCycles = 6;
s_command.NbData = 4; //length;
s_command.DdrMode = QSPI_DDR_MODE_DISABLE;
s_command.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
s_command.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
The flash I'm using is 16 Mbyte 'W25Q128JV', it support all possible reading modes
Thanks in advance for your help
Solved! Go to Solution.
2020-07-24 05:26 AM
I have found the problem in the QSPI initialization,
Thanks for your help
hqspi.Instance = QUADSPI;
hqspi.Init.ClockPrescaler = 255;
hqspi.Init.FifoThreshold = 1;
hqspi.Init.SampleShifting = QSPI_SAMPLE_SHIFTING_NONE;
hqspi.Init.FlashSize = 1; --> must be 0x18;
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;
2020-07-23 10:38 AM
Prove out that 1-bit commands/addressing work, move to 2-bit.
Check you can read status, write to configuration/mode registers.
Make sure you're using the right command and mix of command, address and data bits, and that's consistent with how the QSPI is configured.
Then move to 4-bit.
Use a logic analyzer to review bus traffic if you can't explain behaviour having moved through the prior steps.
2020-07-24 01:24 AM
Thanks for your early answer,
All seems to work, I been wrote '0xbebacafe' string into the first four flash bytes ok, and read the status ok, and move to on line as you suggest, it seems to do the same, only read four bytes at zero address if only read four bytes.
s_command.InstructionMode = QSPI_INSTRUCTION_1_LINE;
s_command.Instruction = READ_CMD;
s_command.AddressMode = QSPI_ADDRESS_1_LINE;
s_command.AddressSize = QSPI_ADDRESS_24_BITS;
s_command.Address = 0x000000;//address;
s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
s_command.DataMode = QSPI_DATA_1_LINE;
s_command.DummyCycles = 0;
s_command.NbData = 4;//length;
s_command.DdrMode = QSPI_DDR_MODE_DISABLE;
s_command.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
s_command.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
I joined a plot of initialize function, it looks like everithing is ok, there are signals in all wires
2020-07-24 05:26 AM
I have found the problem in the QSPI initialization,
Thanks for your help
hqspi.Instance = QUADSPI;
hqspi.Init.ClockPrescaler = 255;
hqspi.Init.FifoThreshold = 1;
hqspi.Init.SampleShifting = QSPI_SAMPLE_SHIFTING_NONE;
hqspi.Init.FlashSize = 1; --> must be 0x18;
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;
2020-07-24 05:32 AM
Glad you were able to find this.