We have developed a FlexCAN (CAN driver) using NXP RTD 3.0.0 on S32DS as a bare-metal AUTOSAR MCAL implementation. We now need to integrate FreeRTOS as the RTOS for this project.
Our specific questions are:
1. Is it officially supported to run AUTOSAR MCAL drivers (RTD 3.0.0) under FreeRTOS instead of AUTOSAR OS?
2. If it is supported how to port FREERTOS any example SDK?
3. Are there any known limitations or additional configuration steps required in S32DS when using FreeRTOS with the Can driver (FlexCAN)?
4. What is the recommended interrupt priority setup for FlexCAN ISRs when using FreeRTOS (with respect to configMAX_SYSCALL_INTERRUPT_PRIORITY)?
Environment:
- MCU: [FRDM s32k344 ]
- RTD version: 3.0.0
- IDE: S32DS
- RTOS: FreeRTOS
- Driver: FlexCAN / Can driver (AUTOSAR MCAL)
HI ,
Julián_AragónM
Thanks for your early reply and fast response. Yes, it was a very helpful
Hi ,
1. Is it officially supported to run AUTOSAR MCAL drivers (RTD 3.0.0) under FreeRTOS instead of AUTOSAR OS?
Yes. NXP provides a FreeRTOS release for S32K3 based on RTD 3.0.0 for FreeRTOS kernel v10.5.1:
However, all of the routines are based on the low-level layer (LLD or IP), not the high-level layer (HLD or MCAL). Mainly because FreeRTOS is not ISO26262 certified.
2. If it is supported how to port FREERTOS any example SDK?
This is up to the customer. FreeRTOS implementation will depend on your project's complexity. As I've mentioned, we provide some example routines in the FreeRTOS package which you can use as reference:
There is also a lot of useful information in the FreeRTOS' user manual. It notes linker script, interrupt vector table, timers, interrupts along with RTD integration.
(FreeRTOS User Manual is available from version 6.0.0 and up.)
3. Are there any known limitations or additional configuration steps required in S32DS when using FreeRTOS with the Can driver (FlexCAN)?
Other than usual RTOS configurations (heap size, handlers, OS rate with timers, priorities, etc.), there are no specific FlexCAN + FreeRTOS limitations.
4. What is the recommended interrupt priority setup for FlexCAN ISRs when using FreeRTOS (with respect to configMAX_SYSCALL_INTERRUPT_PRIORITY)?
You can refer to this other community post: Solved: How to configure interrupt priorities when using freertos for s32k142 - NXP Community. It mentions S32K1, but the principles are the same. S32K3 also has 4 priority bits.
In case you are not too far in application development, I would suggest updating your current RTD version, as there have been several releases containing bug fixes, known issues and optimizations. Added to this, there is also a compatible FreeRTOS package with latest RTD release (7.0.1).
Hope this helps!
Best regards,
Julián