Author Topic: SNTP compile error  (Read 6341 times)

Offline Mostafa

  • Newbie
  • *
  • Posts: 7
    • View Profile
SNTP compile error
« on: September 27, 2010, 10:58:26 PM »

After enabling sntp, I get the following errors:

../application.c: In function 'fnSynchroniseLocalTime':
../application.c:959: error: 'TIMER_FORCE_FRACTION' undeclared (first use in this function)
../application.c:959: error: (Each undeclared identifier is reported only once
../application.c:959: error: for each function it appears in.)
../application.c:961: error: 'TIMER_PERIOD_FULL_SCALE' undeclared (first use in this function)
../application.c: In function 'fnGetPresentTime':
../application.c:1306: warning: implicit declaration of function 'GET_TIMER_PRESENT_VALUE'
../application.c:1314: error: 'TIMER_PERIOD_FULL_SCALE' undeclared (first use in this function)
make: *** [Build/application.o] Error 1

I am aware of this post : http://www.utasker.com/forum/index.php?topic=823.0

However, I don't have access to SAM7X code.

Best regards,

Mostafa

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: SNTP compile error
« Reply #1 on: September 27, 2010, 11:50:54 PM »
Hi Mostafa

The SAM7X project may not help greatly since the missing code is HW dependent. The SNTP requires a HW time base which can be set and re-sysnchronised. To be able to use the SNTP on a different chip it is required to decide on which HW resources are to be used (assuming that they are available in some form) and then adapt the code to interface to them.

At the moment there is no such support in the LM3Sxxxx project but it may be possible to add it based on the following notes:

- The LM3Sxxxx project does have a TIMER_INTERRUPT_SETUP interface (it may not be exactly compatible and any missing support needs to be included there):
- TIMER_FORCE_FRACTION is in fact dummy in the SAM7X project since it is not possible to write a fraction to the counter in that device.
- #define TIMER_PERIOD_FULL_SCALE ((1000 * (MASTER_CLOCK/1024))/1000) This is used to convert the value in the HW timer to a fraction of a second (reference from SAM7X project and HW).
- #define GET_TIMER_PRESENT_VALUE()  TC_CV_2 This is used to read the present HW timer count value. It is simply the counter value of the HW timer being used.

Regards

Mark

Offline Mostafa

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: SNTP compile error
« Reply #2 on: September 28, 2010, 01:49:44 PM »
Thanks for this, Mark.

Mostafa