2017-11-03 06:07 AM
Hallo,
Since I think that the use of auto generated code using MXcube helps a lot, I have a question regarding the best workflow to use in the following case.My board is powered by an external power source. In this state it works at full speed. When the external power source is disconnected, the MCU goes in standby to reduce the power consumtion because, in this state, it is powered by a coin cell. The only thing it has to do is wakeup (using the RTC) every 100 mS to check some gpio and then it has to go again in standby.there is a gpio that inform the MCU if it is powered by the button battery or by the external supply.In this case it seems to me that I need of two different MCU setup depending on wich power source is feeding the board.It is not an easy situation for MXCube, is it?Ideas?Thank you in advance.PaoloSolved! Go to Solution.
2017-11-03 06:57 AM
Hello!
In main function , just before call HAL_Init(), write some code (not using HAL) that enables GPIO pin and check the state. If met the proper condition, continue to initialize HAL or LL , else put it again to STBY.
A minimal piece of code with no extra clock configurations and no necessary peripherals initialization, helps to maintain the battery's life.
CubeMx produces a 'standard' type of initialization code and can't do this.
regards
vf
2017-11-03 06:57 AM
Hello!
In main function , just before call HAL_Init(), write some code (not using HAL) that enables GPIO pin and check the state. If met the proper condition, continue to initialize HAL or LL , else put it again to STBY.
A minimal piece of code with no extra clock configurations and no necessary peripherals initialization, helps to maintain the battery's life.
CubeMx produces a 'standard' type of initialization code and can't do this.
regards
vf
2017-11-03 08:24 AM
It was even my thought, but i were not so sure...
thank you very much