4.11. CDD UART Module

4.11.1. Acronyms and Definitions

Abbreviation/Term

Explanation

AUTOSAR

Automotive Open System Architecture

BSW

Basic Software

DET

Default Error Tracer

CDD

Complex Device Driver

DMA

Direct Memory Access

ISR

Interrupt Service Routine

INT

Interrupt

HW

Hardware

SW

Software

MCU

Micro Controller Unit

OS

Operating System

API

Application Programming Interface

UART

Universal Asynchronous Receiver Transmitter

4.11.2. Introduction

This document describes the functionality and configuration of the Cdd_Uart module.

Supported AUTOSAR Release

4.3.1

Supported Configuration Variants

Pre-Compile, Post-Build

Vendor ID

UART_VENDOR_ID (44)

Module ID

UART_MODULE_ID (255)

Supported Platform

AM263Px

The UART complex device driver provides data read and write transfer using the module unit channels in the device board.

4.11.3. Functional Overview

The driver is configurable for parameters such as baud rate, word length, parity, stop bits, IO mode, clock frequency, transmission and reception buffer threshold, and operating mode. Depending upon the IO Mode selected, the driver allows for both synchronous as well as asynchronous mode of data transfer.

The UART Driver provides services for reading and writing to/from

  1. UART Channels

  2. UART Ports / Serial Device

4.11.3.1. Driver Architecture

The UART driver has architecture as shown in below figure from the AM263 Technical Reference Manual

UART Module Pins

Fig. 4.52 UART interface

UART comes under the Complex Driver Design section under the AUTOSAR Classic Platform Architecture

CDD in AUTOSAR 4.3.1 layers

Fig. 4.53 AUTOSAR CDDs

4.11.3.2. Initialization

Cdd_Uart_Init() is the function responsible for initializing driver peripheral and opening its configured instances for transmission

4.11.3.3. States

UART driver maintains these below states as per the driver source condition:

  1. CDD_UART_UNINIT

  2. CDD_UART_INIT

4.11.3.4. Assumptions

For using DMA feature, driver assumes that cache initialization is done in application only and not done by the driver.

4.11.3.5. Limitations

None

4.11.3.6. Main Functions

  1. Cdd_Uart_Read() - This API is used for reading data using a given channel ID upto a specified length

  2. Cdd_Uart_Write() - This API is used for writing data using a given channel ID upto a specified data count

  3. Cdd_Uart_Cancel() - This API is used for cancelling an ongoing data transfer using a given channel ID in the given direction

  4. Cdd_Uart_GetRemainingWords() - This API is used for checking the remaining words count for an ongoing Interrupt or DMA mode data transfer

Note: Timeout Value parameter in Cdd_Uart_Read() and Cdd_Uart_Write() should be passed as number of ticks according to clock frequency. The clock source have changed from RTI timers which used 200MHz clock frequency to R5f timers which uses 400MHz clock frequency, so the timeout values need to be passed accordingly.

4.11.3.7. Design overview

Will be updated in future release

4.11.4. Hardware Features

4.11.4.1. IP Supported Features

  • Interrupt, Polling And DMA Mode. For DMA mode, only trigger level 1 is supported

  • Write, Read and Cancel Operation.

  • Read Return Full & Partial Mode.

  • Receiver line error status like overrun, framing.

4.11.4.2. Not supported Features

  • MODEM control functions.

  • Hardware Flow Control.

  • Partial Mode is only supported in interrupt mode and returns FIFO level chars.

  • IrDA and CIR Features.

4.11.4.3. Non compliance

4.11.4.3.1. Deviations to requirements (Requirement Traceability)

4.11.4.3.1.1. Deviation of requirements against AUTOSAR specification requirements

None

4.11.5. Source files

The files structure for the UART driver is similar to other drivers. The source is divided into headers under include/ and driver source within src/ directory under Uart driver path in MCAL. Cdd_Uart.c and Cdd_Uart.h are the 2 files that contain the provided driver API’s.

Static source C Files are defined below

📦AM263Px
┣ 📂build
┣ 📂mcal
┃ ┣ 📂Uart
┃ ┃ ┣ 📂include
┃ ┃ ┃ ┣ 📜Cdd_Uart.h : Shall specify the interface provided by the driver.
┃ ┃ ┃ ┣ 📜Cdd_Uart_Irq.h : contain interrupt service routines.
┃ ┃ ┣ 📂src
┃ ┃ ┃ ┣ 📜Cdd_Uart.c : Shall implement the CDD Uart driver functionality.
┃ ┃ ┃ ┣ 📜Cdd_Uart_Irq.c : contain interrupt service routines.
┃ ┃ ┣ 📂V0
┃ ┃ ┃ ┗ 📜Cdd_Uart_Priv.c : Shall implement the private functions.
┃ ┃ ┃ ┣ 📜Cdd_Uart_Priv.h : Contains device specific function declarations.
┃ ┃ ┃ ┣ 📜uart.c : Contains the UART driver implementations.
┃ ┃ ┃ ┣ 📜Uart.h : Contains Internal functions declarations for Uart driver.
┃ ┃ ┃ ┗ 📜uart_dma.h : Contains DMA related function declarations.
┃ ┃ ┃ ┣ 📜uart_dma_edma.c : Contains functions that support the Enhanced DMA mode for use with UART channels in DMA mode as IO mode.
┃ ┃ ┗ 📜Makefile
┃ 📂mcal_config
┃ 📂mcal_docs
┃ 📜README.txt

Plugin files are defined below in the table.

Plugin Files

Description

Cdd_Uart_Cfg.h

Contains the Precompile switches and Symbolic names

Cdd_Uart_Cfg.c

Contains all Pre-Compile Configured parameters

Cdd_Uart_PBcfg.c

Contains all Post-Build Configured parameters

4.11.6. Module requirements

Please refer Software Product Specification document provided as part of CSP.

4.11.6.1. Memory Mapping

Memory Mapping Sections

CDD_UART_CODE

CDD_UART_CODE_ISR

CDD_UART_VAR_NO_INIT

CDD_UART_VAR_ZERO_INIT

CDD_UART_PBCFG

CDD_UART_PBCFG_ROOT

CDD_UART_START_SEC_VAR_INIT_UNSPECIFIED(.bss)

x

CDD_UART_STOP_SEC_VAR_INIT_UNSPECIFIED

x

CDD_UART_START_SEC_CODE_APPL(.text)

x

CDD_UART_STOP_SEC_CODE_APPL

x

CDD_UART_START_SEC_VAR_UNSPECIFIED(.data)

x

CDD_UART_STOP_SEC_VAR_UNSPECIFIED

x

CDD_UART_START_SEC_CODE(.text)

x

CDD_UART_STOP_SEC_CODE

x

CDD_UART_START_SEC_PBCFG(.data)

x

CDD_UART_STOP_SEC_PBCFG

x

CDD_UART_START_SEC_PBCFG_ROOT(.const)

x

CDD_UART_STOP_SEC_PBCFG_ROOT

x

4.11.6.2. Scheduling

There are no scheduled functions within the CDD UART driver

4.11.6.3. Error handling

4.11.6.3.1. Development Error Reporting (DET)

The Cdd_UartDriver will report development errors on enabling UART_DEV_ERROR_DETECT == STD_ON in Cdd_Uart_Cfg.h

Refer API documentation for list of development errors reported by UART Driver

4.11.6.3.2. Parameter checking

AUTOSAR requires that API functions check the validity of their parameters. The checks are described in spec and are done as internal parameter checks of the API functions. These checks are for development error reporting and can be en-/disabled separately. Refer to the configuration chapter where the en-/disabling of the checks is described. En-/disabling of single checks is an addition to the AUTOSAR standard which requires to en-/disable the complete parameter checking via the parameter UART_DEV_ERROR_DETECT.

4.11.6.3.3. Production Code Error Reporting

By default, production code related errors are reported to the DEM using the service DEM_ReportErrorStatus().

4.11.7. Used resources

4.11.7.1. Interrupt Handling

Following Interrupt Service Routines are present in UART:

  1. Cdd_Uart_ChannelIsr - The Channel-based Interrupt Subroutine calls handler function based on the selected channel.

  2. CDD_EDMA_lld_transferCompletionMasterIsrFxn - The common-channel DMA-based Interrupt Subroutine calls handler function available for transfer completion.

4.11.8. Integration description

4.11.8.1. Dependent modules

4.11.8.1.1. DET

The module UART depends on the DET (by default) in order to report development errors. Detection and reporting of development errors, DET shall be enabled or disabled by the switch CDD_UART_DEV_ERROR_DETECT = STD_ON in Cdd_Uart_Cfg.h, generated by using appropriate option check within the configurator plugin. The DET can be replaced optionally by an equivalent component which is responsible to recognize development errors, if no DET component is available.

4.11.8.1.2. MCU

The Cdd_Uart Modules expects the MCU modules to enable the GPIO registers used used by configuring the PRCM correctly. MCU module is responsible for setting up clock configuration for the driver, the hardware clock available on the board.

4.11.8.1.3. PORT

The Cdd_Uart Modules expects that PinMux is set correctly to configure the GPIO pins for appropriate UART channel ports. The pin direction shall also be set by the PORT driver

4.11.8.1.4. Callback Functions

The UART driver provides read, write and error call back functions supported for all channels targeted from UART Configurator Plugin

4.11.8.1.5. SchM (Optional)

If multiple AUTOSAR runnables have access to the same Data Store Memory block, the exported AUTOSAR specification enforces data consistency by using an AUTOSAR exclusive area. With this specification, the runnables have mutually exclusive access to the per-instance memory global data, which prevents data corruption. Beside the OS, the BSW Scheduler provides functions that UART module calls at begin and end of critical sections. This implementation requires 1 level of exclusive access to guard critical sections.

The data consistency mechanism that has to be applied to an ExclusiveArea might be domain, ECU or even project specific. The decision which mechanism has to be applied by RTE / Basic Software Scheduler is taken during ECU integration by setting the Exclusive Area configuration parameter RteExclusiveAreaImplMechanism. This parameter is an input for RTE generator. For UART Module, data consistency and exclusive access to critical sections are required for the following sections as shown in the table below:

Exclusive Area Functions used

UART Function calling Exclusive Area

Need for Exclusive Area

Recommended Exclusive Area Mapping

UART_EXCLUSIVE_AREA_0

UART_writeCancelNoCB
UART_writeCancelDmaNoCB
UART_readCancelNoCB
UART_readCancelDmaNoCB

To protect against multiple access for shared resources

ALL_INTERRUPT_BLOCKING : All interrupts should be blocked as this API’s can be called in the interrupts

4.11.8.2. Multi-core support

Not supported

4.11.9. Configuration

4.11.9.1. CddUartDriver

This container contains the configuration parameters and sub containers of the AUTOSAR Complex device driver (CDD) module.

4.11.9.1.1. CddUartChannel

Configuration of an individual UART channel.

4.11.9.1.1.1. CddUartHwID

Item

Name

CddUartHwID

Description

This parameter contains the Channel ID of UART port in the device.

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

CDD_UART_CHANNEL_ID_0

Range

CDD_UART_CHANNEL_ID_0
CDD_UART_CHANNEL_ID_1
CDD_UART_CHANNEL_ID_2
CDD_UART_CHANNEL_ID_3
CDD_UART_CHANNEL_ID_4
CDD_UART_CHANNEL_ID_5

4.11.9.1.1.2. CddUartClockFrequency

Item

Name

CddUartClockFrequency

Description

This parameter indicates the input clock frequency from the device.

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

48000000

Max-value

1000000000

Min-value

32000

4.11.9.1.1.3. CddUartBaudRate

Item

Name

CddUartBaudRate

Description

This parameter contains the desired Baud Rate to be used for transmission of signals.

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

115200

Max-value

12000000

Min-value

2400

4.11.9.1.1.4. CddUartIOMode

Item

Name

CddUartIOMode

Description

This parameter identifies the UART operational mode for the configured IP.

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

CDD_UART_MODE_INTERRUPT

Range

CDD_UART_MODE_POLLING
CDD_UART_MODE_INTERRUPT
CDD_UART_MODE_DMA

4.11.9.1.1.5. CddUartTXTriggerLevel

Item

Name

CddUartTXTriggerLevel

Description

This parameter identifies the UART transmission trigger level threshold for the configured UART.

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

CDD_UART_TRIGGER_LEVEL_16

Range

CDD_UART_TRIGGER_LEVEL_1
CDD_UART_TRIGGER_LEVEL_8
CDD_UART_TRIGGER_LEVEL_16
CDD_UART_TRIGGER_LEVEL_32
CDD_UART_TRIGGER_LEVEL_56

4.11.9.1.1.6. CddUartRXTriggerLevel

Item

Name

CddUartRXTriggerLevel

Description

This parameter identifies the UART trigger level threshold during receival for the configured UART.

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

CDD_UART_TRIGGER_LEVEL_16

Range

CDD_UART_TRIGGER_LEVEL_1
CDD_UART_TRIGGER_LEVEL_8
CDD_UART_TRIGGER_LEVEL_16
CDD_UART_TRIGGER_LEVEL_56
CDD_UART_TRIGGER_LEVEL_60

4.11.9.1.1.7. CddUartWordLength

Item

Name

CddUartWordLength

Description

This parameter identifies the word length for the packets used in data transmission with UART.

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

CDD_UART_WORD_LENGTH_8

Range

CDD_UART_WORD_LENGTH_5
CDD_UART_WORD_LENGTH_6
CDD_UART_WORD_LENGTH_7
CDD_UART_WORD_LENGTH_8

4.11.9.1.1.8. CddUartParity

Item

Name

CddUartParity

Description

This parameter specifies the parity of the bits transferred.

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

CDD_UART_PARITY_NONE

Range

CDD_UART_PARITY_NONE
CDD_UART_PARITY_ODD
CDD_UART_PARITY_EVEN

4.11.9.1.1.9. CddUartReadReturnModes

Item

Name

CddUartReadReturnModes

Description

This parameter identifies the UART read return modes.

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

CDD_UART_FULL_READ_RETURN

Range

CDD_UART_FULL_READ_RETURN
CDD_UART_PARTIAL_READ_RETURN

4.11.9.1.1.10. CddUartOperatingModes

Item

Name

CddUartOperatingModes

Description

This parameter identifies the UART operational mode for the configured channels.

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

CDD_UART_16x_OPER

Range

CDD_UART_13x_OPER
CDD_UART_16x_OPER
CDD_UART_16x_AUTO_OPER

4.11.9.1.1.11. CddUartStopBits

Item

Name

CddUartStopBits

Description

This parameter specifies the size of stop bits to use in data packets.

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

CDD_UART_STOP_BIT_1

Range

CDD_UART_STOP_BIT_1
CDD_UART_STOP_BITS_2

4.11.9.1.1.12. CddUartReadNotificationHandler

Item

Name

CddUartReadNotificationHandler

Description

This parameter is a read notification handler function.

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

CddUart_CallbackReadNotify

4.11.9.1.1.13. CddUartWriteNotificationHandler

Item

Name

CddUartWriteNotificationHandler

Description

This parameter is a write notification handler function.

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

CddUart_CallbackWriteNotify

4.11.9.1.1.14. CddUartErrorNotificationHandler

Item

Name

CddUartErrorNotificationHandler

Description

This parameter is a error notification handler function.

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

CddUart_CallbackErrorNotify

4.11.9.1.1.15. CddUartHwUnitCddDmaTxHandler

Item

Name

CddUartHwUnitCddDmaTxHandler

Description

References the CDD DMA handler used for CDD UART transmission

Multiplicity-Configuration-Class

Post-Build Time

VARIANT-POST-BUILD

Pre-Compile Time

VARIANT-PRE-COMPILE

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

4.11.9.1.1.16. CddUartHwUnitCddDmaRxHandler

Item

Name

CddUartHwUnitCddDmaRxHandler

Description

References the CDD DMA handler used for CDD UART reception

Multiplicity-Configuration-Class

Post-Build Time

VARIANT-POST-BUILD

Pre-Compile Time

VARIANT-PRE-COMPILE

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

4.11.9.2. CddUartGeneral

Item

Name

CddUartGeneral

Description

Switches the Cdd_Uart_GetVersionInfo function ON or OFF.

Post-build-variant-multiplicity

false

Origin

Texas Instruments

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

true

4.11.9.2.1. CddUartRegisterReadbackApi

Item

Name

CddUartRegisterReadbackApi

Description

Switches the Cdd_Uart_RegisterReadback function ON or OFF.

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

true

4.11.9.2.2. CddUartDeinitApi

Item

Name

CddUartDeinitApi

Description

Switches the Cdd_Uart_DeInit function ON or OFF.

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

true

4.11.9.2.3. CddUartWriteApi

Item

Name

CddUartWriteApi

Description

Switches the Cdd_Uart_Write function ON or OFF.

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

true

4.11.9.2.4. CddUartReadApi

Item

Name

CddUartReadApi

Description

Switches the Cdd_Uart_Read function ON or OFF.

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

true

4.11.9.2.5. CddUartCancelApi

Item

Name

CddUartCancelApi

Description

Switches the Cdd_Uart_Cancel function ON or OFF.

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

true

4.11.9.2.6. CddUartGetRemainingWordsApi

Item

Name

CddUartGetRemainingWordsApi

Description

Switches the Cdd_Uart_GetRemainingWords API which returns the remaining words to be transferred from the active device UART instance.

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

true

4.11.9.2.7. CddUartDevErrorDetect

Item

Name

CddUartDevErrorDetect

Description

Switches the Development Error Detection and Notification ON or OFF.

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

true

4.11.9.2.8. CddUartIrqType

Item

Name

CddUartIrqType

Description

This parameter contains a reference to the OsCounter, which is used by the UART driver.

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

0

Range

CDD_UART_ISR_VOID
CDD_UART_ISR_CAT1
CDD_UART_ISR_CAT2

Multiplicity-Configuration-Class

Post-Build Time

VARIANT-POST-BUILD

Pre-Compile Time

VARIANT-PRE-COMPILE

Max-value

16

Min-value

0

For using UART with DMA mode, take additional care with these configuration value with CDD DMA configuration:

  • separate DMA configuration shall be done for Tx and/or Rx of each UART instance configured for DMA IO mode using the CDD DMA configurator plugin. Make sure to set CddDmaInterruptEnable option provided there as UART peripheral shall make use of enhanced DMA with interrupt enabled.

  • UART Tx makes use of two parameters for Tx and Dummy param sets to service a dummy transfer request at the end as expected from HW IP. So make sure to have corresponding two parameter sets registered in a channel group on configurator plugin.

4.11.10. Examples

4.11.10.1. Overview

  1. Initialize MCU and Port using Mcu_Init() and Port_Init()

  2. Configure the interrupt using Cdd_Uart_InterruptConfiguration()

  3. For DMA Echo test, Initialize the DMA using API Cdd_Dma_Init()

  4. Initialize the UART peripheral using API Cdd_Uart_Init()

  5. Select the channel and buffer pointers for read and write

  6. Write the sample message to the terminal

  7. Write the message from Write buffer to the terminal to input the characters using Cdd_Uart_Write()

  8. Read the input message using Cdd_Uart_Read() and store it in the Read buffer

  9. Again write the message back which is read to echo the read message to the terminal

  10. Write the message to inform the echo has been completed

Note: By default UART0 instance is configured. For using UART1 instance of AM263x SOC, Configuration to be done in Tresos and channel name has to be modified in example application

4.11.10.2. Hardware Software Setup and Tools

  1. For testing UART1 instance in AM263x SOC, external Serial to USB convertor and docking station (HSEC 180 pin connector) is required.

  2. Connect the AM263x SOC to the docking station

  3. Do the connections as below

    HSEC Connector Serial to USB Convertor UART1 TxD pin (pin #162) Rx pin UART1 RxD pin (pin #161) Tx pin Ground Ground

  4. Connect the COM port with configured settings and run the example

4.11.10.3. Steps to build and run example

CDD UART DMA example application demonstrating the CDD UART driver features is present in Uart/uart_echo_dma_app under /examples folder.

The UART example app used to verify the data transmission and reception through a selected channel ID 0 of the available UART Hardware Units.

This application can be built from the build folder by running gmake –s uart_echo_dma_app PLATFORM=am263px.

The details of running the application and the setup required is part of the MCAL User Guide.

4.11.10.4. Example Logs


This is Uart Echo Test in DMA Mode
Please input 8 characters:
texusins
Echo has been completed.

All tests have passed!

4.11.10.5. File Structure

📦AM263Px
┣ 📂build
┣ 📂mcal
┃ ┣ 📂examples
┃ ┃ ┣ 📂Uart
┃ ┃ ┃ ┣ 📂uart_echo_dma_app
┃ ┃ ┃ ┃ ┣ 📂soc
┃ ┃ ┃ ┃ ┣ 📜Makefile
┃ ┃ ┃ ┃ ┣ 📜UartEchoDma.c : Contains UART Echo DMA test example.
┃ ┃ ┃ ┃ ┣ 📜UartEchoDma.h : Contains UART Echo DMA test example header.
┃ ┣ 📂examples_config
┃ ┃ ┣ 📂Uart_Demo_Cfg
┃ ┃ ┃ ┣ 📂soc
┃ ┃ ┃ ┃ ┣ 📂am263px
┃ ┃ ┃ ┃ ┃ ┣ 📂r5f0_0
┃ ┃ ┃ ┃ ┃ ┃ ┣ 📂include
┃ ┃ ┃ ┃ ┃ ┃ ┃ ┣ 📜Cdd_Uart_Cfg.h : Contains the Precompile switches, Symbolic names.
┃ ┃ ┃ ┃ ┃ ┃ ┣ 📂src
┃ ┃ ┃ ┃ ┃ ┃ ┃ ┣ 📜Cdd_Uart_Cfg.c : Contains all Pre-Compile Configured parameters
┃ ┃ ┃ ┃ ┃ ┃ ┃ ┣ 📜Cdd_Uart_PBcfg.c : Contains all Post-Build Configured parameters
┃ 📂mcal_config
┃ 📂mcal_docs
┣ 📜README.txt

4.11.11. FAQ’s

None

4.11.12. References

Technical Reference Manual