Implemented sleep mode.
This commit is contained in:
parent
361d5a74b6
commit
51e5fbce73
|
@ -22,6 +22,7 @@ set(C_SOURCES
|
||||||
"Core/Src/freertos.c"
|
"Core/Src/freertos.c"
|
||||||
"Core/Src/stm32f4xx_hal_timebase_tim.c"
|
"Core/Src/stm32f4xx_hal_timebase_tim.c"
|
||||||
"Core/Src/user_power_mgmt.c"
|
"Core/Src/user_power_mgmt.c"
|
||||||
|
"Core/Src/user_freertos_support.c"
|
||||||
)
|
)
|
||||||
# Copy them from Makefile
|
# Copy them from Makefile
|
||||||
set(ASM_SOURCES
|
set(ASM_SOURCES
|
||||||
|
|
|
@ -166,9 +166,14 @@ standard names. */
|
||||||
/* USER CODE BEGIN Defines */
|
/* USER CODE BEGIN Defines */
|
||||||
/* Section where parameter definitions can be added (for instance, to override default ones in FreeRTOS.h) */
|
/* Section where parameter definitions can be added (for instance, to override default ones in FreeRTOS.h) */
|
||||||
|
|
||||||
|
void vApplicationSleep(uint32_t xExpectedIdleTime);
|
||||||
|
|
||||||
/* Override CMSIS OS2 heap settings */
|
/* Override CMSIS OS2 heap settings */
|
||||||
#define configAPPLICATION_ALLOCATED_HEAP 1
|
#define configAPPLICATION_ALLOCATED_HEAP 1
|
||||||
|
|
||||||
|
#define configUSE_TICKLESS_IDLE 2
|
||||||
|
#define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vApplicationSleep(xExpectedIdleTime)
|
||||||
|
|
||||||
/* USER CODE END Defines */
|
/* USER CODE END Defines */
|
||||||
|
|
||||||
#endif /* FREERTOS_CONFIG_H */
|
#endif /* FREERTOS_CONFIG_H */
|
||||||
|
|
|
@ -58,6 +58,8 @@ void Error_Handler(void);
|
||||||
/* USER CODE END EFP */
|
/* USER CODE END EFP */
|
||||||
|
|
||||||
/* Private defines -----------------------------------------------------------*/
|
/* Private defines -----------------------------------------------------------*/
|
||||||
|
#define LED1_Pin GPIO_PIN_9
|
||||||
|
#define LED1_GPIO_Port GPIOF
|
||||||
/* USER CODE BEGIN Private defines */
|
/* USER CODE BEGIN Private defines */
|
||||||
|
|
||||||
/* USER CODE END Private defines */
|
/* USER CODE END Private defines */
|
||||||
|
|
|
@ -188,7 +188,7 @@
|
||||||
#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */
|
#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */
|
||||||
#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */
|
#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */
|
||||||
#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */
|
#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */
|
||||||
#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */
|
#define USE_HAL_TIM_REGISTER_CALLBACKS 1U /* TIM register callback enabled */
|
||||||
#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */
|
#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */
|
||||||
#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */
|
#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */
|
||||||
#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */
|
#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */
|
||||||
|
|
|
@ -53,6 +53,7 @@ void MemManage_Handler(void);
|
||||||
void BusFault_Handler(void);
|
void BusFault_Handler(void);
|
||||||
void UsageFault_Handler(void);
|
void UsageFault_Handler(void);
|
||||||
void DebugMon_Handler(void);
|
void DebugMon_Handler(void);
|
||||||
|
void TIM6_DAC_IRQHandler(void);
|
||||||
void TIM7_IRQHandler(void);
|
void TIM7_IRQHandler(void);
|
||||||
/* USER CODE BEGIN EFP */
|
/* USER CODE BEGIN EFP */
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,8 @@
|
||||||
/* Private variables ---------------------------------------------------------*/
|
/* Private variables ---------------------------------------------------------*/
|
||||||
RTC_HandleTypeDef hrtc;
|
RTC_HandleTypeDef hrtc;
|
||||||
|
|
||||||
|
TIM_HandleTypeDef htim6;
|
||||||
|
|
||||||
UART_HandleTypeDef huart1;
|
UART_HandleTypeDef huart1;
|
||||||
|
|
||||||
SRAM_HandleTypeDef hsram1;
|
SRAM_HandleTypeDef hsram1;
|
||||||
|
@ -75,6 +77,7 @@ static void MX_GPIO_Init(void);
|
||||||
static void MX_RTC_Init(void);
|
static void MX_RTC_Init(void);
|
||||||
static void MX_USART1_UART_Init(void);
|
static void MX_USART1_UART_Init(void);
|
||||||
static void MX_FSMC_Init(void);
|
static void MX_FSMC_Init(void);
|
||||||
|
static void MX_TIM6_Init(void);
|
||||||
void StartDefaultTask(void *argument);
|
void StartDefaultTask(void *argument);
|
||||||
|
|
||||||
/* USER CODE BEGIN PFP */
|
/* USER CODE BEGIN PFP */
|
||||||
|
@ -117,6 +120,7 @@ int main(void)
|
||||||
MX_RTC_Init();
|
MX_RTC_Init();
|
||||||
MX_USART1_UART_Init();
|
MX_USART1_UART_Init();
|
||||||
MX_FSMC_Init();
|
MX_FSMC_Init();
|
||||||
|
MX_TIM6_Init();
|
||||||
/* USER CODE BEGIN 2 */
|
/* USER CODE BEGIN 2 */
|
||||||
|
|
||||||
// Define heap region for heap_5.
|
// Define heap region for heap_5.
|
||||||
|
@ -279,6 +283,44 @@ static void MX_RTC_Init(void)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief TIM6 Initialization Function
|
||||||
|
* @param None
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
static void MX_TIM6_Init(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
/* USER CODE BEGIN TIM6_Init 0 */
|
||||||
|
|
||||||
|
/* USER CODE END TIM6_Init 0 */
|
||||||
|
|
||||||
|
TIM_MasterConfigTypeDef sMasterConfig = {0};
|
||||||
|
|
||||||
|
/* USER CODE BEGIN TIM6_Init 1 */
|
||||||
|
|
||||||
|
/* USER CODE END TIM6_Init 1 */
|
||||||
|
htim6.Instance = TIM6;
|
||||||
|
htim6.Init.Prescaler = 4000 - 1;
|
||||||
|
htim6.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||||
|
htim6.Init.Period = 1000;
|
||||||
|
htim6.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
|
||||||
|
if (HAL_TIM_Base_Init(&htim6) != HAL_OK)
|
||||||
|
{
|
||||||
|
Error_Handler();
|
||||||
|
}
|
||||||
|
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
|
||||||
|
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
|
||||||
|
if (HAL_TIMEx_MasterConfigSynchronization(&htim6, &sMasterConfig) != HAL_OK)
|
||||||
|
{
|
||||||
|
Error_Handler();
|
||||||
|
}
|
||||||
|
/* USER CODE BEGIN TIM6_Init 2 */
|
||||||
|
|
||||||
|
/* USER CODE END TIM6_Init 2 */
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief USART1 Initialization Function
|
* @brief USART1 Initialization Function
|
||||||
* @param None
|
* @param None
|
||||||
|
@ -319,6 +361,7 @@ static void MX_USART1_UART_Init(void)
|
||||||
*/
|
*/
|
||||||
static void MX_GPIO_Init(void)
|
static void MX_GPIO_Init(void)
|
||||||
{
|
{
|
||||||
|
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
||||||
|
|
||||||
/* GPIO Ports Clock Enable */
|
/* GPIO Ports Clock Enable */
|
||||||
__HAL_RCC_GPIOC_CLK_ENABLE();
|
__HAL_RCC_GPIOC_CLK_ENABLE();
|
||||||
|
@ -329,6 +372,16 @@ static void MX_GPIO_Init(void)
|
||||||
__HAL_RCC_GPIOD_CLK_ENABLE();
|
__HAL_RCC_GPIOD_CLK_ENABLE();
|
||||||
__HAL_RCC_GPIOA_CLK_ENABLE();
|
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||||
|
|
||||||
|
/*Configure GPIO pin Output Level */
|
||||||
|
HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, GPIO_PIN_SET);
|
||||||
|
|
||||||
|
/*Configure GPIO pin : LED1_Pin */
|
||||||
|
GPIO_InitStruct.Pin = LED1_Pin;
|
||||||
|
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||||
|
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||||
|
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||||
|
HAL_GPIO_Init(LED1_GPIO_Port, &GPIO_InitStruct);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FSMC initialization function */
|
/* FSMC initialization function */
|
||||||
|
@ -390,6 +443,15 @@ void _putchar(char character) {
|
||||||
HAL_UART_Transmit(&huart1, (uint8_t *)&character, 1, 1000);
|
HAL_UART_Transmit(&huart1, (uint8_t *)&character, 1, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void user_pm_frequency_update_callback(void) {
|
||||||
|
// STM32Cube relies on the systick timer for FreeRTOS tick, update anyway.
|
||||||
|
// A timing jitter may occur.
|
||||||
|
SysTick_Config(configCPU_CLOCK_HZ / configTICK_RATE_HZ);
|
||||||
|
|
||||||
|
// Other peripherals also needs to be updated.
|
||||||
|
HAL_UART_Init(&huart1);
|
||||||
|
}
|
||||||
|
|
||||||
static void update_frequency_profile(user_pm_vfs_preset_t profile) {
|
static void update_frequency_profile(user_pm_vfs_preset_t profile) {
|
||||||
|
|
||||||
// Do not switch my context out.
|
// Do not switch my context out.
|
||||||
|
@ -397,22 +459,16 @@ static void update_frequency_profile(user_pm_vfs_preset_t profile) {
|
||||||
|
|
||||||
// Scale frequency.
|
// Scale frequency.
|
||||||
user_pm_scale_vfs(profile);
|
user_pm_scale_vfs(profile);
|
||||||
// STM32Cube relies on the systick timer for FreeRTOS tick, update anyway.
|
|
||||||
// A timing jitter may occur.
|
|
||||||
SysTick_Config(configCPU_CLOCK_HZ / configTICK_RATE_HZ);
|
|
||||||
|
|
||||||
// Other peripherals also needs to be updated.
|
|
||||||
HAL_UART_Init(&huart1);
|
|
||||||
|
|
||||||
taskEXIT_CRITICAL();
|
taskEXIT_CRITICAL();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void report_system_frequencies(void) {
|
static void report_system_frequencies(void) {
|
||||||
printf("======== Report System Clock Frequencies ========\r\n");
|
printf("======== Report System Clock Frequencies ========\r\n");
|
||||||
printf("[%012u] SYSCLK: %012uHz\r\n", xTaskGetTickCount(), HAL_RCC_GetSysClockFreq());
|
printf("[%012u] SYSCLK: %uMHz\t", xTaskGetTickCount(), HAL_RCC_GetSysClockFreq() / 1000000);
|
||||||
printf("[%012u] HCLK: %012uHz\r\n", xTaskGetTickCount(), HAL_RCC_GetHCLKFreq());
|
printf("HCLK: %uMHz\t", HAL_RCC_GetHCLKFreq() / 1000000);
|
||||||
printf("[%012u] PCLK1: %012uHz\r\n", xTaskGetTickCount(), HAL_RCC_GetPCLK1Freq());
|
printf("PCLK1: %uMHz\t", HAL_RCC_GetPCLK1Freq() / 1000000);
|
||||||
printf("[%012u] PCLK2: %012uHz\r\n", xTaskGetTickCount(), HAL_RCC_GetPCLK2Freq());
|
printf("PCLK2: %uMHz\r\n", HAL_RCC_GetPCLK2Freq() / 1000000);
|
||||||
printf("================== Report Done ==================\r\n");
|
printf("================== Report Done ==================\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -432,15 +488,14 @@ void StartDefaultTask(void *argument)
|
||||||
HeapStats_t stats;
|
HeapStats_t stats;
|
||||||
vPortGetHeapStats(&stats);
|
vPortGetHeapStats(&stats);
|
||||||
printf("Heap available: %d bytes.\r\n", stats.xAvailableHeapSpaceInBytes);
|
printf("Heap available: %d bytes.\r\n", stats.xAvailableHeapSpaceInBytes);
|
||||||
|
update_frequency_profile(USER_PM_VFS_LOW_1);
|
||||||
|
|
||||||
/* Infinite loop */
|
/* Infinite loop */
|
||||||
for(;;)
|
for(;;)
|
||||||
{
|
{
|
||||||
for(uint8_t i = USER_PM_VFS_SAFE + 1; i < USER_PM_VFS_END; i++) {
|
report_system_frequencies();
|
||||||
update_frequency_profile(i);
|
HAL_GPIO_TogglePin(LED1_GPIO_Port, LED1_Pin);
|
||||||
report_system_frequencies();
|
osDelay(1000);
|
||||||
osDelay(5000);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/* USER CODE END 5 */
|
/* USER CODE END 5 */
|
||||||
}
|
}
|
||||||
|
|
|
@ -133,6 +133,56 @@ void HAL_RTC_MspDeInit(RTC_HandleTypeDef* hrtc)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief TIM_Base MSP Initialization
|
||||||
|
* This function configures the hardware resources used in this example
|
||||||
|
* @param htim_base: TIM_Base handle pointer
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* htim_base)
|
||||||
|
{
|
||||||
|
if(htim_base->Instance==TIM6)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN TIM6_MspInit 0 */
|
||||||
|
|
||||||
|
/* USER CODE END TIM6_MspInit 0 */
|
||||||
|
/* Peripheral clock enable */
|
||||||
|
__HAL_RCC_TIM6_CLK_ENABLE();
|
||||||
|
/* TIM6 interrupt Init */
|
||||||
|
HAL_NVIC_SetPriority(TIM6_DAC_IRQn, 5, 0);
|
||||||
|
HAL_NVIC_EnableIRQ(TIM6_DAC_IRQn);
|
||||||
|
/* USER CODE BEGIN TIM6_MspInit 1 */
|
||||||
|
|
||||||
|
/* USER CODE END TIM6_MspInit 1 */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief TIM_Base MSP De-Initialization
|
||||||
|
* This function freeze the hardware resources used in this example
|
||||||
|
* @param htim_base: TIM_Base handle pointer
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* htim_base)
|
||||||
|
{
|
||||||
|
if(htim_base->Instance==TIM6)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN TIM6_MspDeInit 0 */
|
||||||
|
|
||||||
|
/* USER CODE END TIM6_MspDeInit 0 */
|
||||||
|
/* Peripheral clock disable */
|
||||||
|
__HAL_RCC_TIM6_CLK_DISABLE();
|
||||||
|
|
||||||
|
/* TIM6 interrupt DeInit */
|
||||||
|
HAL_NVIC_DisableIRQ(TIM6_DAC_IRQn);
|
||||||
|
/* USER CODE BEGIN TIM6_MspDeInit 1 */
|
||||||
|
|
||||||
|
/* USER CODE END TIM6_MspDeInit 1 */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief UART MSP Initialization
|
* @brief UART MSP Initialization
|
||||||
* This function configures the hardware resources used in this example
|
* This function configures the hardware resources used in this example
|
||||||
|
|
|
@ -56,6 +56,7 @@
|
||||||
/* USER CODE END 0 */
|
/* USER CODE END 0 */
|
||||||
|
|
||||||
/* External variables --------------------------------------------------------*/
|
/* External variables --------------------------------------------------------*/
|
||||||
|
extern TIM_HandleTypeDef htim6;
|
||||||
extern TIM_HandleTypeDef htim7;
|
extern TIM_HandleTypeDef htim7;
|
||||||
|
|
||||||
/* USER CODE BEGIN EV */
|
/* USER CODE BEGIN EV */
|
||||||
|
@ -161,6 +162,20 @@ void DebugMon_Handler(void)
|
||||||
/* please refer to the startup file (startup_stm32f4xx.s). */
|
/* please refer to the startup file (startup_stm32f4xx.s). */
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function handles TIM6 global interrupt, DAC1 and DAC2 underrun error interrupts.
|
||||||
|
*/
|
||||||
|
void TIM6_DAC_IRQHandler(void)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN TIM6_DAC_IRQn 0 */
|
||||||
|
|
||||||
|
/* USER CODE END TIM6_DAC_IRQn 0 */
|
||||||
|
HAL_TIM_IRQHandler(&htim6);
|
||||||
|
/* USER CODE BEGIN TIM6_DAC_IRQn 1 */
|
||||||
|
|
||||||
|
/* USER CODE END TIM6_DAC_IRQn 1 */
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This function handles TIM7 global interrupt.
|
* @brief This function handles TIM7 global interrupt.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
#include "FreeRTOS.h"
|
||||||
|
#include "task.h"
|
||||||
|
|
||||||
|
#include "stm32f4xx_hal.h"
|
||||||
|
|
||||||
|
#include "user_power_mgmt.h"
|
||||||
|
|
||||||
|
void vApplicationSleep(uint32_t xExpectedIdleTime) {
|
||||||
|
// Enter a critical section
|
||||||
|
__disable_irq();
|
||||||
|
|
||||||
|
eSleepModeStatus eSleepStatus = eTaskConfirmSleepModeStatus();
|
||||||
|
if(eSleepStatus == eAbortSleep) {
|
||||||
|
// Do nothing, just return.
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
uint32_t actual_ms = user_pm_idle_timeout(xExpectedIdleTime / portTICK_RATE_MS);
|
||||||
|
vTaskStepTick(actual_ms);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Exit critical section
|
||||||
|
__enable_irq();
|
||||||
|
}
|
|
@ -1,6 +1,10 @@
|
||||||
#include "stm32f4xx_hal.h"
|
#include "stm32f4xx_hal.h"
|
||||||
#include "user_power_mgmt.h"
|
#include "user_power_mgmt.h"
|
||||||
|
|
||||||
|
extern TIM_HandleTypeDef htim6;
|
||||||
|
|
||||||
|
void user_pm_frequency_update_callback(void);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
RCC_OscInitTypeDef RCC_OscInitStruct;
|
RCC_OscInitTypeDef RCC_OscInitStruct;
|
||||||
RCC_ClkInitTypeDef RCC_ClkInitStruct;
|
RCC_ClkInitTypeDef RCC_ClkInitStruct;
|
||||||
|
@ -10,18 +14,16 @@ typedef struct {
|
||||||
|
|
||||||
#include "user_power_mgmt_profiles.h"
|
#include "user_power_mgmt_profiles.h"
|
||||||
|
|
||||||
|
static user_pm_vfs_preset_t s_current_preset;
|
||||||
|
|
||||||
static void user_pm_error_handler(void) {
|
static void user_pm_error_handler(void) {
|
||||||
while(1) {
|
while(1) {
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void user_pm_enter_sleep(void) {
|
static void user_pm_tim_callback(TIM_HandleTypeDef *htim) {
|
||||||
//
|
// No idea for now, just keep it.
|
||||||
}
|
|
||||||
|
|
||||||
static void user_pm_exit_sleep(void) {
|
|
||||||
//
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -80,6 +82,12 @@ HAL_StatusTypeDef user_pm_scale_vfs(user_pm_vfs_preset_t preset) {
|
||||||
// Update global variables
|
// Update global variables
|
||||||
SystemCoreClockUpdate();
|
SystemCoreClockUpdate();
|
||||||
|
|
||||||
|
// This will happen in a critical section, no context switch will occur.
|
||||||
|
s_current_preset = preset;
|
||||||
|
|
||||||
|
// Call user defined callbacks.
|
||||||
|
user_pm_frequency_update_callback();
|
||||||
|
|
||||||
return HAL_OK;
|
return HAL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,5 +98,40 @@ HAL_StatusTypeDef user_pm_scale_vfs(user_pm_vfs_preset_t preset) {
|
||||||
* @return Time actually in sleep mode
|
* @return Time actually in sleep mode
|
||||||
*/
|
*/
|
||||||
uint32_t user_pm_idle_timeout(uint32_t sleep_msec) {
|
uint32_t user_pm_idle_timeout(uint32_t sleep_msec) {
|
||||||
return 0;
|
user_pm_vfs_preset_t prev_preset = s_current_preset;
|
||||||
|
|
||||||
|
if(user_pm_scale_vfs(USER_PM_VFS_XLOW_2) != HAL_OK) {
|
||||||
|
user_pm_error_handler();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(sleep_msec > 65535) sleep_msec = 65535; // Cap. Maximum to 65535ms.
|
||||||
|
if(sleep_msec == 0) sleep_msec = 1;
|
||||||
|
|
||||||
|
// Configure TIM6 period.
|
||||||
|
htim6.Init.Period = sleep_msec;
|
||||||
|
HAL_TIM_Base_Init(&htim6);
|
||||||
|
HAL_TIM_RegisterCallback(&htim6, HAL_TIM_PERIOD_ELAPSED_CB_ID, user_pm_tim_callback);
|
||||||
|
|
||||||
|
// SysTick uses TIM7, disable TIM7 interrupt.
|
||||||
|
HAL_SuspendTick();
|
||||||
|
|
||||||
|
HAL_TIM_Base_Start_IT(&htim6);
|
||||||
|
|
||||||
|
__WFI();
|
||||||
|
|
||||||
|
HAL_TIM_Base_Stop_IT(&htim6);
|
||||||
|
|
||||||
|
HAL_ResumeTick();
|
||||||
|
|
||||||
|
// Restore previous VFS profile
|
||||||
|
if(user_pm_scale_vfs(prev_preset) != HAL_OK) {
|
||||||
|
user_pm_error_handler();
|
||||||
|
}
|
||||||
|
|
||||||
|
// In case we woken up by another interrupt, return actual sleep'd time.
|
||||||
|
return __HAL_TIM_GET_COUNTER(&htim6);
|
||||||
|
}
|
||||||
|
|
||||||
|
__weak void user_pm_frequency_update_callback(void) {
|
||||||
|
// User application will implement this.
|
||||||
}
|
}
|
2
Makefile
2
Makefile
|
@ -1,5 +1,5 @@
|
||||||
##########################################################################################################################
|
##########################################################################################################################
|
||||||
# File automatically-generated by tool: [projectgenerator] version: [3.14.1] date: [Tue Aug 24 20:18:03 CST 2021]
|
# File automatically-generated by tool: [projectgenerator] version: [3.14.1] date: [Wed Aug 25 02:18:49 CST 2021]
|
||||||
##########################################################################################################################
|
##########################################################################################################################
|
||||||
|
|
||||||
# ------------------------------------------------
|
# ------------------------------------------------
|
||||||
|
|
|
@ -20,63 +20,66 @@ Mcu.IP2=NVIC
|
||||||
Mcu.IP3=RCC
|
Mcu.IP3=RCC
|
||||||
Mcu.IP4=RTC
|
Mcu.IP4=RTC
|
||||||
Mcu.IP5=SYS
|
Mcu.IP5=SYS
|
||||||
Mcu.IP6=USART1
|
Mcu.IP6=TIM6
|
||||||
Mcu.IPNb=7
|
Mcu.IP7=USART1
|
||||||
|
Mcu.IPNb=8
|
||||||
Mcu.Name=STM32F407Z(E-G)Tx
|
Mcu.Name=STM32F407Z(E-G)Tx
|
||||||
Mcu.Package=LQFP144
|
Mcu.Package=LQFP144
|
||||||
Mcu.Pin0=PC14-OSC32_IN
|
Mcu.Pin0=PC14-OSC32_IN
|
||||||
Mcu.Pin1=PC15-OSC32_OUT
|
Mcu.Pin1=PC15-OSC32_OUT
|
||||||
Mcu.Pin10=PF12
|
Mcu.Pin10=PH1-OSC_OUT
|
||||||
Mcu.Pin11=PF13
|
Mcu.Pin11=PF12
|
||||||
Mcu.Pin12=PF14
|
Mcu.Pin12=PF13
|
||||||
Mcu.Pin13=PF15
|
Mcu.Pin13=PF14
|
||||||
Mcu.Pin14=PG0
|
Mcu.Pin14=PF15
|
||||||
Mcu.Pin15=PG1
|
Mcu.Pin15=PG0
|
||||||
Mcu.Pin16=PE7
|
Mcu.Pin16=PG1
|
||||||
Mcu.Pin17=PE8
|
Mcu.Pin17=PE7
|
||||||
Mcu.Pin18=PE9
|
Mcu.Pin18=PE8
|
||||||
Mcu.Pin19=PE10
|
Mcu.Pin19=PE9
|
||||||
Mcu.Pin2=PF0
|
Mcu.Pin2=PF0
|
||||||
Mcu.Pin20=PE11
|
Mcu.Pin20=PE10
|
||||||
Mcu.Pin21=PE12
|
Mcu.Pin21=PE11
|
||||||
Mcu.Pin22=PE13
|
Mcu.Pin22=PE12
|
||||||
Mcu.Pin23=PE14
|
Mcu.Pin23=PE13
|
||||||
Mcu.Pin24=PE15
|
Mcu.Pin24=PE14
|
||||||
Mcu.Pin25=PD8
|
Mcu.Pin25=PE15
|
||||||
Mcu.Pin26=PD9
|
Mcu.Pin26=PD8
|
||||||
Mcu.Pin27=PD10
|
Mcu.Pin27=PD9
|
||||||
Mcu.Pin28=PD11
|
Mcu.Pin28=PD10
|
||||||
Mcu.Pin29=PD12
|
Mcu.Pin29=PD11
|
||||||
Mcu.Pin3=PF1
|
Mcu.Pin3=PF1
|
||||||
Mcu.Pin30=PD13
|
Mcu.Pin30=PD12
|
||||||
Mcu.Pin31=PD14
|
Mcu.Pin31=PD13
|
||||||
Mcu.Pin32=PD15
|
Mcu.Pin32=PD14
|
||||||
Mcu.Pin33=PG2
|
Mcu.Pin33=PD15
|
||||||
Mcu.Pin34=PG3
|
Mcu.Pin34=PG2
|
||||||
Mcu.Pin35=PG4
|
Mcu.Pin35=PG3
|
||||||
Mcu.Pin36=PG5
|
Mcu.Pin36=PG4
|
||||||
Mcu.Pin37=PA9
|
Mcu.Pin37=PG5
|
||||||
Mcu.Pin38=PA10
|
Mcu.Pin38=PA9
|
||||||
Mcu.Pin39=PA13
|
Mcu.Pin39=PA10
|
||||||
Mcu.Pin4=PF2
|
Mcu.Pin4=PF2
|
||||||
Mcu.Pin40=PA14
|
Mcu.Pin40=PA13
|
||||||
Mcu.Pin41=PD0
|
Mcu.Pin41=PA14
|
||||||
Mcu.Pin42=PD1
|
Mcu.Pin42=PD0
|
||||||
Mcu.Pin43=PD4
|
Mcu.Pin43=PD1
|
||||||
Mcu.Pin44=PD5
|
Mcu.Pin44=PD4
|
||||||
Mcu.Pin45=PG10
|
Mcu.Pin45=PD5
|
||||||
Mcu.Pin46=PE0
|
Mcu.Pin46=PG10
|
||||||
Mcu.Pin47=PE1
|
Mcu.Pin47=PE0
|
||||||
Mcu.Pin48=VP_FREERTOS_VS_CMSIS_V2
|
Mcu.Pin48=PE1
|
||||||
Mcu.Pin49=VP_RTC_VS_RTC_Activate
|
Mcu.Pin49=VP_FREERTOS_VS_CMSIS_V2
|
||||||
Mcu.Pin5=PF3
|
Mcu.Pin5=PF3
|
||||||
Mcu.Pin50=VP_RTC_VS_RTC_Calendar
|
Mcu.Pin50=VP_RTC_VS_RTC_Activate
|
||||||
Mcu.Pin51=VP_SYS_VS_tim7
|
Mcu.Pin51=VP_RTC_VS_RTC_Calendar
|
||||||
|
Mcu.Pin52=VP_SYS_VS_tim7
|
||||||
|
Mcu.Pin53=VP_TIM6_VS_ClockSourceINT
|
||||||
Mcu.Pin6=PF4
|
Mcu.Pin6=PF4
|
||||||
Mcu.Pin7=PF5
|
Mcu.Pin7=PF5
|
||||||
Mcu.Pin8=PH0-OSC_IN
|
Mcu.Pin8=PF9
|
||||||
Mcu.Pin9=PH1-OSC_OUT
|
Mcu.Pin9=PH0-OSC_IN
|
||||||
Mcu.PinsNb=52
|
Mcu.PinsNb=54
|
||||||
Mcu.ThirdPartyNb=0
|
Mcu.ThirdPartyNb=0
|
||||||
Mcu.UserConstants=
|
Mcu.UserConstants=
|
||||||
Mcu.UserName=STM32F407ZETx
|
Mcu.UserName=STM32F407ZETx
|
||||||
|
@ -95,6 +98,7 @@ NVIC.SavedPendsvIrqHandlerGenerated=true
|
||||||
NVIC.SavedSvcallIrqHandlerGenerated=true
|
NVIC.SavedSvcallIrqHandlerGenerated=true
|
||||||
NVIC.SavedSystickIrqHandlerGenerated=true
|
NVIC.SavedSystickIrqHandlerGenerated=true
|
||||||
NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:false\:true\:false\:true
|
NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:false\:true\:false\:true
|
||||||
|
NVIC.TIM6_DAC_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true
|
||||||
NVIC.TIM7_IRQn=true\:15\:0\:false\:false\:true\:false\:false\:true
|
NVIC.TIM7_IRQn=true\:15\:0\:false\:false\:true\:false\:false\:true
|
||||||
NVIC.TimeBase=TIM7_IRQn
|
NVIC.TimeBase=TIM7_IRQn
|
||||||
NVIC.TimeBaseIP=TIM7
|
NVIC.TimeBaseIP=TIM7
|
||||||
|
@ -115,23 +119,23 @@ PCC.Checker=false
|
||||||
PCC.Line=STM32F407/417
|
PCC.Line=STM32F407/417
|
||||||
PCC.MCU=STM32F407Z(E-G)Tx
|
PCC.MCU=STM32F407Z(E-G)Tx
|
||||||
PCC.PartNumber=STM32F407ZETx
|
PCC.PartNumber=STM32F407ZETx
|
||||||
PCC.Seq0=7
|
PCC.Seq0=10
|
||||||
PCC.Seq0.Step0.Average_Current=46 mA
|
PCC.Seq0.Step0.Average_Current=45.48 mA
|
||||||
PCC.Seq0.Step0.CPU_Frequency=168 MHz
|
PCC.Seq0.Step0.CPU_Frequency=168 MHz
|
||||||
PCC.Seq0.Step0.Category=In DS Table
|
PCC.Seq0.Step0.Category=In DS Table
|
||||||
PCC.Seq0.Step0.DMIPS=210.0
|
PCC.Seq0.Step0.DMIPS=210.0
|
||||||
PCC.Seq0.Step0.Duration=10 ms
|
PCC.Seq0.Step0.Duration=10 ms
|
||||||
PCC.Seq0.Step0.Frequency=4 MHz
|
PCC.Seq0.Step0.Frequency=4 MHz
|
||||||
PCC.Seq0.Step0.Memory=FLASH
|
PCC.Seq0.Step0.Memory=RAM/FLASH/ART
|
||||||
PCC.Seq0.Step0.Mode=RUN
|
PCC.Seq0.Step0.Mode=RUN
|
||||||
PCC.Seq0.Step0.Oscillator=HSE PLL
|
PCC.Seq0.Step0.Oscillator=HSE PLL
|
||||||
PCC.Seq0.Step0.Peripherals=
|
PCC.Seq0.Step0.Peripherals=FSMC GPIOA GPIOC GPIOD GPIOE GPIOF GPIOG GPIOH RTC SYS USART1
|
||||||
PCC.Seq0.Step0.TaMax=98.93
|
PCC.Seq0.Step0.TaMax=99
|
||||||
PCC.Seq0.Step0.User's_Consumption=0 mA
|
PCC.Seq0.Step0.User's_Consumption=0 mA
|
||||||
PCC.Seq0.Step0.Vcore=Scale1-High
|
PCC.Seq0.Step0.Vcore=Scale1-High
|
||||||
PCC.Seq0.Step0.Vdd=3.3
|
PCC.Seq0.Step0.Vdd=3.3
|
||||||
PCC.Seq0.Step0.Voltage_Source=Battery
|
PCC.Seq0.Step0.Voltage_Source=Battery
|
||||||
PCC.Seq0.Step1.Average_Current=31 mA
|
PCC.Seq0.Step1.Average_Current=35.25 mA
|
||||||
PCC.Seq0.Step1.CPU_Frequency=144 MHz
|
PCC.Seq0.Step1.CPU_Frequency=144 MHz
|
||||||
PCC.Seq0.Step1.Category=In DS Table
|
PCC.Seq0.Step1.Category=In DS Table
|
||||||
PCC.Seq0.Step1.DMIPS=180.0
|
PCC.Seq0.Step1.DMIPS=180.0
|
||||||
|
@ -140,13 +144,13 @@ PCC.Seq0.Step1.Frequency=4 MHz
|
||||||
PCC.Seq0.Step1.Memory=RAM/FLASH/ART
|
PCC.Seq0.Step1.Memory=RAM/FLASH/ART
|
||||||
PCC.Seq0.Step1.Mode=RUN
|
PCC.Seq0.Step1.Mode=RUN
|
||||||
PCC.Seq0.Step1.Oscillator=HSE PLL
|
PCC.Seq0.Step1.Oscillator=HSE PLL
|
||||||
PCC.Seq0.Step1.Peripherals=
|
PCC.Seq0.Step1.Peripherals=FSMC GPIOA GPIOC GPIOD GPIOE GPIOF GPIOG GPIOH RTC SYS USART1
|
||||||
PCC.Seq0.Step1.TaMax=100.91
|
PCC.Seq0.Step1.TaMax=100.35
|
||||||
PCC.Seq0.Step1.User's_Consumption=0 mA
|
PCC.Seq0.Step1.User's_Consumption=0 mA
|
||||||
PCC.Seq0.Step1.Vcore=Scale2-Medium
|
PCC.Seq0.Step1.Vcore=Scale2-Medium
|
||||||
PCC.Seq0.Step1.Vdd=3.3
|
PCC.Seq0.Step1.Vdd=3.3
|
||||||
PCC.Seq0.Step1.Voltage_Source=Battery
|
PCC.Seq0.Step1.Voltage_Source=Battery
|
||||||
PCC.Seq0.Step2.Average_Current=18.8 mA
|
PCC.Seq0.Step2.Average_Current=21.28 mA
|
||||||
PCC.Seq0.Step2.CPU_Frequency=84000000 Hz
|
PCC.Seq0.Step2.CPU_Frequency=84000000 Hz
|
||||||
PCC.Seq0.Step2.Category=Interpolation
|
PCC.Seq0.Step2.Category=Interpolation
|
||||||
PCC.Seq0.Step2.DMIPS=105.0
|
PCC.Seq0.Step2.DMIPS=105.0
|
||||||
|
@ -155,13 +159,13 @@ PCC.Seq0.Step2.Frequency=4 MHz
|
||||||
PCC.Seq0.Step2.Memory=RAM/FLASH/ART
|
PCC.Seq0.Step2.Memory=RAM/FLASH/ART
|
||||||
PCC.Seq0.Step2.Mode=RUN
|
PCC.Seq0.Step2.Mode=RUN
|
||||||
PCC.Seq0.Step2.Oscillator=HSE PLL
|
PCC.Seq0.Step2.Oscillator=HSE PLL
|
||||||
PCC.Seq0.Step2.Peripherals=
|
PCC.Seq0.Step2.Peripherals=FSMC GPIOA GPIOC GPIOD GPIOE GPIOF GPIOG GPIOH RTC SYS USART1
|
||||||
PCC.Seq0.Step2.TaMax=102.52
|
PCC.Seq0.Step2.TaMax=102.19
|
||||||
PCC.Seq0.Step2.User's_Consumption=0 mA
|
PCC.Seq0.Step2.User's_Consumption=0 mA
|
||||||
PCC.Seq0.Step2.Vcore=Scale2-Medium
|
PCC.Seq0.Step2.Vcore=Scale2-Medium
|
||||||
PCC.Seq0.Step2.Vdd=3.3
|
PCC.Seq0.Step2.Vdd=3.3
|
||||||
PCC.Seq0.Step2.Voltage_Source=Battery
|
PCC.Seq0.Step2.Voltage_Source=Battery
|
||||||
PCC.Seq0.Step3.Average_Current=14.8 mA
|
PCC.Seq0.Step3.Average_Current=16.69 mA
|
||||||
PCC.Seq0.Step3.CPU_Frequency=64000000 Hz
|
PCC.Seq0.Step3.CPU_Frequency=64000000 Hz
|
||||||
PCC.Seq0.Step3.Category=Interpolation
|
PCC.Seq0.Step3.Category=Interpolation
|
||||||
PCC.Seq0.Step3.DMIPS=80.0
|
PCC.Seq0.Step3.DMIPS=80.0
|
||||||
|
@ -170,13 +174,13 @@ PCC.Seq0.Step3.Frequency=4 MHz
|
||||||
PCC.Seq0.Step3.Memory=RAM/FLASH/ART
|
PCC.Seq0.Step3.Memory=RAM/FLASH/ART
|
||||||
PCC.Seq0.Step3.Mode=RUN
|
PCC.Seq0.Step3.Mode=RUN
|
||||||
PCC.Seq0.Step3.Oscillator=HSE PLL
|
PCC.Seq0.Step3.Oscillator=HSE PLL
|
||||||
PCC.Seq0.Step3.Peripherals=
|
PCC.Seq0.Step3.Peripherals=FSMC GPIOA GPIOC GPIOD GPIOE GPIOF GPIOG GPIOH RTC SYS USART1
|
||||||
PCC.Seq0.Step3.TaMax=103.05
|
PCC.Seq0.Step3.TaMax=102.8
|
||||||
PCC.Seq0.Step3.User's_Consumption=0 mA
|
PCC.Seq0.Step3.User's_Consumption=0 mA
|
||||||
PCC.Seq0.Step3.Vcore=Scale2-Medium
|
PCC.Seq0.Step3.Vcore=Scale2-Medium
|
||||||
PCC.Seq0.Step3.Vdd=3.3
|
PCC.Seq0.Step3.Vdd=3.3
|
||||||
PCC.Seq0.Step3.Voltage_Source=Battery
|
PCC.Seq0.Step3.Voltage_Source=Battery
|
||||||
PCC.Seq0.Step4.Average_Current=8.4 mA
|
PCC.Seq0.Step4.Average_Current=9.34 mA
|
||||||
PCC.Seq0.Step4.CPU_Frequency=32000000 Hz
|
PCC.Seq0.Step4.CPU_Frequency=32000000 Hz
|
||||||
PCC.Seq0.Step4.Category=Interpolation
|
PCC.Seq0.Step4.Category=Interpolation
|
||||||
PCC.Seq0.Step4.DMIPS=40.0
|
PCC.Seq0.Step4.DMIPS=40.0
|
||||||
|
@ -185,13 +189,13 @@ PCC.Seq0.Step4.Frequency=4 MHz
|
||||||
PCC.Seq0.Step4.Memory=RAM/FLASH/ART
|
PCC.Seq0.Step4.Memory=RAM/FLASH/ART
|
||||||
PCC.Seq0.Step4.Mode=RUN
|
PCC.Seq0.Step4.Mode=RUN
|
||||||
PCC.Seq0.Step4.Oscillator=HSE PLL
|
PCC.Seq0.Step4.Oscillator=HSE PLL
|
||||||
PCC.Seq0.Step4.Peripherals=
|
PCC.Seq0.Step4.Peripherals=FSMC GPIOA GPIOC GPIOD GPIOE GPIOF GPIOG GPIOH RTC SYS USART1
|
||||||
PCC.Seq0.Step4.TaMax=103.89
|
PCC.Seq0.Step4.TaMax=103.77
|
||||||
PCC.Seq0.Step4.User's_Consumption=0 mA
|
PCC.Seq0.Step4.User's_Consumption=0 mA
|
||||||
PCC.Seq0.Step4.Vcore=Scale2-Medium
|
PCC.Seq0.Step4.Vcore=Scale2-Medium
|
||||||
PCC.Seq0.Step4.Vdd=3.3
|
PCC.Seq0.Step4.Vdd=3.3
|
||||||
PCC.Seq0.Step4.Voltage_Source=Battery
|
PCC.Seq0.Step4.Voltage_Source=Battery
|
||||||
PCC.Seq0.Step5.Average_Current=2 mA
|
PCC.Seq0.Step5.Average_Current=2.07 mA
|
||||||
PCC.Seq0.Step5.CPU_Frequency=2400000 Hz
|
PCC.Seq0.Step5.CPU_Frequency=2400000 Hz
|
||||||
PCC.Seq0.Step5.Category=Interpolation
|
PCC.Seq0.Step5.Category=Interpolation
|
||||||
PCC.Seq0.Step5.DMIPS=3.0
|
PCC.Seq0.Step5.DMIPS=3.0
|
||||||
|
@ -200,27 +204,72 @@ PCC.Seq0.Step5.Frequency=2.4 MHz
|
||||||
PCC.Seq0.Step5.Memory=RAM/FLASH/ART
|
PCC.Seq0.Step5.Memory=RAM/FLASH/ART
|
||||||
PCC.Seq0.Step5.Mode=RUN
|
PCC.Seq0.Step5.Mode=RUN
|
||||||
PCC.Seq0.Step5.Oscillator=HSE
|
PCC.Seq0.Step5.Oscillator=HSE
|
||||||
PCC.Seq0.Step5.Peripherals=
|
PCC.Seq0.Step5.Peripherals=FSMC GPIOA GPIOC GPIOD GPIOE GPIOF GPIOG GPIOH RTC SYS USART1
|
||||||
PCC.Seq0.Step5.TaMax=104.74
|
PCC.Seq0.Step5.TaMax=104.73
|
||||||
PCC.Seq0.Step5.User's_Consumption=0 mA
|
PCC.Seq0.Step5.User's_Consumption=0 mA
|
||||||
PCC.Seq0.Step5.Vcore=Scale2-Medium
|
PCC.Seq0.Step5.Vcore=Scale2-Medium
|
||||||
PCC.Seq0.Step5.Vdd=3.3
|
PCC.Seq0.Step5.Vdd=3.3
|
||||||
PCC.Seq0.Step5.Voltage_Source=Battery
|
PCC.Seq0.Step5.Voltage_Source=Battery
|
||||||
PCC.Seq0.Step6.Average_Current=2 mA
|
PCC.Seq0.Step6.Average_Current=3.24 mA
|
||||||
PCC.Seq0.Step6.CPU_Frequency=16 MHz
|
PCC.Seq0.Step6.CPU_Frequency=8 MHz
|
||||||
PCC.Seq0.Step6.Category=In DS Table
|
PCC.Seq0.Step6.Category=In DS Table
|
||||||
PCC.Seq0.Step6.DMIPS=20.0
|
PCC.Seq0.Step6.DMIPS=10.0
|
||||||
PCC.Seq0.Step6.Duration=940 ms
|
PCC.Seq0.Step6.Duration=10 ms
|
||||||
PCC.Seq0.Step6.Frequency=16 MHz
|
PCC.Seq0.Step6.Frequency=8 MHz
|
||||||
PCC.Seq0.Step6.Memory=RAM/FLASH
|
PCC.Seq0.Step6.Memory=RAM/FLASH/ART
|
||||||
PCC.Seq0.Step6.Mode=SLEEP
|
PCC.Seq0.Step6.Mode=RUN
|
||||||
PCC.Seq0.Step6.Oscillator=HSE
|
PCC.Seq0.Step6.Oscillator=HSE
|
||||||
PCC.Seq0.Step6.Peripherals=
|
PCC.Seq0.Step6.Peripherals=FSMC GPIOA GPIOC GPIOD GPIOE GPIOF GPIOG GPIOH RTC SYS USART1
|
||||||
PCC.Seq0.Step6.TaMax=104.74
|
PCC.Seq0.Step6.TaMax=104.57
|
||||||
PCC.Seq0.Step6.User's_Consumption=0 mA
|
PCC.Seq0.Step6.User's_Consumption=0 mA
|
||||||
PCC.Seq0.Step6.Vcore=Scale2-Medium
|
PCC.Seq0.Step6.Vcore=Scale2-Medium
|
||||||
PCC.Seq0.Step6.Vdd=3.3
|
PCC.Seq0.Step6.Vdd=3.3
|
||||||
PCC.Seq0.Step6.Voltage_Source=Battery
|
PCC.Seq0.Step6.Voltage_Source=Battery
|
||||||
|
PCC.Seq0.Step7.Average_Current=2.12 mA
|
||||||
|
PCC.Seq0.Step7.CPU_Frequency=4 MHz
|
||||||
|
PCC.Seq0.Step7.Category=In DS Table
|
||||||
|
PCC.Seq0.Step7.DMIPS=5.0
|
||||||
|
PCC.Seq0.Step7.Duration=10 ms
|
||||||
|
PCC.Seq0.Step7.Frequency=4 MHz
|
||||||
|
PCC.Seq0.Step7.Memory=RAM/FLASH/ART
|
||||||
|
PCC.Seq0.Step7.Mode=RUN
|
||||||
|
PCC.Seq0.Step7.Oscillator=HSE
|
||||||
|
PCC.Seq0.Step7.Peripherals=FSMC GPIOA GPIOC GPIOD GPIOE GPIOF GPIOG GPIOH RTC SYS USART1
|
||||||
|
PCC.Seq0.Step7.TaMax=104.72
|
||||||
|
PCC.Seq0.Step7.User's_Consumption=0 mA
|
||||||
|
PCC.Seq0.Step7.Vcore=Scale2-Medium
|
||||||
|
PCC.Seq0.Step7.Vdd=3.3
|
||||||
|
PCC.Seq0.Step7.Voltage_Source=Battery
|
||||||
|
PCC.Seq0.Step8.Average_Current=1.12 mA
|
||||||
|
PCC.Seq0.Step8.CPU_Frequency=4 MHz
|
||||||
|
PCC.Seq0.Step8.Category=In DS Table
|
||||||
|
PCC.Seq0.Step8.DMIPS=5.0
|
||||||
|
PCC.Seq0.Step8.Duration=920 ms
|
||||||
|
PCC.Seq0.Step8.Frequency=4 MHz
|
||||||
|
PCC.Seq0.Step8.Memory=RAM/FLASH
|
||||||
|
PCC.Seq0.Step8.Mode=SLEEP
|
||||||
|
PCC.Seq0.Step8.Oscillator=HSE
|
||||||
|
PCC.Seq0.Step8.Peripherals=FSMC GPIOA GPIOC GPIOD GPIOE GPIOF GPIOG GPIOH RTC SYS USART1
|
||||||
|
PCC.Seq0.Step8.TaMax=104.85
|
||||||
|
PCC.Seq0.Step8.User's_Consumption=0 mA
|
||||||
|
PCC.Seq0.Step8.Vcore=Scale2-Medium
|
||||||
|
PCC.Seq0.Step8.Vdd=3.3
|
||||||
|
PCC.Seq0.Step8.Voltage_Source=Battery
|
||||||
|
PCC.Seq0.Step9.Average_Current=310 \u00B5A
|
||||||
|
PCC.Seq0.Step9.CPU_Frequency=0 Hz
|
||||||
|
PCC.Seq0.Step9.Category=In DS Table
|
||||||
|
PCC.Seq0.Step9.DMIPS=0.0
|
||||||
|
PCC.Seq0.Step9.Duration=59000 ms
|
||||||
|
PCC.Seq0.Step9.Frequency=0 Hz
|
||||||
|
PCC.Seq0.Step9.Memory=n/a
|
||||||
|
PCC.Seq0.Step9.Mode=STOP
|
||||||
|
PCC.Seq0.Step9.Oscillator=Regulator_LP
|
||||||
|
PCC.Seq0.Step9.Peripherals=
|
||||||
|
PCC.Seq0.Step9.TaMax=104.96
|
||||||
|
PCC.Seq0.Step9.User's_Consumption=0 mA
|
||||||
|
PCC.Seq0.Step9.Vcore=No Scale
|
||||||
|
PCC.Seq0.Step9.Vdd=3.3
|
||||||
|
PCC.Seq0.Step9.Voltage_Source=Battery
|
||||||
PCC.Series=STM32F4
|
PCC.Series=STM32F4
|
||||||
PCC.Temperature=25
|
PCC.Temperature=25
|
||||||
PCC.Vdd=3.3
|
PCC.Vdd=3.3
|
||||||
|
@ -257,6 +306,11 @@ PF2.Signal=FSMC_A2
|
||||||
PF3.Signal=FSMC_A3
|
PF3.Signal=FSMC_A3
|
||||||
PF4.Signal=FSMC_A4
|
PF4.Signal=FSMC_A4
|
||||||
PF5.Signal=FSMC_A5
|
PF5.Signal=FSMC_A5
|
||||||
|
PF9.GPIOParameters=PinState,GPIO_Label
|
||||||
|
PF9.GPIO_Label=LED1
|
||||||
|
PF9.Locked=true
|
||||||
|
PF9.PinState=GPIO_PIN_SET
|
||||||
|
PF9.Signal=GPIO_Output
|
||||||
PG0.Signal=FSMC_A10
|
PG0.Signal=FSMC_A10
|
||||||
PG1.Signal=FSMC_A11
|
PG1.Signal=FSMC_A11
|
||||||
PG10.Mode=NorPsramChipSelect3_1
|
PG10.Mode=NorPsramChipSelect3_1
|
||||||
|
@ -292,12 +346,12 @@ ProjectManager.PreviousToolchain=
|
||||||
ProjectManager.ProjectBuild=false
|
ProjectManager.ProjectBuild=false
|
||||||
ProjectManager.ProjectFileName=STM32F407ZE_MRB.ioc
|
ProjectManager.ProjectFileName=STM32F407ZE_MRB.ioc
|
||||||
ProjectManager.ProjectName=STM32F407ZE_MRB
|
ProjectManager.ProjectName=STM32F407ZE_MRB
|
||||||
ProjectManager.RegisterCallBack=
|
ProjectManager.RegisterCallBack=TIM
|
||||||
ProjectManager.StackSize=0x400
|
ProjectManager.StackSize=0x400
|
||||||
ProjectManager.TargetToolchain=Makefile
|
ProjectManager.TargetToolchain=Makefile
|
||||||
ProjectManager.ToolChainLocation=
|
ProjectManager.ToolChainLocation=
|
||||||
ProjectManager.UnderRoot=false
|
ProjectManager.UnderRoot=false
|
||||||
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_RTC_Init-RTC-false-HAL-true,4-MX_USART1_UART_Init-USART1-false-HAL-true,5-MX_FSMC_Init-FSMC-false-HAL-true
|
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_RTC_Init-RTC-false-HAL-true,4-MX_USART1_UART_Init-USART1-false-HAL-true,5-MX_FSMC_Init-FSMC-false-HAL-true,6-MX_TIM6_Init-TIM6-false-HAL-true
|
||||||
RCC.48MHZClocksFreq_Value=84000000
|
RCC.48MHZClocksFreq_Value=84000000
|
||||||
RCC.AHBFreq_Value=168000000
|
RCC.AHBFreq_Value=168000000
|
||||||
RCC.APB1CLKDivider=RCC_HCLK_DIV4
|
RCC.APB1CLKDivider=RCC_HCLK_DIV4
|
||||||
|
@ -415,6 +469,9 @@ SH.FSMC_NOE.0=FSMC_NOE,Sram1
|
||||||
SH.FSMC_NOE.ConfNb=1
|
SH.FSMC_NOE.ConfNb=1
|
||||||
SH.FSMC_NWE.0=FSMC_NWE,Sram1
|
SH.FSMC_NWE.0=FSMC_NWE,Sram1
|
||||||
SH.FSMC_NWE.ConfNb=1
|
SH.FSMC_NWE.ConfNb=1
|
||||||
|
TIM6.IPParameters=Prescaler,Period
|
||||||
|
TIM6.Period=1000
|
||||||
|
TIM6.Prescaler=4000 - 1
|
||||||
USART1.BaudRate=115200
|
USART1.BaudRate=115200
|
||||||
USART1.IPParameters=VirtualMode,BaudRate
|
USART1.IPParameters=VirtualMode,BaudRate
|
||||||
USART1.VirtualMode=VM_ASYNC
|
USART1.VirtualMode=VM_ASYNC
|
||||||
|
@ -426,4 +483,6 @@ VP_RTC_VS_RTC_Calendar.Mode=RTC_Calendar
|
||||||
VP_RTC_VS_RTC_Calendar.Signal=RTC_VS_RTC_Calendar
|
VP_RTC_VS_RTC_Calendar.Signal=RTC_VS_RTC_Calendar
|
||||||
VP_SYS_VS_tim7.Mode=TIM7
|
VP_SYS_VS_tim7.Mode=TIM7
|
||||||
VP_SYS_VS_tim7.Signal=SYS_VS_tim7
|
VP_SYS_VS_tim7.Signal=SYS_VS_tim7
|
||||||
|
VP_TIM6_VS_ClockSourceINT.Mode=Enable_Timer
|
||||||
|
VP_TIM6_VS_ClockSourceINT.Signal=TIM6_VS_ClockSourceINT
|
||||||
board=custom
|
board=custom
|
||||||
|
|
Loading…
Reference in New Issue