STM32F411 Stop Mode下Flash两种模式,分别怎么控制进入?
STM32F411 Stop Mode下Flash两种模式,分别怎么控制进入?下图高亮部分就是Flash两种不同模式:
应该是的,可在STOP模式下进一步关闭FLASH Power
函数源码说明也很清除
/** @defgroup PWR_Group5 FLASH Power Down configuration functions
*@brief FLASH Power Down configuration functions
*
@verbatim
===============================================================================
##### FLASH Power Down configuration functions #####
===============================================================================
[..]
(+) By setting the FPDS bit in the PWR_CR register by using the
PWR_FlashPowerDownCmd() function, the Flash memory also enters power
down mode when the device enters Stop mode. When the Flash memory
is in power down mode, an additional startup delay is incurred when
waking up from Stop mode.
@endverbatim
* @{
*/
/**
* @briefEnables or disables the Flash Power Down in STOP mode.
* @paramNewState: new state of the Flash power mode.
* This parameter can be: ENABLE or DISABLE.
* @retval None
*/
void PWR_FlashPowerDownCmd(FunctionalState NewState)
{
/* Check the parameters */
assert_param(IS_FUNCTIONAL_STATE(NewState));
*(__IO uint32_t *) CR_FPDS_BB = (uint32_t)NewState;
} 我用的是标准库,现在用函数 PWR_FlashPowerDownCmd();参数填写ENABLE和DISABLE来开关进入这个两个模式,对吗? 我没用过这个函数,看文档的注释我的理解是这个意思。
进入停止模式,需要在调用指令前设置一些寄存器位,
STM32标准库把这部分的操作封装到PWR_EnterSTOPMode函数中了。
在停止模式中可以控制内部FLASH的供电,
控制FLASH是进入掉电状态还是正常供电状态,
这可以使用库函数PWR_FlashPowerDownCmd配置,
它其实只是封装了一个对FPDS寄存器位操作的语句,
要注意,这个函数需要在进入停止模式前被调用,
即应用时需要把它放在上面的PWR_EnterSTOPMode之前。
还要注意的是进入停止模式后,STM32的所有I/O都保持在停止前的状态,
而当它被唤醒时,STM32使用HSI作为系统时钟(16MHz)运行,
由于系统时钟会影响很多外设的工作状态,
所以一般我们在唤醒后会重新开启HSE,把系统时钟设置会原来的状态。
付上野火大神的教程:
http://www.cnblogs.com/firege/p/5806040.html
解决这类问题,送你三板斧:
1、datasheet、Reference manual;
2、STM32CubeMX
3、STM32CubeF4库,STM32F4 DSP and standard peripherals library
toofree 发表于 2018-2-11 10:13
解决这类问题,送你三板斧:
1、datasheet、Reference manual;
2、STM32CubeMX
感谢回复! 无薪税绵 发表于 2018-2-11 09:51
进入停止模式,需要在调用指令前设置一些寄存器位,
STM32标准库把这部分的操作封装到PWR_EnterSTOPMode函 ...
感谢回复! 请参考此帖中的图:ST线下培训(05-23成都站)STM32L476低功耗设计(一)
图中的使用方式介绍得很明确了
https://www.stmcu.org.cn/module/forum/data/attachment/forum/201706/13/234300gqm2rurazii3d3qr.jpg
搞了半天,原来是要在此帖回复相关的答疑,咋搞的?呵呵!~ ;P
页:
[1]
2