Contains API prototypes and type definitions for the Reset Manager.
More...
|
| enum | resetReason_t {
RSTRSN_UNKNOWN = 0U
, RSTRSN_POWER_ON
, RSTRSN_BROWNOUT
, RSTRSN_EXTERNAL
,
RSTRSN_WDR_RESET
, RSTRSN_SOFTWARE
, RSTRSN_UPDI_RESET
, RSTRSN_ERRCH_UNKNOWN
,
RSTRSN_MCHK_UNKNOWN
, RSTRSN_WDT_OUTSIDE
, RSTRSN_WDT_TIMEOUT
, RSTRSN_ERRCH_VREGFAIL
,
RSTRSN_ERRCH_BUSERR
, RSTRSN_ERRCH_RAM2
, RSTRSN_ERRCH_FLASH2
, RSTRSN_ERRCH_OPC
,
RSTRSN_ERRCH_SPLIM
, RSTRSN_ERRCH_RAM1
, RSTRSN_ERRCH_FLASH1
, RSTRSN_ERRCH_VREGWARN
,
RSTRSN_ERRCH_CFD0
, RSTRSN_ERRCH_CFD1
, RSTRSN_ERRCH_CFM0
, RSTRSN_ERRCH_CFM1
,
RSTRSN_ERRCH_SWDT
, RSTRSN_ERRCH_EEPROM
, RSTRSN_ERRCH_EVSYS0
, RSTRSN_ERRCH_EVSYS1
,
RSTRSN_MCHK_OCD
, RSTRSN_MCHK_DFT
, RSTRSN_MCHK_EC
, RSTRSN_MCHK_DCLS
,
RSTRSN_MCHK_BOOT
, RSTRSN_MCHK_WDT
, RSTRSN_MCHK_CRC
, RSTRSN_MCHK_VREG
,
RSTRSN_MCHK_CFD
, RSTRSN_MCHK_UPDI
, RSTRSN_MAX
} |
| | Type defines for all possible reset sources. More...
|
Contains API prototypes and type definitions for the Reset Manager.
- Version
- 1.0.0-alpha.1
The Reset Manager provides services to Tasks to ensure correct interaction with features of the RSTCTRL peripheral.
- Copyright
- © 2025 Microchip Technology Inc. and its subsidiaries.
Subject to your compliance with these terms, you may use Microchip software and any derivatives exclusively with Microchip products. It is your responsibility to comply with third party license terms applicable to your use of third party software (including open source software) that may accompany Microchip software.
THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
UML Class Diagrams
UML Activity Diagrams
◆ resetReason_t
Type defines for all possible reset sources.
- Warning
- It is assumed that the order of this enum is not modified, as MW_GetClearResetReason depends on this specific order with the relative offsets to efficiently determine the reset reason.
| Enumerator |
|---|
| RSTRSN_UNKNOWN | Unknown Reset reason
|
| RSTRSN_POWER_ON | Power-on Reset
|
| RSTRSN_BROWNOUT | Brown-out Reset
|
| RSTRSN_EXTERNAL | External Pin Reset
|
| RSTRSN_WDR_RESET | Unknown Watchdog Reset
|
| RSTRSN_SOFTWARE | Reset command issued by software
|
| RSTRSN_UPDI_RESET | UPDI or High Voltage Reset
|
| RSTRSN_ERRCH_UNKNOWN | Unknown Error Controller Channel Reset
|
| RSTRSN_MCHK_UNKNOWN | Unknown Machine Check Reset
|
| RSTRSN_WDT_OUTSIDE | Watchdog Reset command issued outside window
|
| RSTRSN_WDT_TIMEOUT | Watchdog Timer timeout Reset
|
| RSTRSN_ERRCH_VREGFAIL | VREGFAIL Error Channel Reset
|
| RSTRSN_ERRCH_BUSERR | BUSERR Error Channel Reset
|
| RSTRSN_ERRCH_RAM2 | RAM2 Error Channel Reset
|
| RSTRSN_ERRCH_FLASH2 | FLASH2 Error Channel Reset
|
| RSTRSN_ERRCH_OPC | OPC Error Channel Reset
|
| RSTRSN_ERRCH_SPLIM | SPLIM Error Channel Reset
|
| RSTRSN_ERRCH_RAM1 | RAM1 Error Channel Reset
|
| RSTRSN_ERRCH_FLASH1 | FLASH1 Error Channel Reset
|
| RSTRSN_ERRCH_VREGWARN | VREGWARN Error Channel Reset
|
| RSTRSN_ERRCH_CFD0 | CFD0 Error Channel Reset
|
| RSTRSN_ERRCH_CFD1 | CFD1 Error Channel Reset
|
| RSTRSN_ERRCH_CFM0 | CFM0 Error Channel Reset
|
| RSTRSN_ERRCH_CFM1 | CFM1 Error Channel Reset
|
| RSTRSN_ERRCH_SWDT | SWDT Error Channel Reset
|
| RSTRSN_ERRCH_EEPROM | EEPROM Error Channel Reset
|
| RSTRSN_ERRCH_EVSYS0 | EVSYS0 Error Channel Reset
|
| RSTRSN_ERRCH_EVSYS1 | EVSYS1 Error Channel Reset
|
| RSTRSN_MCHK_OCD | Illegal On-chip Debugging entry Reset
|
| RSTRSN_MCHK_DFT | Illegal Test entry Reset
|
| RSTRSN_MCHK_EC | Internal ERRCTRL error Reset
|
| RSTRSN_MCHK_DCLS | Dual-core lockstep error Reset
|
| RSTRSN_MCHK_BOOT | BOOTROM error Reset
|
| RSTRSN_MCHK_WDT | WDT Clock Failure Monitor Reset
|
| RSTRSN_MCHK_CRC | BOOTROM CRC error Reset
|
| RSTRSN_MCHK_VREG | VREG Monitor Reset
|
| RSTRSN_MCHK_CFD | Clock Failure Detection Reset
|
| RSTRSN_MCHK_UPDI | Illegal UPDI entry Reset
|
| RSTRSN_MAX | Reserved/invalid, indicates highest reset reason value
|
Definition at line 39 of file midware_reset_manager.h.
◆ MW_GetClearResetReason()
Reads and clears the reset flag registers.
This function reads and clears reset flags to determine the last device reset reason. This is done by reporting the first found reset flag from MSb to LSb. If the flag indicates a Machine Check Reset, an Error Controller Reset or a Watchdog Timer Reset, the addition cause information of this type of reset is checked and reported.
- Warning
- If multiple resets have occurred without clearing the flags, the first identified reason is reported and all flags are cleared.
- MISRA C:2012 Deviation
- Advisory: misra-c2012- 10.5
Justification: This deviation concerns the determination of the device reset reason. The function uses an enum-to-integer conversion to map register bits to enum members of resetReason_t. This deviation enables reduction of execution time, flash usage, and complexity. The mapping is considered safe due to rigorous unit tests that ensure the correctness of the mapping between the register bits and the enum members. Additionally, the safety of this approach is maintained as long as the order of the enum members in resetReason_t is not changed, as documented in the warning above the enum declaration.
- Returns
- The determined reason for the last device reset.
Definition at line 47 of file midware_reset_manager.c.
◆ MW_ResetDevice()
| void MW_ResetDevice |
( |
void | | ) |
|
Issues a software reset request to reset the device.
- Note
- If this function returns, it means that the device reset failed. It is assumed that this is handled by the calling function.
Definition at line 42 of file midware_reset_manager.c.