Microsecond delay outside of FreeRTOS task on S32K344

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

Microsecond delay outside of FreeRTOS task on S32K344

2,835件の閲覧回数
tony-atlismv
Contributor III

I'm trying to use a microsecond delay function prior to starting the FreeRTOS schedular on the S32K344. At first, I was thinking of using the Osif System Timer, but that seems to be disabled when the FreeRTOS OS is enabled (OsIf_Timer_System_GetCounter() always returns 0). I cannot use xTaskGetTickCount() since this is only valid after vTaskStartScheduler has been called, which in my code has not yet called. I did try using simple assembly language loop but the count value necessary tends to be a very large since the instruction execution is in nanoseconds and I need around 500uS.

So, is there an alternative to use where I can get the system tick count? Or, would it be easier to use the STM and create a loop with the comparator? I couldn't not find any S32K3xx S32DS projects that had any timer examples. I thought about using the Osif Custom Timer, but not sure how to utilize it since there are again, no examples for it. Or is this disable also when using the FreeRTOS OS?

Thanks in advance.

0 件の賞賛
返信
1 返信

2,820件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

yes, that's correct, those FreeRTOS functions and SDK drivers which use OS services cannot be called before starting the scheduler.

The easiest option I can see is to create delay loop(s) even if the count value is very high.

Or there's PIT example in RTD in Gpt folder.

Regards,

Lukas

0 件の賞賛
返信