797 views
in Platform Packages by
Hello fiends,

I can not find any instruction about power saving using your GUI library. For example even RTOS offers several approaches to reduce consumption with no drowback on performance. But using GUI it is not so easy because GUI "must" be alwais in free run as backgroung process.

It is also not easy to reduce system frequency because of SDRAM requirs frequent refreshing. Meanwhile Cortex-M have very simple power saving mehanisms - I can not use non of them. Particulary can I put somwhere WFI instruction into EW main loop?

I use STM32F429-DISCO, FreeRTOS

With best wishes

Alex

1 Answer

0 votes
by

Hi Alex,

maybe the article 'Suspend and Resume of an Embedded Wizard UI application' covers your question. Since the entire UI application is running in a cooperative model, you are free to drive the UI according your needs.

Best regards,

Manfred

by

Manfred, thank you for reply.

But I speak about different thing. I want to save power when application is running. I have application tasks which is using some calculation power, and now the rest is used by GUI. For example if I use 1% of CPU then 99% will be used by GUI. And most of the time GUI is doing nothing but running while loop, checking flags and so on, doing it on a very high speed...  This is not good, this is stupid... What is proposed in your advice could not be used, even parts of it, this is very inconvinient. GUI must know how much CPU power it is needed and give the rest to other tasks (or to OS).

Btw you may notice that your PC's fan is running with different speed, depending on calculation load. But your PC is ON, and still power saving works. I is not working in while (1) loop.  That what I am talking about.

 

by

Please have a look into the typical main-loop of every Embedded Wizard GUI application:

...
    /* refresh the screen, if something has changed and draw its content */
    if ( devices || timers || signals || events )
    {
      Update( viewport, rootObject );

      /* after each processed message start the garbage collection */
      EwReclaimMemory();
    }
    /* otherwise sleep/suspend the UI application until a certain event occurs or a timer expires... */
    else
      EwBspWaitForSystemEvent( EwNextTimerExpiration());
...

At the end of every loop cycle you will find the function call that either sleeps or gives the entire CPU time to the OS.

As long there are no pending events or timers, all the CPU time can be used to sleep or it can be consumed by other tasks.

 

by

Manfred, in such case I have just to add power saving in FreeRTOS idle hook and that's it.

void vApplicationIdleHook( void )
{
    __WFI();
}

When I do this consumption dropped signtificantly. But seems there some problem in Touch driver from ST. It hang the GUI thread after several touches. When I move GUI task priority to highest rank it works stable. 

BTW when GUI in low priority and Sleep mode in Idle Hook graphics are not best. The animation start to be not soft.

Thank you for explanation!

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...