This section describes the M2MB APIs related to system reset functionality.
More...
This section describes the M2MB APIs related to system reset functionality.
System reset APIs are used to reset the system, find out the reset reason and to kick the watchdog.
◆ M2MB_SYSTEM_EXCEPTION_INFO_T
Structure defining details of exception information.
Exception information details.
◆ M2MB_SYSTEM_RESET_RESON_T
Enum defining different boot reason.
Enum defines different boot reason.
Enumerator |
---|
M2MB_SYSTEM_BOOT_REASON_PON_COLD_BOOT | Power on cold boot or hardware reset.
|
M2MB_SYSTEM_BOOT_REASON_WATCHDOG_BOOT | Reset from the Watchdog.
|
M2MB_SYSTEM_BOOT_REASON_SW_BOOT | Software cold reset.
|
M2MB_SYSTEM_BOOT_REASON_EXCEPTION_HARD_FAULT | Exception, Hard fault.
|
M2MB_SYSTEM_BOOT_REASON_EXCEPTION_MEM_FAULT | Exception, Memory management fault.
|
M2MB_SYSTEM_BOOT_REASON_EXCEPTION_USAGE_FAULT | Exception, Usage fault.
|
M2MB_SYSTEM_BOOT_REASON_EXCEPTION_BUS_FAULT | Exception, Bus fault.
|
M2MB_SYSTEM_BOOT_REASON_UNKNOWN_BOOT | Unknown software cold boot.
|
M2MB_SYSTEM_BOOT_REASON_SIZE_ENUM | |
Definition at line 56 of file m2mb_system_reset.h.
◆ m2mb_get_boot_reason()
Boot reason.
This API gives the boot reason.
- Parameters
-
[out] | reason | Pointer to the store the boot reason. |
- Returns
- M2MB_OK if the boot reason could be found successful. M2MB_ERROR if the boot reason could not be found.
- Note
To find the boot reason and do the rest of the processing based on this.
◆ m2mb_get_exception_info()
To get the details on exception.
This API gives the reason of exception and the register detail when exception happened.
- Parameters
-
[out] | excptionInfo | Pointer to the store the boot reason. |
- Returns
- M2MB_OK if the exception details could be found successful. M2MB_ERROR if the exception details could not be found.
- Note
To find the details on exception reason for debugging purpose.
{
for( i = 0; i < 16; i++ )
}
◆ m2mb_system_reset()
System Reset API.
Resets the system.
- Returns
- None
- Note
- Once this API is called the system gets reseted, so the call does not return back to the caller. Can be used for ASSERTING the system
UINT8* pBuf = malloc(size);
◆ m2mb_wdog_disable()
To disable watchdog.
This API disables the watchdog.
- Note
- By default, watchdog is enabled and fires in 10sec. To disable the watchdog this API can be called.
VOID m2mb_wdog_disable( VOID );
◆ m2mb_wdog_enable()
To enable watchdog.
This API enables the watchdog.
- Note
- By default watchdog is enabled and fires in 10sec. The watchdog is kicked internally by the system. If a thread executes for more than 10sec without reliquencing the CPU control watchdog will fire and system would reset.
VOID m2mb_wdog_enable( VOID );
◆ m2mb_wdog_is_enable()
To find whether the watchdog is enabled or not.
This API finds out if the watchdog is enabled or not.
- Returns
- 1 if the watchdog is enabled. 0 if the watchdog is disabled.
- Note
UINT32 m2mb_wdog_is_enable( VOID );
◆ m2mb_wdog_kick()
To reset the watchdog.
This API resets the watchdog timer and start again.
- Note
- By default, watchdog is enabled and fires in 10sec. The watchdog is kicked internally by the system. If a thread executes for more than 10sec without reliquencing the CPU control watchdog will fire and system would reset.
m2mb_wdog_kick( VOID );