94 #include "HL_sys_common.h"
95 #include "HL_system.h"
96 #include "HL_sys_vim.h"
97 #include "HL_sys_core.h"
99 #include "HL_sys_mpu.h"
100 #include "HL_errata_SSWF021_45.h"
113 #define STU_PLL_RETRIES (5u)
141 register resetSource_t rst_source;
143 if ((SYS_EXCEPTION & (uint32)POWERON_RESET) != 0U) {
145 rst_source = POWERON_RESET;
146 }
else if ((SYS_EXCEPTION & (uint32)EXT_RESET) != 0U) {
148 if ((SYS_EXCEPTION & (uint32)OSC_FAILURE_RESET) != 0U) {
150 rst_source = OSC_FAILURE_RESET;
151 }
else if ((SYS_EXCEPTION & (uint32)WATCHDOG_RESET) != 0U) {
153 rst_source = WATCHDOG_RESET;
154 }
else if ((SYS_EXCEPTION & (uint32)WATCHDOG2_RESET) != 0U) {
156 rst_source = WATCHDOG2_RESET;
157 }
else if ((SYS_EXCEPTION & (uint32)SW_RESET) != 0U) {
159 rst_source = SW_RESET;
162 rst_source = EXT_RESET;
164 }
else if ((SYS_EXCEPTION & (uint32)DEBUG_RESET) != 0U) {
166 rst_source = DEBUG_RESET;
167 }
else if ((SYS_EXCEPTION & (uint32)CPU0_RESET) != 0U) {
169 rst_source = CPU0_RESET;
172 rst_source = NO_RESET;
179 #pragma CODE_STATE(_c_int00, 32)
180 #pragma INTERRUPT(_c_int00, RESET)
185 register resetSource_t rstSrc;
188 _coreInitRegisters_();
191 _coreInitStackPointer_();
213 if (rstSrc != POWERON_RESET) {
221 _coreEnableEventBusExport_();
227 if ((esmREG->SR1[2]) != 0U) {
228 esmGroup3Notification(esmREG, esmREG->SR1[2]);
235 _coreEnableIrqVicOffset_();
245 case OSC_FAILURE_RESET:
249 case WATCHDOG2_RESET:
258 _coreEnableEventBusExport_();
281 #ifdef UNITY_UNIT_TEST
Assert macro implementation.
#define FAS_ASSERT(x)
Assertion macro that asserts that x is true.
#define FAS_TRAP
Define that evaluates to essential boolean false thus tripping an assert.
void _c_int00(void)
Startup Routine.
static void STU_HandlePllLockFail(void)
Handler for a failed PLL lock.
static resetSource_t STU_GetResetSourceWithoutFlagReset(void)
Get reset flag.
void __TI_auto_init(void)
initialize global variable and constructors
int main(void)
main function of foxBMS