AUTOSAR OS

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

AUTOSAR OS

Jump to solution
2,830 Views
liuruowen
Contributor I

I use the sample project under this path(C:\NXP\AUTOSAR\S32K_AUTOSAR_OS_4_0_98_RTM_1_0_0\sample),so i have one question:

A SYSTEMTIMER counter is used in OsCounter in AUTOSAR OS,how to calculate the time of one tick?(This counter uses FTM0,what is the clock source of FTM0?)

What does the OsCounterTicksPerBase parameter do?

 

0 Kudos
1 Solution
2,807 Views
namnguyenviet
NXP Employee
NXP Employee

Hello,

FTM ticks can be calculated as below:

FTM ticks = Prescaler / Input Frequency.

While Prescaler can be chosen in EB tresos:

FTM1.JPG

Prescaler = 2^(OsValue), e.g. OsValue= 2 => Prescaler = 2^2 = 4.

FTM input Frequency is pretty much depended on SystemInit, in the sample application, FTM input Frequency is FIRC: 48MHz.

OsCounterTicksPerBase is implementation specific and as I know, not used in this package.

Best Regards,

Nam

View solution in original post

0 Kudos
4 Replies
2,808 Views
namnguyenviet
NXP Employee
NXP Employee

Hello,

FTM ticks can be calculated as below:

FTM ticks = Prescaler / Input Frequency.

While Prescaler can be chosen in EB tresos:

FTM1.JPG

Prescaler = 2^(OsValue), e.g. OsValue= 2 => Prescaler = 2^2 = 4.

FTM input Frequency is pretty much depended on SystemInit, in the sample application, FTM input Frequency is FIRC: 48MHz.

OsCounterTicksPerBase is implementation specific and as I know, not used in this package.

Best Regards,

Nam

0 Kudos
2,406 Views
icypistol
Contributor I

Thanks for your information.

Regarding your description of "FTM input Frequency is pretty much depended on SystemInit...", do you mean that, in this example, FTM0 input Frequency depends on the configuration for FTM0 in MCU Peripheral Clock Frequency?

By the way, it seems only FTM can be used as SystemTimer in HWCOUNTER. Does it means, the System Tick can not serve as the SystemTimer source in NXP Autosar OS? Thanks!

0 Kudos
2,395 Views
nxf31947
NXP Employee
NXP Employee

Regarding your description of "FTM input Frequency is pretty much depended on SystemInit...", do you mean that, in this example, FTM0 input Frequency depends on the configuration for FTM0 in MCU Peripheral Clock Frequency?

-> Yes, it will depends on SDK configuration

By the way, it seems only FTM can be used as SystemTimer in HWCOUNTER. Does it means, the System Tick can not serve as the SystemTimer source in NXP Autosar OS? Thanks!
-> choose System timer as SWCOUNTER and System Tick can serve as the SystemTimer 
Because SysTick doesn't support as Hardware counter

 
 
 
 
0 Kudos
2,625 Views
nxf31947
NXP Employee
NXP Employee

Actually, you can config tick duration( in nanoseconds ) like the picture below:

nxf31947_0-1611818696866.png

Sysgen will help you calculate clock divider value automatically
Check the generated output folder and you can see the define OSTICKDURATION 

0 Kudos