Hello!
I have got not expected end of program in alarm mode during execution of SWI asm command.
This command execute in init_timer_interrupt() -> disable_fast_interrupt() -> swi_single_entry(0,0,0,5).
Can somebody explain what the reason can be?, please
My code is:
~~~
#define MAIN 1
#include "include.h"
// software_interrupt_wrapper.c
void disable_fast_interrupt(void)
{
swi_single_entry(0,0,0,5); //code is 5;
}
// init_miscellaneous.c
void init_timer_interrupt(void)
{
TimerRegs.T16PWM0CMP0DAT.all = 1587; //approx 10KHz. by spec
TimerRegs.T16PWM0CMP1DAT.all = 0xffff;
TimerRegs.T16PWM0CMPCTRL.all = 2;
TimerRegs.T16PWM0CNTCTRL.all = 0x00c;
disable_fast_interrupt(); //make sure fast interrupt is disabled
disable_interrupt();
write_firqpr (0x0A000000); //make them all irqs except FAULT_INT, DPWM2
write_reqmask(0x0A020000); //enable FAULT_INT and PWM0_INT, DPWM2
enable_interrupt();
enable_fast_interrupt(); //make sure fast interrupt is enabled, enabled in Idle state
}
void main()
{
MiscAnalogRegs.IOMUX.all = 0; //enable JTAG
start_state =5;
MiscAnalogRegs.GLBIOEN.all = MASK_PGOOD | MASK_PSON | MASK_FAILURE | MASK_AC_FAIL_IN | MASK_AC_FAIL_OUT | MASK_OR_CTRL;
if ((MiscAnalogRegs.GLBIOREAD.all & MASK_PGOOD) && (MiscAnalogRegs.GLBIOREAD.all & MASK_FAILURE ) )
{
//pmbus_read_write_rom_mode(PMBUS_WRITE);
}
//Check to see if the last DFLASH erase was interrupted
look_for_interrupted_dflash_erase();
restore_default_all();
period = (SWITCH_FREQ_NUMERATOR / pmbus_dcdc_config[0].switching_frequency); // in 4 ns
configure_cpcc();
init_uart1();
init_gpio();
init_pmbus(0x58);
init_dpwm();
#if defined(UCD3138A64) || defined(UCD3138128) || defined(UCD3138A64A) || defined(UCD3138128A)
enable_oversampling();
#endif
init_adc12();
init_protection();
init_voltage_loop();
init_current_loop();
init_light_load_configuration();
init_miscellaneous();
init_timer_interrupt();
for(;;)
{
if (erase_segment_counter > 0)
{
erase_task(); // Handle the DFlash segment erases
}
decimal_out_5_digits(supply_state);
char_out('\r');
char_out('\n');
}
}
void c_int00(void)
{
main();
}
~~~