cancel
Showing results for 
Search instead for 
Did you mean: 

Toggle the led using DMA.

SKUND.11
Associate III

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.

1 ACCEPTED SOLUTION

Accepted Solutions

Interesting, i didnt know that

0693W00000QKvmpQAD.png

we dont need to firmware by ourselves, lets talk

View solution in original post

5 REPLIES 5
gbm
Lead III

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.

Javier1
Principal

Interesting, i didnt know that

0693W00000QKvmpQAD.png

we dont need to firmware by ourselves, lets talk

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

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.

we dont need to firmware by ourselves, lets talk