Migrating from FreeRTOS to SafeRTOS on S32K34x

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

Migrating from FreeRTOS to SafeRTOS on S32K34x

848 Views
abhishekpeak
Contributor I

We are currently using FreeRTOS in our code base and are migrating to SafeRTOS on #S32K3x

Our code (with FreeRTOS) currently uses USING_OS_FREERTOS configuration for the OSIF layer. This allows the MCAL drivers to use different interrupt masking strategies based on context (BASEPRI in ISRs to allow higher-priority interrupts vs. PRIMASK in tasks). There is no official support for SafeRTOS while configuring the RTD/MCAL in S32 design studio, so either the option is to use the FreeRTOS or to use the bare metal approach. Configuring the NXP RTD OSIF layer with USING_OS_BAREMETAL, causes MCAL critical sections to use direct assembly instructions (cpsid i/cpsie i) without RTOS integration.

I am wondering what the best approach is. Using:

- BAREMETAL mode with manual interrupt management.
- FREERTOS with some kind of compatibility layer or changing the OSIF code for RTOS-aware critical sections.
- A native SafeRTOS integration approach (if there is one).

0 Kudos
Reply
1 Reply

827 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @abhishekpeak.,

You are correct, right now there is no native SafeRTOS integration approach, and as far as I know, we have no plan to provide it for customer use. NXP mainly focuses on the RTD driver which support MCAL layer in AUTOSAR. It is customer's willingness to select third-party RTOS, stacks, IDEs, compilers, etc. for their project.

Realistically, you could implement either approach for this, either baremetal or starting with FreeRTOS and eventually upgrading to SafeRTOS.

I found this document regarding scalability and the S32K family: S32K_SAFERTOS_Datasheet_v1.1.pdf.

Of course, this means that integration should be done with the support of a third-party.

Just as a note, you can also refer to S32K3 - NXP RTOS. The NXP RTOS is a real-time operating system which conforms to the AUTOSAR Specification of Operating System R21-11 rev. 0 specification. Since it is delivered by NXP, it is aligned with the RTD releases.

Best regards,
Julián

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2301486%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EMigrating%20from%20FreeRTOS%20to%20SafeRTOS%20on%20S32K34x%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2301486%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EWe%20are%20currently%20using%20FreeRTOS%20in%20our%20code%20base%20and%20are%20migrating%20to%20SafeRTOS%20on%20%23S32K3x%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3EOur%20code%20(with%20FreeRTOS)%20currently%20uses%20USING_OS_FREERTOS%20configuration%20for%20the%20OSIF%20layer.%20This%20allows%20the%20MCAL%20drivers%20to%20use%20different%20interrupt%20masking%20strategies%20based%20on%20context%20(BASEPRI%20in%20ISRs%20to%20allow%20higher-priority%20interrupts%20vs.%20PRIMASK%20in%20tasks).%20There%20is%20no%20official%20support%20for%20SafeRTOS%20while%20configuring%20the%20RTD%2FMCAL%20in%20S32%20design%20studio%2C%26nbsp%3Bso%20either%20the%20option%20is%20to%20use%20the%20FreeRTOS%20or%20to%20use%20the%20bare%20metal%20approach.%26nbsp%3BConfiguring%20the%20NXP%20RTD%20OSIF%20layer%20with%20USING_OS_BAREMETAL%2C%20causes%20MCAL%20critical%20sections%20to%20use%20direct%20assembly%20instructions%20(cpsid%20i%2Fcpsie%20i)%20without%20RTOS%20integration.%3CBR%20%2F%3E%3CBR%20%2F%3EI%20am%20wondering%20what%20the%20best%20approach%20is.%20Using%3A%3C%2FP%3E%3CP%3E-%20BAREMETAL%20mode%20with%20manual%20interrupt%20management.%3CBR%20%2F%3E-%20FREERTOS%20with%20some%20kind%20of%20compatibility%20layer%20or%20changing%20the%20OSIF%20code%20for%20RTOS-aware%20critical%20sections.%3CBR%20%2F%3E-%20A%20native%20SafeRTOS%20integration%20approach%20(if%20there%20is%20one).%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2301530%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Migrating%20from%20FreeRTOS%20to%20SafeRTOS%20on%20S32K34x%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2301530%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%2F255893%22%20target%3D%22_blank%22%3E%40abhishekpeak%3C%2FA%3E.%2C%3C%2FP%3E%0A%3CP%3EYou%20are%20correct%2C%20right%20now%20there%20is%20no%26nbsp%3Bnative%20SafeRTOS%20integration%20approach%2C%20and%20as%20far%20as%20I%20know%2C%20we%20have%20no%20plan%20to%20provide%20it%20for%20customer%20use.%20NXP%20mainly%20focuses%20on%20the%20RTD%20driver%20which%20support%20MCAL%20layer%20in%20AUTOSAR.%20It%20is%20customer's%20willingness%20to%20select%20third-party%20RTOS%2C%20stacks%2C%20IDEs%2C%20compilers%2C%20etc.%20for%20their%20project.%3C%2FP%3E%0A%3CP%3ERealistically%2C%20you%20could%20implement%20either%20approach%20for%20this%2C%20either%20baremetal%20or%20starting%20with%20FreeRTOS%20and%20eventually%20upgrading%20to%20SafeRTOS.%3C%2FP%3E%0A%3CP%3EI%20found%20this%20document%20regarding%20scalability%20and%20the%20S32K%20family%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fwww.highintegritysystems.com%2Fdownloads%2Fmanuals_and_datasheets%2FS32K_SAFERTOS_Datasheet_v1.1.pdf%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3ES32K_SAFERTOS_Datasheet_v1.1.pdf%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3EOf%20course%2C%20this%20means%20that%20integration%20should%20be%20done%20with%20the%20support%20of%20a%20third-party.%3C%2FP%3E%0A%3CP%3EJust%20as%20a%20note%2C%20you%20can%20also%20refer%20to%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fnxp.flexnetoperations.com%2Fcontrol%2Ffrse%2Fproduct%3Fchild_plneID%3D860247%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3ES32K3%20-%20NXP%20RTOS.%3C%2FA%3E%26nbsp%3BThe%20NXP%20RTOS%20is%20a%20real-time%20operating%20system%20which%20conforms%20to%20the%20AUTOSAR%20Specification%20of%20Operating%20System%20R21-11%20rev.%200%20specification.%20Since%20it%20is%20delivered%20by%20NXP%2C%20it%20is%20aligned%20with%20the%20RTD%20releases.%3C%2FP%3E%0A%3CP%3EBest%20regards%2C%3CBR%20%2F%3EJuli%C3%A1n%3C%2FP%3E%3C%2FLINGO-BODY%3E