Page 1 of 1

SDADC3 faults on STM32F373 @ 3.0-git

Posted: Sat Oct 18, 2014 5:43 pm
by Vooon
I turn back to the processing of ADC and came across a problem: after starting the firmware SDADCD3 falls (even without a halt).
With that SDARC1 works without problems.

Configuration: https://github.com/vooon/miniecu/blob/m ... adc.c#L198

It fails if i uncomment adcSTM32Calibrate(&SDADCD3); or adcStartConversion(&SDADCD3, &sdadc3group, p_flow_samples, 1);.

--- While i write i found bug ---

STM32F37x/adc_lld.c 447

Code: Select all

#if STM32_ADC_USE_SDADC3
    if (&SDADCD3 == adcp) {
      bool b = dmaStreamAllocate(adcp->dmastp,
                                 STM32_ADC_SDADC3_DMA_IRQ_PRIORITY,
                                 (stm32_dmaisr_t)adc_lld_serve_dma_interrupt,
                                 (void *)adcp);
      osalDbgAssert(!b, "stream already allocated");
      dmaStreamSetPeripheral(adcp->dmastp, &SDADC3->JDATAR);
      rccEnableSDADC2(FALSE);
      PWR->CR |= PWR_CR_SDADC3EN;
      adcp->sdadc->CR2 = 0;
      adcp->sdadc->CR1 = (adcp->config->cr1 | SDADC_ENFORCED_CR1_FLAGS) &
                         ~SDADC_FORBIDDEN_CR1_FLAGS;
      adcp->sdadc->CR2 = SDADC_CR2_ADON;
    }
#endif /* STM32_ADC_USE_SDADC3 */


RCC enable should be for SDADC3.
And change it fixes my problem.

Re: SDADC3 faults on STM32F373 @ 3.0-git

Posted: Sat Oct 18, 2014 5:45 pm
by Vooon
Also i am waiting update official git, have any details about sync? :roll:

Re: SDADC3 faults on STM32F373 @ 3.0-git

Posted: Sat Oct 18, 2014 7:08 pm
by Giovanni
I committed the change, thanks for finding.

Isn't the git repository supposed to update every 10 minutes? I am not handling that.

Giovanni

Re: SDADC3 faults on STM32F373 @ 3.0-git

Posted: Sat Oct 18, 2014 7:40 pm
by Vooon

Re: SDADC3 faults on STM32F373 @ 3.0-git

Posted: Sat Oct 18, 2014 7:53 pm
by Giovanni
Please use the official subversion repository, I have no control over there.

Giovanni