none
OAL RTC alarm test failing in CTK RRS feed

  • Question

  • Hi,

    I am trying to debug the mentioned test of CTK. I see following failure in the logs:

    INFO: The alarm will be set to fire in 10 seconds.
          INFO:
          INFO: RTC will be set to this value = 1-1-2006 14:21:36
          INFO: Alarm will be set to this value = 1-1-2006 14:21:46
          INFO: Alarm is set to fire in 10 seconds.  Waiting...
          *** ERROR *** Timeout waiting for alarm. Waited 20002ms
          INFO: Current RTC Time = 1-1-2006 14:21:55
          INFO:
          *** ERROR *** Test failed. The alarm did not fire after 10 seconds.

    Similar to this print, I see for many durations(in this case 10 secs.) the failure is printed.

    On MSDN, they have recommended to execute this test on an image with minimal OS configuration.

    Any idea, how to debug this issue? What could be this minimal OS configuration?

    Any inputs on same are welcome.

    Monday, August 5, 2013 1:13 PM

Answers

  • As mentioned in my above post, after using CeSetUserNotificationEx() in place of SetKernelAlarm() issue got resolved. Apart from this there was a type-casting issue (of a variable) in CTK code as well.

    Now all the sub-tests under OAL RTC Alarm CTK Test are passing.

    Jyoti

    • Marked as answer by Jshukla_11 Friday, October 4, 2013 11:37 AM
    Friday, October 4, 2013 11:36 AM

All replies

  • Step 1: understand what the test is doing. The real-time clock chips typically have time-based alarms that can be fired to wake up the processor, cause a thread to awaken, etc. The test is saying that your alarm function doesn't work. The time was set to a value, the alarm set for 10 seconds later and the alarm never fired.

    Step 2: figure out where your code gets involved. You didn't say what version of Windows CE you're using or what BSP. The OAL requires functions to set the time and alarm time. One of those is likely broken or you've failed to enable and handle the RTC chip's interrupt.

    Step 3: ignore the minimal OS configuration recommendation. All that will do is delay problem debugging.

    Paul T.

    Monday, August 5, 2013 4:28 PM
  • Hi Paul,

    I am using Windows CE 7 version and OMAP4470.

    I have read somewhere that "Microsoft requires that a one millisecond tick should be provided to the kernel by the OAL". So just suspecting that there might be something wrong/missing in the implementation of OAL.

    Tuesday, August 6, 2013 5:22 AM
  • I'd be surprised if the OAL didn't have tick support; no operation systems built based on the BSP would work if that were the case.

    That is *unrelated* to the error we're debugging here, also. You're looking for the CE7 OAL real-time clock functions OEMSetRealTime, OEMGetRealTime, and OEMSetAlarmTime.

    Paul T.

    Tuesday, August 13, 2013 10:05 PM
  • Yes, You are right.

    I shall look into the CTK test code and OAL implementation to set the time and alarm time.

    Had to work on some other issues so did not spend any time on this issue.

    Friday, September 20, 2013 1:00 PM
  • After working more on this issue I have some observations on this issue. The CTK test code is performing below steps:

    1. Set RTC to some date and time value (could be user defined also).
    2. Set Alarm to fire after 'n' secs (again 'n' could be user defined value). CTK is using SetKernelAlarm() API to set the alarm.
    3. Wait for alarm to fire after 'n' secs.

    I have put more debug messages in OAL code. And, I see that after 3rd step Alarm value is being set again to some random value (say to fire after 5-6 mins of RTC value). And, this call is not from test-code. Since test waits for some timeout value, which is far less than the random alarm value set, the test fails here. Logs of failure posted in my first comment also mention the same steps.

    Also on msdn, they have mentioned that "Do not use SetKernelAlarm() function if you have the notification subsystem in the image because the RTC alarm values are overwritten by the notification driver. Instead, use CeSetUserNotificationEx."

    If I see call-stack for OEMSetAlarmTime() before 2nd step and after 3rd step, I see TimeNotificationThrd() calling OEMSetAlarmTime(). So looks like above statement, mentioned in msdn is related to this issue.

    Now, I have following queries:

    1. What is notification subsystem and notification driver?
    2. Could this be causing this failure?

    Please respond if anyone has some inputs.

    Wednesday, September 25, 2013 1:32 PM
  • As mentioned in my above post, after using CeSetUserNotificationEx() in place of SetKernelAlarm() issue got resolved. Apart from this there was a type-casting issue (of a variable) in CTK code as well.

    Now all the sub-tests under OAL RTC Alarm CTK Test are passing.

    Jyoti

    • Marked as answer by Jshukla_11 Friday, October 4, 2013 11:37 AM
    Friday, October 4, 2013 11:36 AM
  • Good job!

    Paul T.

    Friday, October 4, 2013 5:49 PM