Power saving mode

Post here to discuss any new features, components, chips, etc, that you would like to see in Flowcode.
Post Reply
TheShadowOfTriumph
Posts: 22
http://meble-kuchenne.info.pl
Joined: Wed Feb 08, 2023 3:33 pm

Flowcode v10 Power saving mode

Post by TheShadowOfTriumph »

Hi everyone.

I'm currently building a battery-powered device, so it's only natural that I started exploring STOP MODE. Due to issues with the buttons in the simulator (they don't trigger the EXTI interrupt), I wanted to create a component with multiple checkboxes to indicate which STM32 blocks can be turned off and which events trigger the wake-up.
I believe this feature will be important and useful for use with various battery-powered devices.

chipfryer27
Valued Contributor
Posts: 1903
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 415 times
Been thanked: 639 times

Re: Power saving mode

Post by chipfryer27 »

Hi

Further to a previous reply I changed the target to a 32F030Nucleo64 and can simulate the interrupt. Which target are you using?

Regards
Attachments
IOC_Example_Nucleo64.fcfx
(13.37 KiB) Downloaded 89 times

TheShadowOfTriumph
Posts: 22
Joined: Wed Feb 08, 2023 3:33 pm

Re: Power saving mode

Post by TheShadowOfTriumph »

The update arrived now and the program works. I don't want to roll back.
The target is STM32F030F4P6.
Now, how about the STOP MODE?

BenR
Matrix Staff
Posts: 2122
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 563 times
Been thanked: 749 times

Re: Power saving mode

Post by BenR »

Hello,

You could try calling these using a C icon.

Code: Select all

HAL_SuspendTick();
HAL_PWREx_EnterSTOP0Mode(PWR_SLEEPENTRY_WFI);
Some information on it here.
https://deepbluembedded.com/stm32-stop- ... op1-stop2/

TheShadowOfTriumph
Posts: 22
Joined: Wed Feb 08, 2023 3:33 pm

Re: Power saving mode

Post by TheShadowOfTriumph »

After entering in STOP0, EXTI interrupt block is still working?

LeighM
Valued Contributor
Posts: 532
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 94 times
Been thanked: 287 times

Re: Power saving mode

Post by LeighM »

Here's a target demo ...
STM32F411BP_STOP_DEMO.fcfx
(9.99 KiB) Downloaded 9 times
Note, this won't simulate

LeighM
Valued Contributor
Posts: 532
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 94 times
Been thanked: 287 times

Re: Power saving mode

Post by LeighM »

This is the C icon code from the demo, it also compiles OK on 32F030,
I don't have 030 hardware to test it, although it worked fine on 411 so should also work on 030
Hope it helps

Code: Select all


// Example to enter Stop Mode
HAL_SuspendTick(); // Stop SysTick to prevent immediate wakeup
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
// NOW STOPPED
// WAKES HERE ON INTERRUPT (EXTI)
SystemClocksSetup(); // Resume high speed mode
HAL_ResumeTick();    // Resume SysTick 


Post Reply