Supporting ADC in the Linux i.MX RT10XX BSP

This is an add-on product that installs on top of the Linux BSP for the NXP i.MX RT EVK board. It must be purchased separately from the Linux BSP product.

1. Overview

This document provides information on how to use ADC in the uClinux i.MX RT10XX BSPs.

2. Requirements

2.1. Detailed Requirements

The following are the requirements for this project:

  1. Provide a Linux demo project combining all the requirements in this project.

  2. Develop Linux ADC device driver for the i.MX RT1050 ADC controller.

2.2. Detailed Non-Requirements

The following are the non-requirements for this project that may otherwise not be obvious:

  1. None

3. Design

3.1. Detailed Design

3.1.1. Design: Demo project

This project will enable the required ADC functionality in the Linux configuration ("embedded project") called rootfs, which resides in a projects/rootfs directory, relative to the top of the Linux i.MX RT10XX installation.

3.1.2. Design: Linux ADC Device Driver

The clock driver for IMXRT10XX SoC will be updated to support the ADC clock gates.

There is the existing vf610_adc driver in the Linux sources, which provides support for the ADC controller of the Vybrid and some other SoCs from the i.MX family. The i.MXRT10XX SoC has a similar ADC controller, however there are some low-level differences in the hardware interfaces (register offsets, etc). The driver will be updated to support the register set of the IMXRT10XX SoC. Support for the IMXRT10XX ADC will be enabled via the DTS kernel file, using the new fls,imxrt10xx-adc compatibility string.

3.2. Effect on Related Products

This project makes the following updates in the related products:

  • None

3.3. Changes to User Documentation

This project updates the following user documents:

  • None

3.4. Alternative Design

The following alternative design approaches were considered by this project but then discarded for some reason:

  • None

4. Test Plan

4.1. Secure Download Area

The downloadable materials developed by this project are available from a secure Web page on the Emcraft Systems web site. Specifically, proceed to the following URL to download the software materials:

  • For the i.MX RT1050 BSP (release 3.0.4):

The page is protected as follows:

Login: CONTACT EMCRAFT

Password: CONTACT EMCRAFT

  • For the i.MX RT1050 BSP (release 3.1.0):

The page is protected as follows:

Login: CONTACT EMCRAFT

Password: CONTACT EMCRAFT

  • For the i.MX RT1060 BSP (release 3.1.0):

The page is protected as follows:

Login: CONTACT EMCRAFT

Password: CONTACT EMCRAFT

4.2. Downloadable Files

The following files are available from the secure download area:

  • linux-adc.patch - patch to the Linux kernel sources;

  • projects-adc.patch - patch to the rootfs project;

  • rootfs.uImage - prebuilt bootable Linux image;

4.3. Test Set-Up

4.3.1. Hardware Setup

The following hardware setup is required for the i.MX RT 10XX board:

  • the i.MX RT1050 EVKB or i.MX RT1060 EVKB board.

4.3.2. Software Setup

The following software setup is required:

  1. Download the files listed in Section: "Downloadable Files" to the top of the Linux i.MX RT installation.

  2. Install the BSP, as per the respective "Installing and activating cross development environment" document in the "Software" section on the Emcraft site.

  3. From the top of the Linux installation, activate the Linux cross-compile environment by running:

    $ . ACTIVATE.sh
  4. From the top of the BSP installation, go to the Linux kernel tree and install the kernel patch, eg:

    $ cd linux/ $ patch -p1 < ../../linux-adc.patch
  5. From the top of the Linux installation, go to the projects sub-directory, and patch the rootfs project:

    $ cd projects/ $ patch -p1 < ../../projects-adc.patch
  6. Build the rootfs project:

4.4. Detailed Test Plan

4.4.1. Test Plan: Demo Project

Perform the following step-wise test procedure:

  1. Go to the projects/rootfs directory, build the loadable Linux image (rootfs.uImage) and copy it to the TFTP directory on the host:

  2. Boot the loadable Linux image (rootfs.uImage) to the target via TFTP and validate that it boots to the Linux shell:

4.4.2. Test Plan: Linux ADC Driver

Perform the following step-wise test procedure:

  1. Connect 3.3V to channel 9 of ADC1 (for this, one can wire J25.4 to J23.3)

  2. Check that the measurement on channel 9 of ADC1 is near maximum (4096):

  3. Connect GND to channel 9 of ADC1 (for this, one can wire J25.6 to J23.3)

  4. Check that the measurement on channel 9 of ADC1 is near minimum (0):

  5. Connect a wire with known voltage applied to channel 9 of ADC1.

  6. Check that the measurement on channel 9 of ADC1 corresponds to the applied voltage measured with a voltage meter:

    (3278 corresponds to 3278 * 0.805664062 = 2.6V )

  7. Repeat the tests with channels 0 of ADC1 (J23.2), 10 (J23.4) and 15 (J23.1)