Keil Logo

iMX7 Dual Developer's Kit

Learning Platform

This page contains information and links that help you to create your own Linux image on the Embedded Artists' iMX7 Dual Developer's Kit in order to be able to debug your system with DS-MDK and ULINKpro.
The following buttons let you download a pre-configured Linux image for use with DS-MDK, as well as the debug symbols and the kernel sources for Linux kernel debugging. All are based on Yocto:

 Linux Image  Debug Symbols  Kernel Source

Hardware Setup

Hardware Setup iMX7D COM Board
  • Connect to the ARM Cortex-A7 using the FTDI Converter on (J35).
  • Connect to the ARM Cortex-M4 using the FTDI Converter (J15). When connecting to the M4, use a console via Ethernet to see the ARM Cortex-A7 output.
  • Connect a ULINKpro to the adapter with flat cable on the module's J1 port.
  • Use the J6/Ethernet port to connect to the Linux system using RSE.
  • Connect the 12V power supply.

This page contains the following information:

  • Create a Linux Image describes how to build your own Linux image for the iMX7 Dual Developer's Kit and how to add DS-MDK specific settings to the image.
  • Linux Kernel Module Debug shows how to debug a Linux kernel module with DS-MDK.
  • The Linux Kernel Debug application note explains how to load the Linux kernel debug information and the source code so that you can debug the full Linux kernel with DS-MDK.

Create a Linux Image

The necessary steps in order to build the BSP from source code are described in the Working with Yocto to Build Linux document.

Build the Image

Embedded Artists' documentation describes how to build the BSP from source. Just before the final step where you use bitbake to build the image, you need to do the following:

In the recipe local configuration file ~/ea-bsp/build/conf/local.conf, add the following line:

EXTRA_IMAGE_FEATURES += "package-management dev-pkgs tools-sdk tools-debug tools-profile eclipse-debug"

Remove the following lines if a root password is not desired:

INHERIT += " extrausers"
  useradd -p '' tester; \
  usermod -s /bin/sh tester; \
  usermod -P 'pass' root \

Build the core-image-base recipe (it will take a long time):

bitbake core-image-base

(Optional for Streamline) Add Gator driver to source code by following the instructions from ARM.

Copy the driver folder into ~/ea-bsp/build/tmp/work/imx7dea_com-poky-linux-gnueabi/linux-ea/4.1.15-r0/build/source/drivers and rename it to "gator". Add this line to the drivers' Makefile:

obj-$(CONFIG_GATOR) += gator/

And to Kconfig:

source "drivers/gator/Kconfig"

Workaround for LOCAL_TIMERS absence: comment it out in the gator’s Kconfig:

#depends on LOCAL_TIMERS  || !(ARM && SMP)

In the file ~/ea-bsp/build/conf/local.conf add the following line:

IMAGE_INSTALL_append += "kernel-module-gator"

To prevent Linux from disabling the 240MHz clock which is required for JTAG debugging, add the following parameter into clks_init_on in the file ~/ea-bsp/build/tmp/work/imx7dea_com-poky-linux-gnueabi/linux-ea/4.1.15-r0/git/arch/arm/mach-imx/clk-imx7d.c:


Open kernel configuration utility and use your preferred configuration options. Take this .config file as a reference. Rewrite the file ~/ea-bsp/build/tmp/work/imx7dea_com-poky-linux-gnueabi/linux-ea/4.1.15-r0/defconfig with the same content as the new .config.

Rebuild and deploy kernel with new config:

bitbake -c compile -f linux-ea
bitbake -c deploy linux-ea
bitbake core-image-base

The output files will be in the folder ~/ea-bsp/build/tmp/deploy/images/imx7dea-com

Write the image files into the eMMC flash as described in the chapter 5 "Deploying Images" from the "Working with Yocto to Build Linux" document. The Manufacturing Tool is downloadable from here. Use the version for the Linux Kernel v4. Unzip the tool to your disk and overwrite the files located in Profiles\Linux\OS Firmware\files with the ones you have created or from the Linux image ZIP file.

(Optional for Streamline) Copy the gator daemon (gatord) into /lib/modules//kernel/drivers/gator/

On the U-Boot console, set the mmcargs parameter:

setenv mmcargs ‘setenv bootargs console=${console},${baudrate} root=${mmcroot} ${args_from_script} clk_ignore_unused’; saveenv;

On the U-Boot console, set the M4 device tree file:

setenv fdt_file imx7dea-com-kit-m4.dtb; saveenv; 

Linux Kernel Module Debug

Only a few things are required to make kernel module debugging work. This sections explains how to do this for the imx_rpmsg_tty module that is used in the example projects that are explained in detail in the Getting Started with DS-MDK user guide. Copy and build the projects RPMSG TTY RTX and Linux Application TTY as available from the i.MX 7 Pack.

  • Download and unzip the Linux kernel symbols, called vmlinux.
  • Download and unzip the kernel module source code and object file:

Create CMSIS C/C++ Project

Create a new CMSIS C/C++ Project for the Cortex-A7 processor of the i.MX 7. Name the project Kernel_Debug

Add two DS-5 Debugger scripts: right-click the project and select New → Other....
In the upcoming window select DS-5 Debugger → DS-5 Debugger Script. Specify the file names "stop" and "load_ko".

New DS-5 Debugger Script

In the stop.ds script add:


In the load_ko.ds script add:

add-symbol-file imx_rpmsg_tty.ko

Note: Make sure that the file is stored in the workspace so that DS-MDK can find it. Otherwise, specify the fully qualified path to it.

The stop command in the first script will halt the processor before loading the kernel symbols and the add-symbol-file command will load the kernel module object file.

Right-click the project and select Debug As → CMSIS DS-5 Debugger....
On the Connections tab, set the CPU Instance to either 0 or SMP. Go to the Advanced tab and specify the path to the vmlinux file and enable Load symbols only. Also, set the initialization debugger scripts as shown here:

Create Debug Configuration

Apply the settings and close the dialog.

Debug the Kernel Module

The following steps are required to come to a point where you can debug the kernel module:

  • Restart your target and halt in U-Boot.
  • Debug and run the Cortex-M4 application RPMSG TTY RTX.
  • Boot Linux.
  • At the Linux prompt, issue the following command to install the driver for the kernel module: modprobe imx_rpmsg_tty.
  • Debug and run the Kernel_Debug project.
  • Now, you can open the imx_rpmsg_tty.c and set breakpoints.
  • Finally, debug the Linux Application TTY as well (make sure that the RSE connection is still live). When you run the application, the debugger will stop at the breakpoint you have set in the previous step.
Debug Linux Kernel Module
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.