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"
108 #define STU_PLL_RETRIES 5U
137 register resetSource_t rst_source;
139 if ((SYS_EXCEPTION & (uint32)POWERON_RESET) != 0U) {
141 rst_source = POWERON_RESET;
142 }
else if ((SYS_EXCEPTION & (uint32)EXT_RESET) != 0U) {
144 if ((SYS_EXCEPTION & (uint32)OSC_FAILURE_RESET) != 0U) {
146 rst_source = OSC_FAILURE_RESET;
147 }
else if ((SYS_EXCEPTION & (uint32)WATCHDOG_RESET) != 0U) {
149 rst_source = WATCHDOG_RESET;
150 }
else if ((SYS_EXCEPTION & (uint32)WATCHDOG2_RESET) != 0U) {
152 rst_source = WATCHDOG2_RESET;
153 }
else if ((SYS_EXCEPTION & (uint32)SW_RESET) != 0U) {
155 rst_source = SW_RESET;
158 rst_source = EXT_RESET;
160 }
else if ((SYS_EXCEPTION & (uint32)DEBUG_RESET) != 0U) {
162 rst_source = DEBUG_RESET;
163 }
else if ((SYS_EXCEPTION & (uint32)CPU0_RESET) != 0U) {
165 rst_source = CPU0_RESET;
168 rst_source = NO_RESET;
175 #pragma CODE_STATE(_c_int00, 32)
176 #pragma INTERRUPT(_c_int00, RESET)
181 register resetSource_t rstSrc;
184 _coreInitRegisters_();
187 _coreInitStackPointer_();
209 if (rstSrc != POWERON_RESET) {
217 _coreEnableEventBusExport_();
223 if ((esmREG->SR1[2]) != 0U) {
224 esmGroup3Notification(esmREG, esmREG->SR1[2]);
231 _coreEnableIrqVicOffset_();
241 case OSC_FAILURE_RESET:
245 case WATCHDOG2_RESET:
254 _coreEnableEventBusExport_();
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
void exit(int _status)
exit application
int main(void)
main function of foxBMS