Question
Hi, I want to use a DMA to simply output array values to a whole GPIO port. I don't think I set it up correctly, as it doesn't work. I generated most of the code with CubeMX and used HAL. Should my code work ? How can I make it work ? Thanks !
Here's the context:
- I'm working on a STM32H743, I managed to output the array values manually to GPIOD (ie my MCU is not fried... You never know)
- I paid close attention to using the correct region D2 as stated here :
//In my main.c:
#define BUFFER_SIZE 32
#define __SECTION_RAM_D2 __attribute__((section(".RAM_D2"))) /* AHB SRAM (D2 domain): */
volatile __SECTION_RAM_D2 uint16_t Buffer[BUFFER_SIZE] = {0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF};
//In my STM32H743xxx.Id, at the end of the file:
/* Definition for DMA area */
.RAM_D2 :
{
KEEP(*(.RAM_D2)) /* ORIGIN = 0x30000000, LENGTH = 288K */
} >RAM_D2- After my init sequence, and before my main loop, here's the part dealing with the DMA (and my timer !):
__HAL_TIM_ENABLE_DMA(&htim1, TIM_DMA_CC4);
HAL_DMA_Start_IT(htim1.hdma[TIM_DMA_ID_CC4], (uint32_t)Buffer, (uint32_t)DAC3_D0_GPIO_Port->ODR, BUFFER_SIZE);
HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_3);
HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_4);- DAC_D0_GPIO_Port is my GPIOD, where my array should be output
- My timer is setup and running as PWM generation, i can see it correctly running at about 1.2MHz (setup through CubeMX)
- Here is my DMA setup in CubeMX:

I must be missing something evident, but it is the first time I am using an STM32, and a DMA.
Thanks in advance for your help ! :D
