tags: [entity] type: entity topic: stm32-lower note: 18 created: 2026-07-16
| # | Directory | Mode | Library |
|---|---|---|---|
| 15 | 15_lowpower_sleep_register |
Sleep | Register |
| 16 | 16_lowpower_sleep_hal |
Sleep | HAL |
| 17 | 17_lowpower_stop_register |
Stop | Register |
| 18 | 18_lowpower_stop_hal |
Stop | HAL |
| 19 | 19_lowpower_standby_register |
Standby | Register |
| 20 | 20_lowpower_standby_hal |
Standby | HAL |
All paths are correct (no double stm32/ issue for these projects).
| Claimed by Note | Actual Code (line 45) | Match? |
|---|---|---|
SCB->SCR &= ~SCB_SCR_SLEEPDEEP |
Line 45 | ✅ Match |
__WFI() |
Line 48 | ✅ Match |
Calls enter_sleep_mode() |
Function defined lines 42-48 | ✅ Match |
Uses USART_Init(), LED_Init(), Delay_s() includes |
Lines 9-11 | ✅ Match |
Note mentions SLEEPONEXIT option — actual code only implements SLEEP-NOW (SLEEPDEEP=0, immediate WFI). The SLEEP-ON-EXIT variant is described in note but not implemented in this file.
| Claimed by Note | Actual Code | Match? |
|---|---|---|
HAL_SuspendTick() |
Present | ✅ Match |
HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON, PWR_SLEEPENTRY_WFI) |
Present | ✅ Match |
HAL_ResumeTick() |
Present | ✅ Match |
| Claimed by Note | Actual Code | Match? |
|---|---|---|
| `SCB->SCR | = SCB_SCR_SLEEPDEEP` | Present |
| `RCC->APB1ENR | = RCC_APB1ENR_PWREN` | Present |
PWR->CR &= ~PWR_CR_PDDS (Stop mode) |
Present | ✅ Match |
| `PWR->CR | = PWR_CR_LPDS` (Low-power regulator) | Present |
__WFI() |
Present | ✅ Match |
Wake: SystemInit() |
Present | ✅ Match |
get_clock_freq() helper |
Present (lines in file) | ✅ Match |
| Claimed by Note | Actual Code | Match? |
|---|---|---|
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_SLEEPENTRY_WFI) |
Present | ✅ Match |
Wake: SystemClock_Config() |
Present | ✅ Match |
| Claimed by Note | Actual Code | Match? |
|---|---|---|
| `SCB->SCR | = SCB_SCR_SLEEPDEEP` | Present |
| `PWR->CR | = PWR_CR_PDDS` | Present |
| `PWR->CSR | = PWR_CSR_EWUP` (PA0 wake) | Present |
__WFI() |
Present | ✅ Match |
Wake detection: PWR->CSR & PWR_CSR_SBF |
Present | ✅ Match |
| `PWR->CR | = PWR_CR_CSBF` (clear SB flag) | Present |
| `PWR->CR | = PWR_CR_CWUF` (clear WUF flag) | Present |
| Claimed by Note | Actual Code | Match? |
|---|---|---|
__HAL_PWR_GET_FLAG(PWR_FLAG_SB) |
Present | ✅ Match |
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB) |
Present | ✅ Match |
__HAL_PWR_GET_FLAG(PWR_FLAG_WU) |
Present | ✅ Match |
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU) |
Present | ✅ Match |
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN1) |
Present | ✅ Match |
HAL_PWR_EnterSTANDBYMode() |
Present | ✅ Match |
Note's claim:
PWR->CR |= PWR_CR_PLS_2 | PWR_CR_PLS_1; // PLS=110 → 2.8V
PWR->CR |= PWR_CR_PVDE;
EXTI->RTSR &= ~EXTI_RTSR_TR16;
EXTI->FTSR |= EXTI_FTSR_TR16;
EXTI->IMR |= EXTI_IMR_MR16;
NVIC_EnableIRQ(PVD_IRQn);
This PVD code is referenced in the note but does NOT exist in any of the 6 power project main.c files. It may be from a separate demo or the note's general reference material.
Overall Accuracy: Very High
Issues Found:
SLEEPONEXIT=1) described in note but only SLEEP-NOW implemented in project 15