2017-02-22 08:04 AM
Hello everyone again!
I have a special case scenario here that might be impossible to implement.
I wantto transfer (using HAL) from Flash memory to SRAM memory a single word at a time via DMA, using a timer to control the rate at which the transfer happens (using TRGO_Update), but amhaving no luck triggering the transfer at all.
Cananyone offerany suggestions, ideas, or insight on how to accomplish thisoperation in HAL?
Thanks!!
Christopher
#timer #dma #transfer #mem-to-mem Note: this post was migrated and contained many threaded conversations, some content may be missing.2017-02-22 10:37 AM
Which device? What have you done so far?
JW
2017-02-22 11:19 AM
Hi Jan,
It is the STM32F767ZI, and the project is being built on the NUCLEO-F767ZI board.
I modified the example 'DMAFlashtoRam'.
The timer (TIM9) is working, and the DMA is transferring from a FLASH buffer of constant words to a single word location in SRAM. I just can't seem to get the timer to control the rate of the DMA xfer (i.e. - it is always running in full speed rather than the rate of the TIM9 Update frequency).
Thanks for taking the time to assist me!
Christopher
2017-02-22 05:15 PM
Christopher,
JW
2017-02-22 08:22 PM
Thanks Jan!! Everything you suggested makes good sense. I am using TIM2, M2P, and DMA1. The request mapping table Channel 3 Stream 1 is triggered by TIM2_UP, so I chose that. I set TIM2_DIER to trigger on Update.
Still not working yet (I can't get the DMA xfer to begin at all now), but on the right track.
2017-02-23 01:00 AM
I am using TIM2, M2P, and DMA1.
You can't use DMA1 for memory-to-memory transfers. As I said above, use DMA2 and TIM1 or TIM8.
JW
2017-02-23 06:45 AM
I am using Memory-to-Peripheral now (M2P), as I said before!
All the pieces of the puzzle are there in the code now, I just have to figure out Cube/HAL is stopping it from working.
2017-02-23 06:55 AM
Just do what I told you, don't use DMA1. I'll explain it later.
JW
2017-02-24 01:45 PM
There is a TEIF1 Stream x transfer error interrupt happening on the first word transfer.
I will leave it as is for now, unsolved. Maybe I'll come back to debugging it at a later date.
2017-02-24 01:52 PM
Without downloading those whopping 6.5MB - if you are using Direct Mode (i.e. FIFO off) and it's a FIFO error, then just ignore it (leave it disabled in the interrupt masks). You can find the explanation somewhere on this forum, and it's harmless.
JW