cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 DMA1

marseney
Visitor
Good day! I use TIM15 and DMA1, channel 5 in STM32H743. If DMA and data have a size of 32-bit, then everything works fine. If you configure DMA on 16-bit data, then 32-bit data is still written to the TIM5 registers. In order to save memory, I want to write 16-bit values ​​to the timer. In the documentation I read that DMA1 works only in 32-bit data mode.
Is there any way to force DMA1 to transfer data to the timer in 16-bit mode, or even better in 8-bit?
Andrey.

 

3 REPLIES 3
AScha.3
Super User

Hi,

so you want write 16b to a timer register ? 

And you set data and destination to 16b ?

AScha3_0-1762892521881.png

then..?

If you feel a post has answered your question, please click "Accept as Solution".
waclawek.jan
Super User

This won't work and you cannot save memory, the data for TIM5 have to be 32-bit.

DMA1 is a dual-port DMA (i.e. the same as in'F2/'F4/'F7), and does not zero-extend the data. It means, that if you set it to 16-bit at the memory side and 32-bit at peripheral side, it will assemble (concatenate) two halfwords from memory to a word tp output to the timer. If you set 16-bit at both memory and peripheral side, it will indeed write only 16 bits onto the AHB bus towards TIM5, but the AHB/APB bridge will copy the lower 16 bits to the upper 16 bits and both halves will be written to the timer.

At least this is what happens in 'F4; I don't use the'H7. Try.

JW

@waclawek.jan  , 

but Tim15 is 16b timer, so register with 16b write should work - or not ?

AScha3_0-1762897816961.png

 

If you feel a post has answered your question, please click "Accept as Solution".