2024-07-11 09:32 PM
So, I've got a super basic test program which is example page 289 from Dogan Ibrahim's "Nucleo Boards Programming with STM32 Cube IDE" which outputs a wavetable of 21 entries to the onboard DAC using TIM2 and DMA with cirular buffer. It works perfectly fine on a Nucleo-L431RG (outputs a stairstep wave thing as it should), but I get nothing out of the DAC with a Nucleo-G431RB. Any ideas why this would be the case?? DAC without DMA works perfectly fine on the G431RB board, just not DMA.
This is the only thing in the original example (which works fine on L431RG) that kicks off the DMA transfer (below).
I know the code is good, and I know the MX config is correct between the 2. There must be something different about the DACs on the G series vs L that makes this not work...but what??
2024-07-12 03:33 AM
Well, check and compare the HAL files for both types.
Go through the functions and registers.
Maybe it's something simple: another GPIO pin / alternate function, another DAC channel, clock not enabled, ...
2024-07-12 04:49 AM
Read out and check/post content of TIM, DAC, DMAMUX, DMA and relevant GPIO registers.
JW
2024-07-12 10:11 AM
Well, it can't be anything super simple like GPIO etc because the DAC works perfectly fine without DMA. It just won't do DMA.
I just set a breakpoint and started up and it looks like the DMA error callback is getting called and setting to an error code 4: