Hi, how about a reset reason getter and resetter in the stm32_rcc.h files? Anybody here who needs that too? At the moment i do this direct via CMSIS register access.
where the type rccResetReason_t is standardized platform independent and the interpretation is done in this platform dependent functions? Then the interface between application and HAL is standardized.
It could be added to the HAL driver. A standard API halGetResetReason() could be added. The enum would be defined in the low layer. A couple of values could be "standard": cold reset, watchdog.
Then we have to define an intersection of the possible reset causes, e.g. an high level part of the enum and a low level part which is platform dependent. Common might be POWER_ON, RESET_PIN, SOFTWARE and WATCHDOG, isn't it? Some other proposals?
Also a rccClearResetCause() is mandatory because the "reset" register of some platforms need to be explicitly cleared by the application e.g. STM32.
No, not yet, for some reason the STM32 can have multiple reset reasons at the same time (it is a mask of bits), I couldn't define a portable API for this, it varies too much among MCUs.