2022-11-12 01:00 AM
Hi, I am Driving an AMOLED display (GRAM) with QSPI.
In blocking mode everythings works fine, but now I trying to "update" it using GPDMA, nothing works. Any advices ?
So in blocking mode I used the typical :
OSPI_RegularCmdTypeDef sCommand = {0};
sCommand.OperationType = HAL_OSPI_OPTYPE_COMMON_CFG;
sCommand.Instruction = 0x02;
sCommand.InstructionMode = HAL_OSPI_INSTRUCTION_1_LINE;
sCommand.InstructionSize = HAL_OSPI_INSTRUCTION_8_BITS;
sCommand.Address = address<<8;
sCommand.AddressMode = HAL_OSPI_ADDRESS_1_LINE;
sCommand.AddressSize = HAL_OSPI_ADDRESS_24_BITS;
sCommand.AlternateBytesMode = HAL_OSPI_ALTERNATE_BYTES_NONE;
sCommand.DataMode = HAL_OSPI_DATA_1_LINE;
sCommand.NbData = nbOfData;
sCommand.DQSMode = HAL_OSPI_DQS_DISABLE;
sCommand.SIOOMode = HAL_OSPI_SIOO_INST_ONLY_FIRST_CMD;
sCommand.DummyCycles = 0;
HAL_OSPI_Command(&hospi1, &sCommand, 1000);
HAL_OSPI_Transmit(&hospi1, param, 1000);
Which works perfectly,
Now in the DMA, i replaced the HAL_OSPI_TRANSMIT with :
HAL_OSPI_Transmit_DMA(&hospi1, param);
I also updated the CubeMX configuration :
and for GPDMA:
To be honnest at a certain point I tried all the possibilities with GPDMA port - direction - and so on with no success, so I kept what made more sens to me.
Can someone point me out my mistakes or a way to dig into ?
Thanks for your time and your help.
Regards
Solved! Go to Solution.
2023-04-16 02:44 AM
Ok, I dig more into it, I figured out that if datasent count is lower that 0xFFFF then HAL_OSPI_Transmit_DMA works as expected. But in the case of sending more data it "breaks".
I made a bug report and waiting ST response on that, here with minimal code to reproduce:
2022-11-12 06:26 AM
Not sure.
Watch for caching and coherency issues.
Make sure memory is within reach of the DMA unit.
Watch for errors/status indicators about why a particular transfer failed.
QPSI part not identified.
Shift of address by eight suggests you're not handling it properly, if you need dummy cycles use those, don't shift the address. Mask the address so it fits within the scope of the QSPI part.
DMA is going to need more handling/management code.
You showed code that works, not the code that doesn't. Present the code that doesn't work, with ALL the associated handlers and callbacks.
2023-04-16 02:44 AM
Ok, I dig more into it, I figured out that if datasent count is lower that 0xFFFF then HAL_OSPI_Transmit_DMA works as expected. But in the case of sending more data it "breaks".
I made a bug report and waiting ST response on that, here with minimal code to reproduce: