I am developing a prototype board which does a set of programmed task and goes to standby mode. It has both clock interrupt and pin wake up interrupt to wake the controller up from the standby mode. I am facing two issues:
1. I'm not able to write a program to differentiate between the clock interrupt and pin wake up interrupt (as the behavior should be different, according to the interrupt raised). I have referred to RCC_CSR register for the reset source, but it is setting RCC_CSR_PORRSTF flag for both cases. How do I differentiate between the two interrupts? And from what I have worked with standby mode, I have an impression that the controller neither resumes the normal execution nor calls the interrupt service routine but resets on wake up from standby mode (please correct me if I am wrong).
2. During a pin wake up interrupt, I need to write a byte of information on a non-volatile memory and go back to standby mode (nothing else to do). While waking up via clock interrupt I should be able to access the written data and do accordingly. I have come across backup SRAM (function to be used: HAL_PWREx_EnableBkUpReg()). Am I on the right path? Is there any other setting to be done inorder to write this byte of information into backup SRAM? Or is there another way to tackle the issue (other than EEPROM)?
I have the standby code and pin wake up code working as per my requirements, but stuck with these issues.
Allan Tom Mathew.