OS Timer interface for bare metal

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

OS Timer interface for bare metal

Jump to solution
697 Views
durga_choudhury
Contributor V

In the older driver model that worked with S32DS for ARM, there was an API for timer delay that supported bare metal implementation. In the new Real Time Driver model, I cannot find an equivalent. Trying to do that creates an error; please see the attached screen shot.

 

Is there a way to do that?

 

Details about the project:

MCU: S32K148 in 144 pin configuration

System OS: Bare metal

RTD version: 3.0.0

Driver configuration: Low level (non-Autosar); please see the screenshot.

durga_choudhury_0-1769130089734.png

 

 

Tags (1)
0 Kudos
Reply
1 Solution
571 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @durga_choudhury,

1.

No there is no such function, individual drivers use the OsIf APIs, for example:

danielmartynek_0-1769519939394.png

2.

RTD includes:

  • AUTOSAR MCAL drivers
  • Low-level IP-level drivers

Only the highest (AUTOSAR) layer of MCAL is portable.

For example, Adc_Init().

But OsIf_GetElapsed() is not an AUTOSAR API, It is NXP-specific.

 

Regards,

Daniel

 

 

 

View solution in original post

0 Kudos
Reply
3 Replies
616 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @durga_choudhury,

Refer to OsIf.h, there are these functions:

OsIf_Init(),

OsIf_GetCounter(),

OsIf_MicrosToTicks(),

OsIf_GetElapsed(),

 

BR, Daniel

 

 

0 Kudos
Reply
597 Views
durga_choudhury
Contributor V

Hello @danielmartynek 

 

Thank you for the update. This is in agreement with what I had found. A couple of follow ups:

 

1. So there is no equivalent of OSIf_TimeDelay() in the Real Time drivers? I am seeing such gaps in other parts of the driver APIs as well which makes porting existing code somewhat non-trivial.

 

2. Are these APIs uniform across all MCAL implementations? Put another way, if I use hardware and MCAL implementation from another vendor who claims MCAL compliance, can I expect all these APIs to be available in their driver implementation? (You can read this the other way around also; if I am migrating to NXP FROM another vendor who claims MCAL compliance, can I expect NXP drivers to provide all the APIs that the other vendors driver provides?)

 

Best regards

Durga Choudhury

Tags (1)
0 Kudos
Reply
572 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @durga_choudhury,

1.

No there is no such function, individual drivers use the OsIf APIs, for example:

danielmartynek_0-1769519939394.png

2.

RTD includes:

  • AUTOSAR MCAL drivers
  • Low-level IP-level drivers

Only the highest (AUTOSAR) layer of MCAL is portable.

For example, Adc_Init().

But OsIf_GetElapsed() is not an AUTOSAR API, It is NXP-specific.

 

Regards,

Daniel

 

 

 

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2298624%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EOS%20Timer%20interface%20for%20bare%20metal%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2298624%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EIn%20the%20older%20driver%20model%20that%20worked%20with%20S32DS%20for%20ARM%2C%20there%20was%20an%20API%20for%20timer%20delay%20that%20supported%20bare%20metal%20implementation.%20In%20the%20new%20Real%20Time%20Driver%20model%2C%20I%20cannot%20find%20an%20equivalent.%20Trying%20to%20do%20that%20creates%20an%20error%3B%20please%20see%20the%20attached%20screen%20shot.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EIs%20there%20a%20way%20to%20do%20that%3F%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EDetails%20about%20the%20project%3A%3C%2FP%3E%3CP%3EMCU%3A%20S32K148%20in%20144%20pin%20configuration%3C%2FP%3E%3CP%3ESystem%20OS%3A%20Bare%20metal%3C%2FP%3E%3CP%3ERTD%20version%3A%203.0.0%3C%2FP%3E%3CP%3EDriver%20configuration%3A%20Low%20level%20(non-Autosar)%3B%20please%20see%20the%20screenshot.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22durga_choudhury_0-1769130089734.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22durga_choudhury_0-1769130089734.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22durga_choudhury_0-1769130089734.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22durga_choudhury_0-1769130089734.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22durga_choudhury_0-1769130089734.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F373984i1A34CD45E7BF1C6C%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22durga_choudhury_0-1769130089734.png%22%20alt%3D%22durga_choudhury_0-1769130089734.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2300529%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20OS%20Timer%20interface%20for%20bare%20metal%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2300529%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F160001%22%20target%3D%22_blank%22%3E%40danielmartynek%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThank%20you%20for%20the%20update.%20This%20is%20in%20agreement%20with%20what%20I%20had%20found.%20A%20couple%20of%20follow%20ups%3A%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E1.%20So%20there%20is%20no%20equivalent%20of%20OSIf_TimeDelay()%20in%20the%20Real%20Time%20drivers%3F%20I%20am%20seeing%20such%20gaps%20in%20other%20parts%20of%20the%20driver%20APIs%20as%20well%20which%20makes%20porting%20existing%20code%20somewhat%20non-trivial.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E2.%20Are%20these%20APIs%20uniform%20across%20all%20MCAL%20implementations%3F%20Put%20another%20way%2C%20if%20I%20use%20hardware%20and%20MCAL%20implementation%20from%20another%20vendor%20who%20claims%20MCAL%20compliance%2C%20can%20I%20expect%20all%20these%20APIs%20to%20be%20available%20in%20their%20driver%20implementation%3F%20(You%20can%20read%20this%20the%20other%20way%20around%20also%3B%20if%20I%20am%20migrating%20to%20NXP%20FROM%20another%20vendor%20who%20claims%20MCAL%20compliance%2C%20can%20I%20expect%20NXP%20drivers%20to%20provide%20all%20the%20APIs%20that%20the%20other%20vendors%20driver%20provides%3F)%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EBest%20regards%3C%2FP%3E%3CP%3EDurga%20Choudhury%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2300270%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20OS%20Timer%20interface%20for%20bare%20metal%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2300270%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F250000%22%20target%3D%22_blank%22%3E%40durga_choudhury%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3ERefer%20to%26nbsp%3BOsIf.h%2C%20there%20are%20these%20functions%3A%3C%2FP%3E%0A%3CP%3EOsIf_Init()%2C%3C%2FP%3E%0A%3CP%3EOsIf_GetCounter()%2C%3C%2FP%3E%0A%3CP%3EOsIf_MicrosToTicks()%2C%3C%2FP%3E%0A%3CP%3EOsIf_GetElapsed()%2C%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBR%2C%20Daniel%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2301360%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20OS%20Timer%20interface%20for%20bare%20metal%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2301360%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F250000%22%20target%3D%22_blank%22%3E%40durga_choudhury%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3E1.%3C%2FP%3E%0A%3CP%3ENo%20there%20is%20no%20such%20function%2C%20individual%20drivers%20use%20the%20OsIf%20APIs%2C%20for%20example%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22danielmartynek_0-1769519939394.png%22%20style%3D%22width%3A%20406px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22danielmartynek_0-1769519939394.png%22%20style%3D%22width%3A%20406px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F374452i9F8A7FDF944077A5%2Fimage-dimensions%2F406x278%3Fv%3Dv2%22%20width%3D%22406%22%20height%3D%22278%22%20role%3D%22button%22%20title%3D%22danielmartynek_0-1769519939394.png%22%20alt%3D%22danielmartynek_0-1769519939394.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E2.%3C%2FP%3E%0A%3CP%3ERTD%20includes%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EAUTOSAR%20MCAL%20drivers%3C%2FLI%3E%0A%3CLI%3ELow-level%20IP-level%20drivers%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EOnly%20the%20highest%20(AUTOSAR)%20layer%20of%20MCAL%20is%20portable.%3C%2FP%3E%0A%3CP%3EFor%20example%2C%26nbsp%3BAdc_Init().%3C%2FP%3E%0A%3CP%3EBut%20OsIf_GetElapsed()%20is%20not%26nbsp%3Ban%20AUTOSAR%20API%2C%26nbsp%3BIt%20is%20NXP-specific.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3ERegards%2C%3C%2FP%3E%0A%3CP%3EDaniel%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CBR%20%2F%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E