I am trying to work on Mobyfab previously published code for DAC http://forum.chibios.org/phpbb/viewtopic.php?f=16&t=1196&hilit=dac&start=10#p12217 and adapt it for STM32L1. But I have strange problem which seems to be DMA related. Namely: I initiate DAC2 and it seems to work. Since once I write manually into the DAC data holding register, I see the appropriate voltage at the PIN (PA5 in the case of the STM32l-discovery board),
however if I execute
Code: Select all
dacStartConversion(&DACD2, &dacconvgrp, dac_buffer, DAC_BUFFER_SIZE);nothing happens. The pin reads 0, and none of callbacks are ever executed. This is why I think that this is DMA related, since conversion code uses DMA.
Can someone look at what is possibly wrong with this code? It is available at
https://github.com/evgmik/ChibiOS/tree/dac-new-testhal-dac-stm32lxx/testhal/STM32L1xx/DAC
Also it seems that stm32l DMA driver is not full, the manual said that there are 12 channels 7+5 in DMA1 and DMA2, but os/hal/platforms/STM32L1xx/stm32_dma.h defines only 7:
Code: Select all
#define STM32_DMA_STREAMS 7Is it by design?