0
\$\begingroup\$

I am trying to make a project with the STM32F746ZG Nucleo board using the DMA to make a transfer of 16-bit values to a DAC connected to the MCU by SPI. I am using the STM32CubeMX to generate the init code and also the HAL Cube libraries to develop the code.

You can see the idea in the attached image, enter image description here

I have configured the Request channel for DMA using the TIM7 peripheral so I can request in Stream2 (this is specified un the user manual). But I need now to configure the memory location and from where to read the data and also the SPI3 memory direction so I can send it to the DAC device.

The problem es that I can't find the code configuring this in the code generated by the STM32CubeMX and there is no example of this kind of application in the STM32CubeHAL examples so I am stucked.

Has anyone made a similar application tell me how to configure correctly the DMA to make a transision from MemToPeripheral?

\$\endgroup\$
  • \$\begingroup\$ The registers DMA_SxMxAR are described in the reference manual. \$\endgroup\$ – Jeroen3 Jan 31 '18 at 10:32
  • \$\begingroup\$ @Jeroen3 Thanks! I hadn't notice that. Do you know where can I find some example code to know how to correctly configure this registers using the HAL Cube? \$\endgroup\$ – osuarez Jan 31 '18 at 11:27
  • \$\begingroup\$ Uhm, HAL Cube is the example code? But maybe there is an appnote as well. Check ST website. \$\endgroup\$ – Jeroen3 Jan 31 '18 at 11:55
  • \$\begingroup\$ There are separate examples available for TIM_DMA and SPI. You have to go through those and mix up efficiently! \$\endgroup\$ – charansai Jan 31 '18 at 14:48

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.