MCUXpresso SDK Documentation

lpuart_dma_rb_transfer

lpuart_dma_rb_transfer#

Overview#

The lpuart_dma Ring Buffer Example project is to demonstrate usage of the KSDK lpuart driver. In the example, a ring buffer will be used with DMA enabled, data received will be stored in ring buffer first, while IDLE line was detected, routine will read out the received characters, and echo back them to the terminal by using DMA mode. so, you can see the your pressed characters on the terminal.

And the ring buffer is achieved based on the DMA’s source address modulo feature, the base address should be aligned to a 0-modulo-boundary.

Supported Boards#

FRDM-K32L2B
Hardware requirements
  • Mini USB cable

  • FRDM-K32L2B board

  • Personal Computer

Board settings

No special is needed.

Prepare the Demo
  1. Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.

  2. Open a serial terminal on PC for OpenSDA serial device with these settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Reset the SoC and run the project.

Running the demo

When the demo runs successfully, the log would be seen on the OpenSDA terminal like:

LPUART DMA ring buffer example.
Board will send back received characters:

FRDM-MCXC242
Hardware requirements
  • Mini USB cable

  • FRDM-MCXC242 board

  • Personal Computer

Board settings

No special is needed.

Prepare the Demo
  1. Connect a mini USB cable between the PC host and the OpenSDA USB port on the board.

  2. Open a serial terminal on PC for OpenSDA serial device with these settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Reset the SoC and run the project.

Running the demo

When the demo runs successfully, the log would be seen on the OpenSDA terminal like:

LPUART DMA ring buffer example.
Board will send back received characters:

FRDM-MCXC444
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXC444 board

  • Personal Computer

Board settings

No special is needed.

Prepare the Demo
  1. Connect a type-c USB cable between the host PC and the MCU-Link USB port (J13) on the target board.

  2. Open a serial terminal with these settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Reset the SoC and run the project.

Running the demo

When the demo runs successfully, the log would be seen on the OpenSDA terminal like:

LPUART DMA ring buffer example.
Board will send back received characters:

TWR-KM35Z75M
Hardware requirements
  • Micro USB cable

  • TWR-KM35Z75M board

  • Personal Computer

  • USB to Com Converter

Board settings

Connect pin:

  • RX of USB2COM to J14-1

  • TX of USB2COM to J16-1

  • GND of USB2COM to J25-10

Prepare the Demo
  1. Connect USB to Com Converter between the host PC and the port on the board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Reset the SoC and run the project.

Running the demo

When the example runs successfully, the log would be seen on the UART Terminal port which connected to the USB2COM like:

LPUART DMA ring buffer example.
Board will send back received characters: