cancel
Showing results for 
Search instead for 
Did you mean: 

STM32U5 - OSPI - GPDMA. Driving an AMOLED display (GRAM) with QSPI - blocking mode working but not with GPMDA.

Bertha
Associate III

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 :

0693W00000WIAlVQAX.pngand for GPDMA:

0693W00000WIAnCQAX.pngTo 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

1 ACCEPTED SOLUTION

Accepted Solutions
Bertha
Associate III

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:

https://community.st.com/s/question/0D53W00002DWC4xSAH/halospitransmitdma-not-working-for-nbdata-0xffff-

View solution in original post

2 REPLIES 2

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Bertha
Associate III

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:

https://community.st.com/s/question/0D53W00002DWC4xSAH/halospitransmitdma-not-working-for-nbdata-0xffff-