2020-04-12 12:17 PM
I am facing a realy strange problem while trying to put my stm32f103c8t6 into a standby mode. The consumption in standby mode is .8mA (what is 40 times higher then its supposed to be) on first board (Board A) and .02mA (what is 10 times higher) on second board (Board B). I spent 2 days already reading datasheet and reference manual and cannot get below .8mA.
(Board A) was modifyed by removing the on board voltage regulator and 2 LEDs. (Board B) has only the uC, 2 resistors (100k R3, R4).
The code I use is the following:
RCC->APB1ENR |= RCC_APB1ENR_PWREN;
ADC1->CR2 &= ~(1UL << 0);
ADC2->CR2 &= ~(1UL << 0);
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
PWR->CR |= PWR_CR_PDDS;
PWR->CR |= PWR_CR_CWUF;
PWR->CSR |= PWR_CSR_EWUP;
__WFI();
I am running at 8MHz (probably not so important in this case). I have already tried to put all pins into analog input mode (to disconnect the internal schmitt trigger).
2020-04-12 04:19 PM
Check your writes to PWR are actually occurring and that you don't need to unlock it.
2020-04-12 04:25 PM
can you please explain me how to check?
2020-04-13 03:58 AM
Run in the debugger and read out the registers you want to check. Compare with the values in the reference manual and check if they have the value you wnat them to have.
2020-04-13 04:37 AM
thanks for your reply. I am generating .bin file and uploading it via j-link. For some reason I cant run in debug mode via STM32CubeIDE.