How to debug DMA Peripheral to Peripheral Transfer? (Using an STM32 F1)
Hello,
I'm trying to understand the peripheral to peripheral transfers. I'm pretty sure my setup is correct but it's not working and I don't think I understand enough to know what to look for to troubleshoot.
For my test I simply have uart1 rx connected to the GPIOB port. I have a script that runs that alternatively sends 0xFF and 0x00 zero bytes and I have an led on pin 6 of GPIOB. So I expect the led to flash. And all this would be independent of the core.
I've previously and successfully ran a memory to peripheral transfer where I sent a message through to the uart1_tx and also turned on the led on GPIOB on pin 6.
I'm running pretty much the same setup only just configured to for peripheral to peripheral transfers and I know I'm using the right DMA channel for uart1 rx as well so I'm not sure what is going on.
Here is my code btw:
hdma_usart1_rx.Instance = DMA1_Channel5;
hdma_usart1_rx.Init.Direction = DMA_PERIPH_TO_MEMORY;
hdma_usart1_rx.Init.PeriphInc = DMA_PINC_DISABLE;
hdma_usart1_rx.Init.MemInc = DMA_MINC_DISABLE;
hdma_usart1_rx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
hdma_usart1_rx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
hdma_usart1_rx.Init.Mode = DMA_CIRCULAR;
hdma_usart1_rx.Init.Priority = DMA_PRIORITY_LOW;
HAL_DMA_Init(&hdma_usart1_rx);
HAL_DMA_Start(&hdma_usart1_rx, (uint32_t)&huart1.Instance->DR, (uint32_t)&GPIOB->ODR, 1);
//Enable UART in DMA mode
huart1.Instance->CR3 |= USART_CR3_DMAR;Thanks for any input you may have.