Processor : MPC5777C
Debugger : Multilink Universal Fx
below is the code which i am using for debug
void my_system_etpu_init(void)
{
int32_t error_code;
int V_duty=0;
int C1_TOP_duty=0;
alpha_delay= ((float)(alpha_initial))*10.0/180;
fs_etpu_init( my_etpu_config, (uint32_t *)etpu_code, sizeof(etpu_code), \
(uint32_t *)etpu_globals, sizeof(etpu_globals));
/*** LV to HV side ***/
error_code = fs_etpu_spwm_init_master ( ETPU_ENGINE_A_CHANNEL(PWM_C1_TOP),
300000, //freq
10, //duty
FS_ETPU_TCR2, //timebase
etpu_a_tcr2_freq, //timebase_freq
FS_ETPU_SPWM_IMMEDIATE, //ref mode
0, //ref ptr ; has no meaning im immediate mode
FS_ETPU_SPWM_FALLING_EDGE_INT_DMA,
0x04000004, //link1
0x04000004
);
Master2_rising_edge_ptr = fs_etpu_data_ram(ETPU_ENGINE_A_CHANNEL(PWM_C1_TOP)) +
(uint32_t) ((uint32_t *) (FS_ETPU_SPWM_RISING_OFFSET >>2)) -
(uint32_t) ((uint32_t *) ((fs_etpu_data_ram_start) / 4)) ;
Master2_rising_edge_ptr8 = (uint8_t *)Master2_rising_edge_ptr + 1 ;
Master2_rising_edge_ptr = (uint32_t *)Master2_rising_edge_ptr8 ;
error_code = fs_etpu_spwm_init_slave ( ETPU_ENGINE_A_CHANNEL(PWM_C1_BOT),
FS_ETPU_PRIORITY_MIDDLE,
300000, //freq
10, // 25% duty
1.6, // 10 us delay
FS_ETPU_TCR2, // timebase
etpu_a_tcr1_freq,
Master2_rising_edge_ptr
);
error_code = fs_etpu_spwm_init_master ( ETPU_ENGINE_A_CHANNEL(PWM_A1_TOP),
50000,// freq
1, // duty
FS_ETPU_TCR2,// timebase
etpu_a_tcr1_freq, //timebase_freq
FS_ETPU_SPWM_IMMEDIATE, //ref mode
0, //ref ptr has no meaning im immediate mode
FS_ETPU_SPWM_FALLING_EDGE_INT_DMA,
0x02000302, //link1
0x81828083
);
Master1_rising_edge_ptr = fs_etpu_data_ram(ETPU_ENGINE_A_CHANNEL(PWM_A1_TOP)) +
(uint32_t) ((uint32_t *) (FS_ETPU_SPWM_RISING_OFFSET >>2)) -
(uint32_t) ((uint32_t *) ((fs_etpu_data_ram_start) / 4)) ;
Master1_rising_edge_ptr8 = (uint8_t *)Master1_rising_edge_ptr + 1 ;
Master1_rising_edge_ptr = (uint32_t *)Master1_rising_edge_ptr8 ;
///**HV to LV side *
error_code = fs_etpu_spwm_init_slave ( ETPU_ENGINE_A_CHANNEL(PWM_B1_BOT),
FS_ETPU_PRIORITY_MIDDLE,
50000, //freq
1, // 25% duty
alpha_delay, // 10 us delay
FS_ETPU_TCR2, // timebase
etpu_a_tcr1_freq,
Master1_rising_edge_ptr
);
error_code = fs_etpu_spwm_init_slave ( ETPU_ENGINE_A_CHANNEL(PWM_A1_BOT),
FS_ETPU_PRIORITY_MIDDLE,
50000, //freq
10, // 25% duty
(TDC + DEADTIME), // 10 us delay
FS_ETPU_TCR2, // timebase
etpu_a_tcr1_freq,
Master1_rising_edge_ptr
);
error_code = fs_etpu_spwm_init_slave ( ETPU_ENGINE_A_CHANNEL(PWM_B1_TOP),
FS_ETPU_PRIORITY_MIDDLE,
50000, //freq
1, // 25% duty
TDC+ DEADTIME+ alpha_delay, // 10 us delay
FS_ETPU_TCR2, // timebase
etpu_a_tcr1_freq,
Master1_rising_edge_ptr
);
error_code = fs_etpu_spwm_init_slave ( ETPU_ENGINE_B_CHANNEL(PWM_A2_TOP),
FS_ETPU_PRIORITY_MIDDLE,
50000, //freq
4000, //25% duty
0, //10 us delay
FS_ETPU_TCR2, // timebase
etpu_a_tcr1_freq,
Master1_rising_edge_ptr
);
error_code = fs_etpu_spwm_init_slave ( ETPU_ENGINE_B_CHANNEL(PWM_B2_BOT),
FS_ETPU_PRIORITY_MIDDLE,
50000, //freq
4000, //25% duty
alpha_delay, //10 us delay
FS_ETPU_TCR2, // timebase
etpu_a_tcr1_freq,
Master1_rising_edge_ptr
);
error_code = fs_etpu_spwm_init_slave ( ETPU_ENGINE_B_CHANNEL(PWM_A2_BOT),
FS_ETPU_PRIORITY_MIDDLE,
50000, //freq
4000, //25% duty
(TDC + DEADTIME), //20 us delay
FS_ETPU_TCR2, // timebase
etpu_a_tcr1_freq,
Master1_rising_edge_ptr
);
error_code = fs_etpu_spwm_init_slave (ETPU_ENGINE_B_CHANNEL(PWM_B2_TOP),
FS_ETPU_PRIORITY_MIDDLE,
50000, //freq
4000, //25% duty
(TDC + DEADTIME)+alpha_delay, //10 us delay
FS_ETPU_TCR2, // timebase
etpu_a_tcr1_freq,
Master1_rising_edge_ptr
);
my_system_etpu_start();
fs_etpu_spwm_run_master (ETPU_ENGINE_A_CHANNEL(PWM_C1_TOP),
FS_ETPU_PRIORITY_MIDDLE);
fs_etpu_spwm_run_master (ETPU_ENGINE_A_CHANNEL(PWM_A1_TOP),
FS_ETPU_PRIORITY_MIDDLE);
for(C1_TOP_duty=11;C1_TOP_duty<41;C1_TOP_duty++)
{
fs_etpu_spwm_duty(ETPU_ENGINE_A_CHANNEL(PWM_C1_BOT),C1_TOP_duty*100);
fs_etpu_spwm_duty(ETPU_ENGINE_A_CHANNEL(PWM_C1_TOP),C1_TOP_duty*100);
}
}
here is my code at the end where i try to update duty cycle from 11% to 40% in this the line which is bold type where my code stuck and when i stop the debug then this type of error come given below.
Program received signal SIGINT, Interrupt.
0x00c10010 in IVOR1_Vector ()
No source available for "IVOR1_Vector() at 0xc10010"
if i comment the line in bold then the loop run fine and code execute successfully.
i also try to update etpu_set.h written below where i comment the additional zero which are shown here in bold letter because of this some times code run and sometimes do not.
const uint32_t etpu_code[] = { 0xC088C088,0xC088C088,0x00340023,0x005A005A,
0x0082406C,0x40864041,0x0082406C,0x40864041,
0x407C0082,0x40534086,0x407C0082,0x40534086,
0x407C406C,0x40534041,0x407C406C,0x40534041,
0xF320027F,0x3BF93FB4,0x0003301D,0xF28002BF,
0x00033099,0xF2C002FF,0x00033119,0xF200033F,
0x00033219,0xF240037F,0x00033819,0x9FF37A00,
0xFFF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0xFFF9CCFB,0x6FFFFFFF,0xF300109F,0xF7C00CFF,
0xFFC0021F,0x6FFFFFFF,0xFFC0021F,0x6FFFFFFF,
0x6FFFFFFF,0x00000000,0x00000000,0x00000000
#if 0
,
0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000
#endif
}