1

I've been scratching my head all day trying to work this one out. My MCU is an STM32C071KBU6.

I am using a DMA to write to the GPIOA->BSRR register to look at signal timing with a scope. However, whenever the DMA is triggered it instantly raises the TEIFx. The odd bit is I can write to almost any other register using the same DMA setup, and it works, so I can verify my setup is ok. I have also manually written the same values to the BSRR register and it works, so it's not an address or data problem.

However, a DMA write to any GPIO register triggers an error. Is this a known problem?

3
  • Do memry to meory - and the destination address set to GPIOx Commented May 3 at 18:53
  • I gave this a go and it also raises the error flag. Interesting idea though. Commented May 6 at 6:29
  • I have done it meny times. Commented May 6 at 8:26

1 Answer 1

3

This one is sneaky, because it is not explicitly mentioned anywhere in the reference manual (RM0490). The only clue given is by looking at the system architecture diagram on page 40:

enter image description here

For this chip, the GPIO ports are directly connected to the core, not the AHB bus, so the DMA has no access to them. It would seem that they opted for this layout to improve latency.

To trigger pins through DMA writes, you have to disable the preload of CCRx channels, and write values at the extremities (0 or ARR) to cause the outputs to flip accordingly.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.