Peripheral Drivers(Non Autosar)

ADC peripheral software stack explanation using NXP S32K144 MCU

Overview and motive To get to know what ADC driver and its features is is. To Understand How to use ADC Driver (software environment setup and chronology in software configuration)). ADC Driver GUI explanation for configuring ADC Peripheral. Relation of functions of ADC Driver functions via ADC peripheral features/registers. In Depth Understanding of ADC driver functions/data types, with questions like What and why? Chronology of APIs for using basic features of ADC Peripheral for doing CAN communication (How and When?) By basic features we mean the ADC conversion using Software trigger through interrupts. What is ADC Driver ADC Driver are set of libraries which are used for using ADC peripheral to do Analog to Digital values conversion via NXP S32K1xx Microcontrollers. Here by library, we mean a set of .h and .c files written in c language. These set of ADC libraries are: Library of ADC Peripheral Hardware registers. Library for ADC Peripheral Interrupt Handlers. Library for ADC peripheral API’s. Miscellaneous files for ADC. The first one contains the function and data types through which different features of FlexCAN peripheral are used. Features like of sending data, receiving data, configuring message id filter table and etc. It contains functions like: FlexCAN_IP_Send(). FlexCAN_IP_receive, FlexCAN_IP_RXFIFO and etc. The Second one also contains the functions and data types through which FlexCAN Peripheral registers. Are accessed. Kind of like Bare Metal codes of FlexCAN peripheral are written in this files. And the Functions of this file are used by FlexCAN_Ip.h/.c files. Third one contains the function definition and data types for for IRQ handler of FlexCAN Peripheral And the last one contains the misceeleneours Data types and macros for using flexCAN peripheral. In our application code, we are just going to add FlexCAN_Ip.h header file to access the FlexCAN Driver in our code. And these files are located in the root directory of S32 DS where software installtion of RTD package takes place. ADC Driver and Code Configuratin tool relation Software to install to use FlexCAN Peripheral Driver To use ADC Peripheral Driver, we need to install following things in your Host Desktop/PC: S32 Design Studio IDE 3.4 or 3.5 (any will work though here; we are going to use S32 Design Studio 3.4) S32K1 Real Time Drivers Version 1.0.0 S32 Design Studio 3.4 S32K1 Real Time Drivers Version 1.0.0 S32K1 RTD V1.0.0 is Software Stack for using NXP S32K1xx microcontrollers. It Contains Peripheral Driver library files for using the S32K1xx microcontroller peripherals. It supports all peripherals of S32K1xx MCU’s.  This Software Stack contains 2 packages: Autosaur MCAL layer complaint and standard based peripheral driver files for S32K1xx MCU’s. It is Autosar 4.4.0 complaint. Non-Autosar based peripheral driver files for S32K1xx MCU’s.  It is a collection of peripheral drivers designed to simplify and accelerate application development on NXP microcontrollers. From Learning point of view and long-term skill development, having handson with Autosaur MCAL layer based peripheral driver file would be a good starting point. But as a fresher it might be more challenging to start with autosar standard. So In this blog, we are going to explore Non-Autosar based peripheral driver for FlexCAN module.  Further once having basic Handson with Non-Autosar, will explore Autosar MCAL layer based peripheral driver. Refer to this blog/video to get to know how to install S32 Design Studio 3.4 and Install S32K1 Real Time Drivers v1.0.0. Also it is recommended to explore Code Configuration Tool and Project Creation Modules of S32 Design Studio IDE, so as to get understanding how to use S32 Design Studio throughout the learning cycle. How to use ADC Peripheral Driver GUI Configuration of FlexCAN Peripheral Driver ADC Important API’s Adc_Ip_Init(): Adc_Ip_DoCalibration(): Adc_Ip_StartConversion(): Adc_Ip_GetConvActiveFlag(): Adc_Ip_GetConvCompleteFlag(): Adc_Ip_GetConvData(): Adc_0_Isr (): ADC_CallBack()

Peripheral Drivers(Non Autosar)

FlexCAN Peripheral Software Stack Explanation using NXP S32K144 MCU

Overview and motive Objective is to: To get to know what is FlexCAN driver and its features. To Understand How to use FlexCAN Driver(software environment setup and chronology in software configuration)). FlexCAN Driver GUI explanation for configuring FlexCAN Peripheral. Relation of functions of FlexCAN Driver functions via FlexCAN peripheral features. In Depth Understanding of FlexCAN driver functions/data types, with questions like What and why? Chronology of APIs for using basic features of FlexCAN Peripheral for doing CAN communication(How and When?) By basic features we mean the CAN transmission and reception via Mailbox and FiFo mechanism using polling&Interrupt method. What is FlexCAN Driver FlexCAN Driver are set of libraries which are used for using FlexCAN peripheral to do CAN communication via NXP S32K1xx Microcontrollers. Here by library, we mean a set of .h and .c files written in c language. These set of FlexCAN libraries are: Library of FlexCAN Peripheral Hardware registers. Library for FlexCAN Peripheral Interrupt Handlers. Library for FlexCAN peripheral API’s. Miscellaneous files for FlexCAN. Now in FlexCAN Driver there are 3 sets: FlexCAN_Ip.h/.c FlexCAN_Ip_Hw_Access.h/.c FlexCAN IP_Irq.h/.c 3 extra header files: FlexCAN_Ip_DeviceReg.h/FlexCAN_Ip_Types.h/FlexCAN_Ip_Wrapper.h: The first one contains the function and data types through which different features of FlexCAN peripheral are used. Features like of sending data, receiving data, configuring message id filter table and etc. It contains functions like: FlexCAN_IP_Send(). FlexCAN_IP_receive, FlexCAN_IP_RXFIFO and etc. The Second one also contains the functions and data types through which FlexCAN Peripheral registers. Are accessed. Kind of like Bare Metal codes of FlexCAN peripheral are written in this files. And the Functions of this file are used by FlexCAN_Ip.h/.c files. Third one contains the function definition and data types for for IRQ handler of FlexCAN Peripheral And the last one contains the misceeleneours Data types and macros for using flexCAN peripheral. In our application code, we are just going to add FlexCAN_Ip.h header file to access the FlexCAN Driver in our code. And these files are located in the root directory of S32 DS where software installtion of RTD package takes place. FlexCAN Driver and Code Configuration tool relation. Now for using the FlexCAN peripheral, there is a feature of code configuration tool in S32DS via which we can configure the FlexCAN Driver in Gui base. That is instead of writing code, we can confiure how to use FlexCAN Module by GUI presentation. The code configuration tool in S32 Design Studio, generates the set of .c/.h files for FlexCAN peripheral. These are different from library files which I have explained above.  In these generated files it defines and initializes some of the variables. These variables are then used by FlexCAN APIs in the application code. This support of code configuration tool makes it easy for configuring FlexCAN module in easy way via GUI presentation and variables which are generated by code configuration tool are used as parameters in FlexCAN APIs to use them in application code. So, in short to say, code configuration tool generates the values of some of the parameters that has to be send in FlexCAN Driver API. Closure of FlexCAN Driver: There are number of files, functions and data types but for now we are going to concentrate on those which will be required for using FlexCAN in Standard CAN, in normal mode for transmitting and receiving via mailbox and FiFo mechanism. In FlexCAN library there are number of functions and data types through which all the features of FlexCAN peripheral can be used. But we are not going to dwell into all functions and data types. We are just going to cover the functions and data types through which we can send and transmit can data via mailbox/rxfifo mechanisms. As this is the scope of this course and module, for other functions and features you can explore our Advance CAN Courses or can reach out to us privately, Software to install to use FlexCAN Peripheral Driver To use FlexCAN Peripheral Driver, we need to install following things in your Host Desktop/PC: S32 Design Studio IDE 3.4 or 3.5 (any will work though here, we are going to use S32 Design Studio 3.4) S32K1 Real Time Drivers Version 1.0.0 S32 Design Studio 3.4 S32K1 Real Time Drivers Version 1.0.0 S32K1 RTD V1.0.0 is Software Stack for using NXP S32K1xx microcontrollers. It Contains Peripheral Driver library files for using the S32K1xx microcontroller peripherals. It supports all peripherals of S32K1xx MCU’s.  This Software Stack contains 2 packages: Autosaur MCAL layer complaint and standard based peripheral driver files for S32K1xx MCU’s. It is Autosar 4.4.0 complaint. Non-Autosar based peripheral driver files for S32K1xx MCU’s.  It is a collection of peripheral drivers designed to simplify and accelerate application development on NXP microcontrollers. From Learning point of view and long-term skill development, having handson with Autosaur MCAL layer based peripheral driver file would be a good starting point. But as a fresher it might be more challenging to start with autosar standard. So In this blog, we are going to explore Non-Autosar based peripheral driver for FlexCAN module.  Further once having basic Handson with Non-Autosar, will explore Autosar MCAL layer based peripheral driver. Refer to this blog/video to get to know how to install S32 Design Studio 3.4 and Install S32K1 Real Time Drivers v1.0.0. Also it is recommended to explore Code Configuration Tool and Project Creation Modules of S32 Design Studio IDE, so as to get understanding how to use S32 Design Studio throughout the learning cycle. How to use FlexCAN Peripheral Driver FlexCAN Driver can be used via S32 Design Studio Code Configuration tool which provides Graphical User Interface manner in S32 Design Studio IDE, through which we can generate the FlexCAN driver libraries and code automatically in our project. This thing makes it easy to develop applications fast and easy way. The Code Configuration tool generates 2 things: Library Files to use FlexCAN Peripheral. Configured parameters in the form of Data Types (structures, macros, arrays and etc.), which are used as input parameters in different functions of library files. Chronology to follow

Peripheral Drivers(Autosar)

Port Driver of Autosaur MCAL layer (S32K1xx MCU)

Motive: To get understanding of what Port Driver in Autosaur MCAL Layer stack do: Done: What is Port Driver in Autosaur? To get understanding of Different Functions and Data Types in Port Driver Module: Their description, their description with respect to parameters that are send to them, and how are those paramters configured via tool. How to configure different pins in autosar, using Port Driver Module. To get familiarity with Usecases and how to use different Port Driver Module APIs in what chronology. Autosar Documentation blogs: Understanding AUTOSAR and its Applications in the Automotive Industry (einfochips.com) AUTOSAR_SWS_BSWGeneral.pdf : This document explains the BSW layer configurtaion What is Port Driver in Autosar? Port Driver is Part of MCAL Layer in BSW layer of Autosar Stack. Port Driver is responsible for initializing and configuration of microcontroller pins and corresponding ports of those pins. Only Initilization part and configuration part. It initializes and configures pins and ports for various functionalities like: ADC, SPI, I2C, Ethernet, PWM and etc. According to alternate function pin mapping configurations of microcontroller. The Pins and ports which are configured by Port Driver Module, are used by the DIO (Digital Input/Output) Driver module. Only the pins and ports which are configured by Port Driver will be used by DIO Driver Module. Port Driver Module Provide following important functional specifications: Direction setting of Microcontroller pins (Input/Output). Initial value setting of microcontroller pin. Activation of Internal Pull-ups for microcontroller pin. Slew Rate control for microcontroller pins. Microcontroller Alternate function/GPIO registers are used by this layer. Important Data Types in Port Driver: Port_ConfigType: Port_PinType: Port_PinDirectionType: Port_PinModeType: Important Functions in Port Driver: Port_Init : Port_SetPinDirection: Port_RefreshPortDirection: Port_SetPinMode Documents to refer for Port Driver. AUTOSAR_SWS_PortDriver.pdf : This specification specifies the functionality, API and the configuration of the AUTOSAR Basic Software module PORT Driver. Important points of Port Driver? This PORT driver module completes the overall configuration and initialization of the port structure which is used in the DIO driver module. Therefore, the DIO driver works on pins and ports which are configured by the PORT driver. Important Data Types in Port Driver: Port_ConfigType: Port_PinType: Port_PinDirectionType: Port_PinModeType: Port_PinConfigType: Port_UnUsedPinConfigType: Port_Ci_Port_Ip_DigitalFilterConfigType: Port_Ci_Port_Ip_PinSettingsConfig: Port_ConfigType: Port_PinType: Port_PinDirectionType: Port_PinModeType: Port_ConfigType: It is a structure, which contains different contents to initialize the pin of the microcontroller as per user configuration. This Structure is used only in Port_Init() API. And the contents of this structure are changed automatically as we change the configurations in PORT Driver in .ebtresos. //This part has to be written more( Explain use configuration examples) Here by user configuration we mean: Input/Out direction, pull up enable or disable and etc. This structure contains the contents which are used for initialization of microcontroller pin. As the initialization of microcontroller pin is different in SoC’s. So, this structure has different contents from SoC to SoC and its content dependent on GPIO/DIO peripheral registers of corresponding microcontroller. S32K3xx typedef struct { uint16 u16NumPins; /**< @brief Number of used pads (to be configured) */ uint16 u16NumUnusedPins; /**< @brief Number of unused pads */ uint16 au16NumImcrs[PORT_NUM_SIUL2_INSTANCES_U8]; /**< @brief Used pads IMCRs number */ const Port_Siul2_UnUsedPinType *pUnusedPads; /**< @brief Unused pad id’s array and SIUL2 instance */ const Port_Siul2_UnUsedPinConfigType *pUnusedPadConfig; /**< @brief Unused pad configuration */ const Port_Siul2_PinConfigType *pUsedPadConfig; /**< @brief Used pads data configuration */ const Port_Siul2_ImcrConfigType *pImcrConfig[PORT_NUM_SIUL2_INSTANCES_U8]; /**< @brief Used pads IMCR configuration */ const uint32 *pau32Port_PinToPartitionMap; /**< @brief Pointer to pin partition mapping */ const uint8 *pau8Port_PartitionList; /**< @brief Pointer to used partitions */ const Siul2_Port_Ip_PinSettingsConfig *IpConfigPtr; /**< @brief Ip configuration */ const Tspc_Port_Ip_ObeGroupConfig *TspcIpConfigPtr; /**< @brief tspc configuration */ } Port_ConfigType; S32K1xx typedef struct { uint16 u16NumPins; /**< @brief Number of used pads (to be configured) */ uint16 u16NumUnusedPins; /**< @brief Number of unused pads */ const uint16 * pUnusedPads; /**< @brief Unused pad id’s array */ const Port_UnUsedPinConfigType * pUnusedPadConfig; /**< @brief Unused pad configuration */ const Port_PinConfigType * pUsedPadConfig; /**< @brief Used pads data configuration */ uint8 u8NumDigitalFilterPorts; /**< @brief Number of configured digital filter ports */ const Port_Ci_Port_Ip_DigitalFilterConfigType * pDigitalFilterConfig; /**< @brief Digital filter ports configuration */ const uint32 *pau32Port_PinToPartitionMap; /**< @brief Pointer to pin partition mapping */ const uint8 *pau8Port_PartitionList; /**< @brief Pointer to used partitions */ const Port_Ci_Port_Ip_PinSettingsConfig *IpConfigPtr; /**< @brief Ip configuration */ } Port_ConfigType; For now, we will focus on data structure elements of S32K1xx. u16NumPins : Number of pins which are configured u16NumUnusedPins : Number of unsused pins left( uint16 * pUnusedPads: const Port_UnUsedPinConfigType * pUnusedPadConfig: Port_PinConfigType * pUsedPadConfig: u8NumDigitalFilterPorts: Port_Ci_Port_Ip_DigitalFilterConfigType * pDigitalFilterConfig uint32 *pau32Port_PinToPartitionMap: uint8 *pau8Port_PartitionList: Port_Ci_Port_Ip_PinSettingsConfig *IpConfigPtr: Port_PinType: Use for symbolic name of a Port Pin. Sybolic name is the pin count of that pin. Port_PinDirectionType: Tab Content Port_PinModeType: Tab Content

Getting Started Getting Started with S32K3 MCU's

FreeMaster with S32 Design Studio(NXP Semiconductor)

https://youtu.be/N6w_xWoOH-Q Overview In this blog, we will get to know how to use FreeMaster Desktop Application Via S32 Design Studio. for NXP Semiconductors S32 automotive Microcontrollers. We Will be using ElecronicsV2 Development Board which has ARM Coretx M4 Processor based Automotive Microcontroller: S32K144 The objective of this blog series is to teach people on how to use FreeMaster Desktop application: which is a great tool for run time debugging, as it provides run time debug monitor(Oscilloscope, Watch Grid, sending 2-way commands) and data visualization (Creating animated GUI pages). The best part about this is that real time debugging and tracing can be done without any expensive or heavy debuggers (SWO/Jlink/JTAG/Lauterbach/PEMicro or etc) and that too on interesting GUI pages. One can Interface FreeMaster with our Target Development Board (ElecronicsV2/AutoboardV1), via UART, CAN, ProBug Jlink Debugger or even over TCP/IP network. To know more about FreeMaster: what is it, why it should be used and its features. Checkout This Blog: FreeMaster Debugging Tool – Get To Byte This is getting started blog to learn and teach how to use FreeMaster Desktop Application. Initially we will be using it via UART and ProBug Debugger. In later blogs and stages, we will be interfacing it via CAN, TCP/IP and exploiting many other features of FreeMaster. Subscribe yourself to get notified Blog will be out on 20th of June 2024. Right Now, blog is under development, so subscribe yourself from below button and tell us about your use-cases so that we can customise blogs according to your needs. Subscribe

Stay Updated With Us

Error: Contact form not found.