2020-11-01 05:43 PM
SOLUTION
Buffer was being put into DTCM by cube. Ensure it doesn't do that, and you should be set.
I want to start by saying that it works on the M4, but not on the M7 and I don't know why. The M7 on pretty much all the peripheral configurations I've seen is that purple-ish "hey don't do this" colour, but it doesn't say why.
I am trying to follow the examples
and here
but they're all pretty much "configure and run it. observe success"
I keep getting an underrun error on the DAC. I saw this post from a G4, but I'm already set to word length transfers.
I've confirmed in manually sending DAC values that the pins are configured, and I do see 0v instead of floating once the modules are initialized. But I'm always getting an underrun error, even when I slow the timer way down. Which leads me to believe that like in the G4 post it's not an inability to keep up, it's an inability to do any transfers. I wouldn't be surprised if I'm missing something because this is a dual core chip, but I've verified that the M7 does make it through initialization with no issues. So far I have confirmed:
Before DAC_Start_DMA:
After DAC_Start_DMA:
After TIM_Base_Start
So I'm kind of at a loss on this one. Manually setting the enable bit in S0CR doesn't do anything, in fact the SFRs view still shows it as 0. I've tried a clean project. All clocks set to 80 MHz. Any ideas? I suppose I could dump the configs of the registers, but I'm suspecting there's something in the difference between the M4 and the M7's accessing of the peripherals since they look the same on the surface. I could also try and read the entire memory peripheral memory map, but I'm worried there'll be a write only register that'll hardfault me or something.
2020-12-20 01:16 PM
I am using the NUCLEO H745ZI and having the same problem using DMA with the DAC on M7, but I had not tried M4 until I saw your post. I am following the same examples you mentioned. I just tried the example on M4 and it worked. So, the problem definitely seems to be something about M7.
The only thing that I have read that may provide an explanation is this: https://community.st.com/s/article/FAQ-DMA-is-not-working-on-STM32H7-devices I do not understand the article well enough to figure out if this is the problem and how to develop a work-around. Maybe you understand it well enough to come up with a solution. If you do, please post it so I can use it.
2020-12-20 01:19 PM
Given it's been almost 2 months I didn't figure this would get any attention, but I did actually find a solution.
If you note the memory address of the buffer, you'll note it fits this bullet point from that link:
"Memory placed in DTCM RAM for D1/D2 peripherals"
I believe the solution is to make a custom linker file, though I just let the M4 handle it.
At least that was my issue. I'll edit this post with the solution for anyone else who finds it.
2020-12-20 04:35 PM
The M7 side DMA would need visibility into the memory used, the bus matrix diagram should be illustrative. Perhaps looks at working H743 examples.
M7 side DTCMRAM definitely isn't something I'd expect to work.
Use RAM in the D2 0x30000000..0x30047FFF range, enable the D2 SRAM clocks
2020-12-20 04:40 PM
It was as soon as I saw it, I had just never considered that as an issue. For my other work on the H745 I'm using a different IDE that places things in the D2's SRAM by default for compatibility over performance. Now that I know cube uses the DTCM, I was able to fix it.