cancel
Showing results for 
Search instead for 
Did you mean: 

MDMA rotate Matrix 90° (transpose)

SF??r
Associate III

Hello,

I have a application that requires Matrix transposition in a efficient and fast way. I know there is a cmsis dsp matrix transposition function but maybe the MDMA could do this without CPU intervention?!

I found an example in the STM32 Cube H7 Repo and it is talking about 90 ° rotation, but it is not done in the source... only mirroring and 180° rotation.

https://github.com/STMicroelectronics/STM32CubeH7/tree/master/Projects/STM32H747I-DISCO/Examples/MDMA/MDMA_RepeatBlock_Rotation

Is it possible? I don't get the clou of the block offset address behaviour at the moment.

Thanks

Sebastian

4 REPLIES 4

I don't know what do you mean by "block offset address".

For transposition, you'd need either the source's or the destination's address to increment or decrement by an adjustable amount. In MDMA, this amount is only a few selected small steps, set by SINCOS/DINCOS. So, generally, MDMA is unusable for transposition and you have to do it "manually", however painful it is. Try to merge the data rearrangement with any other operations, wherever possible.

Btw. transposition would better fit the graphics-oriented DMA2D than any general-purpose DMA, but it's not implemented there either.

JW

SF??r
Associate III

Thx for your comment.

I had also the DMA2D in mind, but didn't find the solution there (like you said).

Transposition could be done by copy the selected size and increment by the source columns (maybe the block offset address could be used?). After the generation of the first row (at dest) the MDMA could be reinit ("semi automatic" -> reinit MDMA at end of each row)

I talk about MDMA_CxBRUR -> SUV... but I am not sure if this is possible or I did understand it wrong.

best regards

Sebastian

Hi Sebastian,

Ah, MDMA_CxBRUR... I overlooked that, sorry. That indeed appears to be usable for this purpose.

JW

SF??r
Associate III

I'm still in a conceptual phase and did not write any code at the moment. If you try to run this for your purpose of rotation images 90 ° I'm interested in your configuration/code and experience.

Thanks

Sebastian