Skip to main content
enke
Associate
December 6, 2009
Question

Problem with DMA-ADC and LowPower Mode

  • December 6, 2009
  • 6 replies
  • 1619 views
Posted on December 06, 2009 at 11:57

Problem with DMA-ADC and LowPower Mode

    This topic has been closed for replies.

    6 replies

    spam3
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 13:32

    Hi enke, i'm having similar issues with mixing DMA access and sleep mode. In my case it's on the ethernet controller: everything seem to be ok with the ethernet chip itself, but there is nothing in the DMA buffer in the end. It seems that your issue is also related to the DMA controller rather than the ADC controller.

    ST people: is it possible to use DMA while the chip is in sleep mode?

    enke
    enkeAuthor
    Associate
    May 17, 2011
    Posted on May 17, 2011 at 13:32

    Hi,

    i have a Problem with the ADC. I configured the ADC with DMA-Access. Sometimes, after a Wakeup from LowPower-Mode the ADC-Values does not update. The ADC does not work. Do you have any idea?

    Do i have to restart the ADC?

    Florian

    Enter Sleep Mode:

    PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI);

    WakeUp:

    //Enable HSE

    RCC_HSEConfig(RCC_HSE_ON);

    //Wait till HSE is ready

    HSEStartUpStatus = RCC_WaitForHSEStartUp();

    if(HSEStartUpStatus == SUCCESS)

    {

    RCC_PLLCmd(ENABLE); //Enable PLL

    while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET)

    //Wait till PLL is ready

    {}

    RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK); //Select PLL as system clock source

    while(RCC_GetSYSCLKSource() != 0x08) //Wait till PLL is used as system clock source

    {}

    }

    else

    {

    NVIC_GenerateSystemReset();

    }

    16-32micros
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 13:32

    Hi mates,

    Yes, This is absolutely possible; and this is the beauty of STM32 with DMA ;) .

    However this is only in Sleep mode not in STOP like the case from enke, because in STOP mode , all clocks on the internal busses are freezed, In Sleep Mode only CPU is OFF and is no more fetching from Flash, SRAM and you can put inside your main polling routine

    while(1)

    {

    {WFI or WFE } ;

    }

    With this scheme : DMA is working in Back-to-back and CPU will wake-up only for IRQ and exceptions and all with minimum Low power, saving some cycles on DMA accesses.

    Cheers,

    STOne-32.

    [ This message was edited by: STOne-32 on 02-12-2009 21:54 ]

    enke
    enkeAuthor
    Associate
    May 17, 2011
    Posted on May 17, 2011 at 13:32

    Hi STMicroelectronics,

    can you give me an hint, how i can found a soluten for my problem? After a complete Reset the ADC works fine again. I tried to re_init the DMA. But that doesnt work. How can i restart my ADC or DMA without rebooting the controller?

    Florian

    enke
    enkeAuthor
    Associate
    May 17, 2011
    Posted on May 17, 2011 at 13:32

    Hi ST,

    do you have an Idea how i can fix my problem?

    Florian

    tomas23
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 13:32

    Hi enke, the peripherals (DMA, ADC etc.) have their own ''peripheral'' reset (see ADC_DeInit, DMA_DeInit).

    After wake-up, reset these peripherals and reconfigure. Tell us if it solved the case.