PWRM_eScheduleActivity() could not schedule tasks

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

PWRM_eScheduleActivity() could not schedule tasks

1,762 Views
erictao
Contributor II

Hello, we are using JN5169 with JN-SW4168 on developing Zigbee end-device product(non RX Idle).

The PWRM_eScheduleActivity() is used on various tasks scheduling like calling ZPS_eAplZdoPoll() at interval and some others.

It is found that after running for some days, the PWRM_eScheduleActivity() could not scheduling the task any more, it always return the status PWRM_E_TIMER_RUNNING, and the target call back function could not be scheduled any more.

Any idea on this?

Thank you

0 Kudos
Reply
3 Replies

1,431 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Eric,

Are you trying to use wake events? Are you using the Wake Timer 1?

Your interrupt handler must call the pre-defined callback function PWRM_WakeInterruptCallback(). This function maintains the list of scheduled wake events - if required, it will re-start the wake timer for the next wake point. 

The function PWRM_eScheduleActivity will return an error  if the 32-kHz oscillator has not been configured to run during sleep or the software wake timer is already running for another wake point.

Best Regards,

Mario

0 Kudos
Reply

1,431 Views
erictao
Contributor II

Hello Mario:

Thanks a lot for the info and sorry for the late reply/

Yes, I think am using wake event; and wake timer 1 is used.(As I remember, JN5169 has exactly 2 wake timer2; timer 0 is used for IEEE802.15.4 stack, and timer 1 is used by JenOS)

For the interrupt handler, it is implemented by JenOS, which would call the used defined PWRM_CALLBACK(Wakeup) function.

And an update, it looks like to be some initialization procedure in the PWRM_CALLBACK(wakeup) that caused the issue.

Here is the details:

The following code snip would have the issue:

PWRM_CALLBACK(Wakeup)

{

...

DBG_vInit();

UART_vInit();

...

PWRM_eScheduleActivity(&sWake_fast, 20000, vWakeDataRequest);

OS_vRestart();

...

}

While the following looks to be solved the issue(at least it is not reproduced for several weeks, compare to several days previously )

PWRM_CALLBACK(Wakeup)

{

...

DBG_vInit();

UART_vInit();

...

OS_vRestart();

PWRM_eScheduleActivity(&sWake_fast, 20000, vWakeDataRequest);

...

}

So in summary, if calling PWRM_eScheduleActive() before OS_vRestart() in PWRM wake up callback, there would be some issue.

Does it make sense? .e.g: some interval implementation....

0 Kudos
Reply

1,431 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Eric,

The OS_vRestart() is used to restart the RTOS following a warm start with memory held. The function re-initiates the interrupt hardware.

The scheduling wake events is applicable when the memory is held. 

Best Regards,

Mario

0 Kudos
Reply