Skip to main content
SKUND.11
Associate III
July 12, 2022
Solved

Toggle the led using DMA.

I'm using STM32G071RBT6 MCU . In that I'm using DMA to toggle the on board LED. So it's very simple but somehow it is not toggling.

The on board led is LED3 that is in port 5(PA5). I' using circular DMA to toggle it or even if i have to turn on the led through DMA ,still it won't work. here is an example ....

Here is the DMA config-

0693W00000QKv7hQAD.pnghere is the gpio output that i have to write

0693W00000QKv5bQAD.pngnow here is the code-

uint32_t led = 0x00000020;

//uint32_t led = GPIO_ODR_OD5;

this example is to just turn on the led.

HAL_DMA_Start(&hdma_dma_generator0, (uint32_t)led, (uint32_t)&GPIOA->ODR, 1);

Still it doesn't turn on.

This topic has been closed for replies.
Javier1
Javier1Best answer
Principal
July 12, 2022

Interesting, i didnt know that

0693W00000QKvmpQAD.png

hit me up in https://www.linkedin.com/in/javiermuñoz/

5 replies

gbm
Super User
July 12, 2022

In G0 series, based on Cortex-M0+, GPIO ports cannot be accessed by DMA. See the picture in the Reference Manual showing the bus matrix.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
Javier1
Javier1Best answer
Principal
July 12, 2022

Interesting, i didnt know that

0693W00000QKvmpQAD.png

hit me up in https://www.linkedin.com/in/javiermuñoz/
Javier1
Principal
July 12, 2022
hit me up in https://www.linkedin.com/in/javiermuñoz/
SKUND.11
SKUND.11Author
Associate III
July 12, 2022

Thanks @Javier Muñoz​ you were a great help.

Javier1
Principal
July 18, 2022

Glad i was helpful, did you figure it out?

you could select my answer as best answer so i get ST points, so i can win a ST tshirt or a mug.

hit me up in https://www.linkedin.com/in/javiermuñoz/