The PIT doesn't work when use the PE Micro Multilink Universal to Debug Program

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

The PIT doesn't work when use the PE Micro Multilink Universal to Debug Program

468 Views
Bravo_An
Contributor I

Hi,

I use the S32DS to Debug PIT program by PE Micro Multilink Universal ,when i was  connected My MPC5743R,the timer has been stoped.And I was config the PIT_MCR_FRZ bit to 0. It was also doesn't work. If I powerdown the targetboard and pluck out the Plug from the JTAG port. And I power on the targetboard again.I find the timer is working.I have confused by this problem.Cloud you give me some advise to solved this.Thanks

I have attached the S32DS project file.

Tags (4)
0 Kudos
3 Replies

460 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

It could be that PIT is not running in debug mode.

 

petervlna_1-1666171377834.png

Other thing could be your debugger is not able to read registers while code is running.

You usually do not step debug timers, you run them and check the interrupt or any flag change if they reach some point.

Best regards,

Peter

 

0 Kudos

457 Views
Bravo_An
Contributor I

Hi,Peter

I had run the progrom and add a breakpoint in the pit ISR, The timer also dosen't work .And I have confirmed that my debugger is no problem. Because if I use the S32DS demo <pit_periodic_interrupt_mpc5746r> to flash into my targetboard and I can see the pit isr is running,Eventhough I had connected the debugger. 

I am looking forward to you reply.

0 Kudos

453 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

The timer also dosen't work

So your timer is not running?

In case you have clocks enabled for PIT:

void PIT_Init(void)
{
// PIT Timer Initialization
PIT_0.MCR.B.MDIS = 0; //Enable PIT_0 timers
PIT_0.TIMER[0].LDVAL.R = 0x100000; // setup timer 0
PIT_0.TIMER[0].TCTRL.B.TIE = 1; // Timer interrupt enable
PIT_0.TIMER[0].TCTRL.B.TEN = 1; // start Timer
}//PIT_Init

This is all you need for PIT to trigger TIF flag. Once TIF is set the IVOR4 is called and if ISR is configured, then you will end up after interrupt prologue in ISR - at your breakpoint)

So make sure your TIF is set when you run PIT.

Best regards,

Peter

0 Kudos