I want to port an existing PDK driver into our AUTOSAR environment. How can we achieve this?
For example, if we wish to port the I2C driver from the PDK, how would we go about doing this so we can include it in our project?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I want to port an existing PDK driver into our AUTOSAR environment. How can we achieve this?
For example, if we wish to port the I2C driver from the PDK, how would we go about doing this so we can include it in our project?
There are several modules that the PDK driver provides its drivers that might have redundant functionality with external build environments, such as an AUTOSAR environment. There are several components provided by the PDK that will get used by a driver, and you can link most of these into your project:
- ti.osal.aer5f (OSAL)
- rm_pm_hal.aer5f (Power Management, Reset Manager)
- ti.board.aer5f (Board Support)
- ti.csl.init.aer5f, ti.csl.aer5f (Chip Support Library)
- sciclient_direct.aer5f (Sciclient)
The Operating System Abstraction Layer (OSAL) will most likely have redundant functionality with the AUTOSAR environment, and the one with the most porting necessary. This module provides a variety of components such as Tasks, Semaphores, Timers, HW Interrupts, and others as detailed in the documentation.
There are a few options when using the OSAL Library:
- This is the simplest solution. Including the library as part of the build for the driver will allow the original PDK driver to work by simply linking all the necessary libraries from the PDK. The driver can simply by copied into the desired project.
- The specific driver can have all of it’s OSAL calls replaced by the AUTOSAR environment equivalent. This would still use OSAL APIs in the the other libraries taken from the PDK. However, there can be OSAL APIs in a driver and the AUTOSAR environment equivalents would allow for simple replacement. The following example from the SDK 8.0 I2C PDK driver shows a location where an OSAL function could be replaced, I2C_osal.h:
- Here, HwiP_disable() would be replaced with the corresponding function which can disable interrupts for critical sections of code.
- The most intensive solution is to replace the OSAL APIs with the AUTOSAR environment functions. Here, the OSAL APIs would need to be replaced in the OSAL library source. If this is the desired solution, a study needs to determine if it would be possible with the specific AUTOSAR environment being used.
* The following libraries can be pulled in for the PDK drivers being ported "as is", but they could have a dependency on the OSAL library.
This low-level driver provides APIs for power and thermal management. It does not interfere with the AUTOSAR environment capabilities, so the recommendation is to pull it in if needed. More information about it is provided in the documentation.
This library is used for devices specific board initialization and configuration. It can be necessary for running applications and This library can be pulled in to the AUTOSAR environment as needed. More information about it is provided in the documentation.
The CSL library contains information about the SoC such as memory addresses of modules, register fields, low-level drivers and more. It also includes core specific initialization, such as for an ARM R5F core. This library will be necessary for PDK drivers, which rely on the low-level drivers and definitions for modules.
Due to a centralized design for SoC system control, the SCICLIENT will most likely be necessary for a driver using it (as well as other library dependencies on this). It is in charge of many configurations such as interrupt routers, power management, and others.