OSA_TimeDelay hanging on TWR-K64F120M

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

OSA_TimeDelay hanging on TWR-K64F120M

ソリューションへジャンプ
2,503件の閲覧回数
kalden_srcinc
Contributor IV

Calling OSA_TimeDelay on the TWR-K64F120M is hanging my application.  If I step through with the debugger it gets into OSA_TimeGetMsec and never returns.  Is there something special that needs to be initialized for these functions to work, or is this possibly a bug in the board specific files for this demo board?

 

Thanks

ラベル(1)
0 件の賞賛
返信
1 解決策
1,992件の閲覧回数
DavidS
NXP Employee
NXP Employee

Hi Kevin,

Try following please and let us know what happens.

#if 1 /* //DES 1=test, 0=default code */
  CLOCK_SYS_EnableLptimerClock(NULL); /* //DES enable clock to LPTMR0 module */
  LPTMR_HAL_SetFreeRunningCmd(LPTMR0, 1); /* //DES set LPTMR0 to free running */
  LPTMR_HAL_SetPrescalerClockSourceMode(LPTMR0, kPortLPOClock); /* //DES set LPTMR0 clock source to LPO */
  LPTMR_HAL_Enable(LPTMR0_BASE); /* //DES enable LPTMR0 module */

#endif

  RTC_DRV_SetDatetime(FSL_RTCTIMER1, &datetime_des);

  /* For example: for(;;) { } */

  while(1) {

  OSA_TimeDelay(1000/2); /* //DES test function that uses the lptmr. */
  PORT_HAL_SetHighGlobalPinCtrl(PORTB_BASE,21, 0x100);
  counter++;
  counter++;
  counter++;
  counter++;
  if(!(counter % 0x10000)) {
  RTC_DRV_GetDatetime(FSL_RTCTIMER1, &datetime_now);
  }

  }

Regards,

David

元の投稿で解決策を見る

0 件の賞賛
返信
7 返答(返信)
1,992件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hi Kevin,

Which version of KSDK do you use ?

And there is nothing to be initialized , it can directly use , like this :

pastedImage_0.png

If you still can not use it ,you can send your project to me or tell me how to recurrence your appearance.

BR

Alice

0 件の賞賛
返信
1,992件の閲覧回数
kalden_srcinc
Contributor IV

KSDK 1.1.0.

I'll strip my project down into a simple example case and post it here.  Just to clarify though, the function takes milliseconds, correct?

0 件の賞賛
返信
1,993件の閲覧回数
DavidS
NXP Employee
NXP Employee

Hi Kevin,

Try following please and let us know what happens.

#if 1 /* //DES 1=test, 0=default code */
  CLOCK_SYS_EnableLptimerClock(NULL); /* //DES enable clock to LPTMR0 module */
  LPTMR_HAL_SetFreeRunningCmd(LPTMR0, 1); /* //DES set LPTMR0 to free running */
  LPTMR_HAL_SetPrescalerClockSourceMode(LPTMR0, kPortLPOClock); /* //DES set LPTMR0 clock source to LPO */
  LPTMR_HAL_Enable(LPTMR0_BASE); /* //DES enable LPTMR0 module */

#endif

  RTC_DRV_SetDatetime(FSL_RTCTIMER1, &datetime_des);

  /* For example: for(;;) { } */

  while(1) {

  OSA_TimeDelay(1000/2); /* //DES test function that uses the lptmr. */
  PORT_HAL_SetHighGlobalPinCtrl(PORTB_BASE,21, 0x100);
  counter++;
  counter++;
  counter++;
  counter++;
  if(!(counter % 0x10000)) {
  RTC_DRV_GetDatetime(FSL_RTCTIMER1, &datetime_now);
  }

  }

Regards,

David

0 件の賞賛
返信
1,992件の閲覧回数
kalden_srcinc
Contributor IV

I just needed to add #include "fsl_clock_manager.h".

Yes this seems to have fixed the problem.  Is this code that should have been included in hardware_init  ?

0 件の賞賛
返信
1,992件の閲覧回数
DavidS
NXP Employee
NXP Employee

Hi Kevin,

Glad it is working for you.

Not certain if it should have been included so need time to dig into that.  At very least I would have thought the osa1:fsl_os_abstraction would have GUI to configure the lptmr.

Regards,

David

0 件の賞賛
返信
1,992件の閲覧回数
kalden_srcinc
Contributor IV

I should clarify that I am not using KDS.  This is all built from the command line.

0 件の賞賛
返信
1,992件の閲覧回数
kalden_srcinc
Contributor IV

what do I need to link to to get "CLOCK_SYS_EnableLptimerClock".  I am getting undefined reference.

0 件の賞賛
返信