Embedded Artists iMX6 SoloX COM User manual

Working with Cortex-M4 on iMX6 SoloX COM
Copyright 2020 © Embedded Artists AB
Working with Cortex-M4 on
i.MX6 SoloX COM Board

Working with Cortex-M4 on iMX6 SoloX COM Board
Page 2
Copyright 2020 © Embedded Artists AB
Rev G
Embedded Artists AB
Jörgen Ankersgatan 12
SE-211 45 Malmö
Sweden
http://www.EmbeddedArtists.com
Copyright 2020 © Embedded Artists AB. All rights reserved.
No part of this publication may be reproduced, transmitted, transcribed, stored in a retrieval system, or
translated into any language or computer language, in any form or by any means, electronic,
mechanical, magnetic, optical, chemical, manual or otherwise, without the prior written permission of
Embedded Artists AB.
Disclaimer
Embedded Artists AB makes no representation or warranties with respect to the contents hereof and
specifically disclaim any implied warranties or merchantability or fitness for any particular purpose.
Information in this publication is subject to change without notice and does not represent a
commitment on the part of Embedded Artists AB.
Feedback
We appreciate any feedback you may have for improvements on this document. Send your comments
by using the contact form: www.embeddedartists.com/contact.
Trademarks
All brand and product names mentioned herein are trademarks, services marks, registered
trademarks, or registered service marks of their respective owners and should be treated as such.

Working with Cortex-M4 on iMX6 SoloX COM Board
Page 3
Copyright 2020 © Embedded Artists AB
Rev G
Table of Contents
1Document Revision History................................. 5
2Introduction........................................................... 6
2.1 Multi-Core........................................................................................ 6
2.2 Additional Documentation............................................................. 6
2.3 Conventions.................................................................................... 6
3Hardware Related.................................................. 7
3.1 Prerequisites................................................................................... 7
3.2 UART Interfaces on COM Carrier board version 1 ...................... 7
3.2.1 Applications for Freescale Sabre Board........................................ 8
3.3 UART interfaces on COM Carrier board version 2 ...................... 8
3.4 Terminal application ...................................................................... 9
4Download and Start an Application................... 10
4.1 Update boot partition with needed files ..................................... 10
4.2 Change the device tree file.......................................................... 11
4.3 Run from QSPI.............................................................................. 11
4.4 Run from TCM............................................................................... 11
4.5 Run from OCRAM......................................................................... 12
4.6 Run from DDR RAM ..................................................................... 13
5Remote communication applications (RPMsg) 14
5.1 Ping-pong application.................................................................. 14
6FreeRTOS ............................................................ 15
6.1 Installation .................................................................................... 15
6.1.1 File Structure............................................................................... 15
6.2 Board Support Package (BSP).................................................... 15
6.2.1 UART........................................................................................... 15
6.3 Build with ARM DS-5.................................................................... 16
6.3.1 BSP files...................................................................................... 18
6.4 Debug using DS-5 ........................................................................ 18
6.4.1 Setup the hardware..................................................................... 18
6.4.2 Import TCM version of “hello world” ............................................ 19
6.4.3 Create a new Debug configuration.............................................. 19
6.5 Build with ARM GCC.................................................................... 22
6.5.1 Install ARM GCC......................................................................... 22
6.5.2 Install MinGW.............................................................................. 22
6.5.3 Install CMake............................................................................... 25
6.5.4 Build Application.......................................................................... 26
6.6 Build with Eclipse and ARM GCC ............................................... 26
6.6.1 Install “GNU ARM Eclipse” plugins.............................................. 27

Working with Cortex-M4 on iMX6 SoloX COM Board
Page 4
Copyright 2020 © Embedded Artists AB
Rev G
6.6.2 Create project: New..................................................................... 27
6.6.3 Create project: Linked folders...................................................... 28
6.6.4 Create project: Exclude from build .............................................. 30
6.6.5 Create project: “Include” paths .................................................... 31
6.6.6 Create project: Settings............................................................... 32
6.6.7 Build application .......................................................................... 36
6.7 Debug using Eclipse.................................................................... 36
6.7.1 LPC-Link 2 with J-Link firmware.................................................. 36
6.7.2 J-Link GDB Server ...................................................................... 36
6.7.3 J-Link script files.......................................................................... 36
6.7.4 Connect LPC-Link 2 to the board................................................ 36
6.7.5 Create a debug configuration...................................................... 38
6.7.6 Start a debug session.................................................................. 39
6.8 Build with IAR Embedded Workbench ....................................... 41
7Use DS-MDK for Application Development ...... 42
7.1 Installation .................................................................................... 42
7.2 Package Manager......................................................................... 42
7.3 UART Pin Muxing ......................................................................... 43
7.4 Debug the M4 Application ........................................................... 43
7.4.1 Build the application.................................................................... 43
7.4.2 Setup the debug adapter............................................................. 43
7.4.3 Create a debug configuration...................................................... 44
7.5 Debug the Linux Application....................................................... 47
7.5.1 Build the application.................................................................... 47
7.5.2 Setup Remote System Explorer (RSE) ....................................... 47
7.5.3 Create Debug Configuration........................................................ 49
7.6 Simultaneous Debugging............................................................ 52
8Troubleshooting.................................................. 53
8.1 JTAG connection problem when Linux has booted.................. 53
8.1.1 Description of problem................................................................. 53
8.1.2 Solution ....................................................................................... 53
8.2 Allow user “root” to use an SSH connection............................. 53
8.3 Linux (A9) terminal/console doesn’t accept input while
debugging M4 ........................................................................................ 54

Working with Cortex-M4 on iMX6 SoloX COM Board
Page 5
Copyright 2020 © Embedded Artists AB
Rev G
1 Document Revision History
Revision
Date
Description
A
2015-11-11
First release
B
2016-01-20
-Added description about how to build FreeRTOS: Chapter Error!
Reference source not found. and Chapter 6
- Updated Chapter 4 to describe how to load an application to TCM,
OCRAM, and DDR memory.
C
2016-09-02
Added chapter 8 (troubleshooting)
D
2017-03-06
- Added section 6.6 describing how to build using Eclipse
- Added section 6.7 describing how to debug using Eclipse
E
2017-04-25
- Added chapter 7 describing how to use DS-MDK
F
2017-09-22
- Removed chapter about MQX. FreeRTOS is recommended to use.
- Minor updates and clarifications to other sections.
- Added section 8.3
G
2020-11-05
- Updated instructions with regard to the COM Carrier board V2.
- Major updates to chapter 4

Working with Cortex-M4 on iMX6 SoloX COM Board
Page 6
Copyright 2020 © Embedded Artists AB
Rev G
2 Introduction
This document provides you with step-by-step instructions for how to work with the Cortex-M4
microcontroller on the iMX6 SoloX COM Board (EAC00244). The iMX6 SoloX Developer’s Kit
(EAK00245) has been used when writing these instructions.
2.1 Multi-Core
The i.MX6 SoloX processor has two cores; one ARM Cortex-A9 core and one ARM Cortex-M4 core.
This is also known as heterogeneous multiprocessing (HMP). When developing and application that
will utilize both these cores there are a number of things you need to be aware of.
-Both cores might have access to peripheral blocks in the processor. For your application you
have to decide which core that is responsible for a peripheral. This decision can affect, for
example, the device tree (dtb) file used by Linux when initializing device drivers.
oIn the instructions a specific dtb file will be used that disable some peripherals
conflicting with Cortex-M4
-Cortex-A9 is always the primary core that is the first to boot and responsible for starting
Cortex-M4. This is done by the u-boot in our examples
-The Cortex-M4 application must be stored on the QSPI flash. In the examples the u-boot will
write the application image to QSPI flash
-There are ways to communication between the cores. Chapter Error! Reference source not
found.describes how to run an application that utilizes Multi-Core Communication (MCC).
2.2 Additional Documentation
Additional recommended documentation:
•Getting Started with the i.MX6 SoloX Developer’s Kit –shows you how to get started with the
hardware.
2.3 Conventions
A number of conventions have been used throughout to help the reader better understand the content
of the document.
Constant width text –is used for file system paths and command, utility and tool names.
$ This field illustrates user input in a terminal running on the
development workstation, i.e., on the workstation where you edit,
configure and build Linux
# This field illustrates user input on the target hardware, i.e.,
input given to the terminal attached to the COM Board
T
Th
hi
is
s
f
fi
ie
el
ld
d
i
is
s
u
us
se
ed
d
t
to
o
i
il
ll
lu
us
st
tr
ra
at
te
e
e
ex
xa
am
mp
pl
le
e
c
co
od
de
e
o
or
r
e
ex
xc
ce
er
rp
pt
t
f
fr
ro
om
m
a
a
d
do
oc
cu
um
me
en
nt
t.
.
This field is used to highlight important information

Working with Cortex-M4 on iMX6 SoloX COM Board
Page 7
Copyright 2020 © Embedded Artists AB
Rev G
3 Hardware Related
3.1 Prerequisites
To be able to follow all the instructions in this document the following is required.
•One iMX6 SoloX Developer’s Kit (EAK00331, EAK00245)
•If using the Developer’s Kit version 1 (V1) you need two FTDI cables for console output/input
from both the Cortex-A9 and the Cortex-M4. Please note that only one cable is included with
the Developer’s Kit V1. If you are using a Developer’s Kit version 2 (V2) you don’t need any
FTDI cables.
•One Debug interface board with 10-pos FPC cable (included with Developer’s Kit). Only
needed when debugging with ARM DS-5 as described in section 6.4
•Keil ULINK-Pro. Only needed when debugging with ARM DS-5 as described in section 6.4
•ARM DS-5 commercial license. Only needed when debugging with ARM DS-5 as described in
section 6.4
3.2 UART Interfaces on COM Carrier board version 1
Two consoles are needed when working with both the Cortex-A9 (running Linux) and the Cortex-M4
microcontroller. Connector J35 is used by Cortex-A9 and connector J15 is used by Cortex-M4 as
shown in Figure 1 below.
Figure 1 –COM Carrier board V1, UART connectors
Cortex-A9
Cortex-M4

Working with Cortex-M4 on iMX6 SoloX COM Board
Page 8
Copyright 2020 © Embedded Artists AB
Rev G
3.2.1 Applications for Freescale Sabre Board
If you are testing pre-compiled applications developed for the Freescale Sabre board then console
output will be available on different pins, that is, not on J15 connector. UART2 is used, but on pins that
are available on the XBee connector (J17), see Figure 2.
-Pin 4 –RX on board, TX on FTDI cable (yellow)
-Pin 9 –TX on board, RX on FTDI cable (orange)
-Pin 10 –Ground (black)
Figure 2 - UART2 on XBee connector
3.3 UART interfaces on COM Carrier board version 2
The COM Carrier board version 2 has a dual channel UART-to-USB bridge, meaning that you will get
two UART interfaces via one USB cable connected between the micro-B USB connector (J16) on the
carrier board and your PC.
There are jumpers on the carrier board that lets you select which UART interface that is connected to
the UART-to-USB bridge, see Figure 3. Jumpers J19/J20 let you select between using UART-A or
UART-C as console for the Cortex-A side. By default, these jumpers select the UART-A interface, that
is, jumpers are in upper position. This is the position they should have for the iMX6 SoloX.
Jumpers J17/18 lets you select between using UART-B or UART-C as console for the Cortex-M side.
By default, these jumpers are not inserted, but they should be in upper position for the iMX6 SoloX.

Working with Cortex-M4 on iMX6 SoloX COM Board
Page 9
Copyright 2020 © Embedded Artists AB
Rev G
Figure 3 - COM Carrier board V2, UART interface connectors
3.4 Terminal application
You need a terminal application (two instances of it to connect both to the Cortex-A side and the
Cortex-M side). We recommend Tera Term, but you can use the terminal application of your choice.
Connect to the virtual COM ports using 115200 as baud rate, 8 data bits, 1 stop bit, and no parity.
J18, J17, J19, J20
Left to right
J19, J20
Upper position: connect UART-A to Cortex-A console
Lower position: connect UART-C to Cortex-A console
J18, J17
Upper position: connect UART-B to Cortex-M console
Lower position: connect UART-C to Cortex-M console
J16
micro-B USB
connector

Working with Cortex-M4 on iMX6 SoloX COM Board
Page 10
Copyright 2020 © Embedded Artists AB
Rev G
4 Download and Start an Application
This section describes how to download and start a pre-compiled application.
4.1 Update boot partition with needed files
The remaining parts of this chapter assumes that the first partition of the eMMC contains the pre-
compile applications. If you have programmed your board using a UUU bundle from 2020-11-06 or
later the files will already have been copied to the eMMC flash. If you have programmed using an older
version and don’t want to update you can follow these instructions.
Note: It is not necessary to have the M4 applications on the eMMC, but for simplicity the
following instructions in this chapter assumes they are.
Download pre-compile applications
Go to http://imx.embeddedartists.com and download the file compiled_cortex_m4_apps.zip.
Direct link: http://imx.embeddedartists.com/imx6sx/compiled_cortex_m4_apps.zip
Copy via USB memory stick
There are several ways to copy these pre-compiled files to the eMMC, but here we will use a USB
memory stick.
1. Unpack the file compiled_cortex_m4_apps.zip file and copy the unpacked files to
the USB memory stick. This is something you do on your computer.
2. Boot into Linux and insert the USB memory stick into the USB host port on the carrier board.
You will see output like below in the console when inserting the USB memory stick. The most
important part is the last line that lists the device name (sda1).
[ 23.104504] usb 1-1.2: new high-speed USB device number 4 using ci_hdrc
[ 23.165591] usb 1-1.2: New USB device found, idVendor=0781, idProduct=5406,
bcdDevice= 0.10
[ 23.173972] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 23.194511] usb 1-1.2: Product: U3 Cruzer Micro
[ 23.199055] usb 1-1.2: Manufacturer: SanDisk Corporation
[ 23.204371] usb 1-1.2: SerialNumber: 0000185A49619848
[ 23.225447] usb-storage 1-1.2:1.0: USB Mass Storage device detected
[ 23.264533] scsi host0: usb-storage 1-1.2:1.0
[ 24.315418] scsi 0:0:0:0: Direct-Access SanDisk U3 Cruzer Micro 2.18 PQ:
0 ANSI: 2
[ 24.334542] scsi 0:0:0:1: CD-ROM SanDisk U3 Cruzer Micro 2.18 PQ:
0 ANSI: 2
[ 24.345768] sd 0:0:0:0: [sda] 8015505 512-byte logical blocks: (4.10 GB/3.82
GiB)
[ 24.364543] sd 0:0:0:0: [sda] Write Protect is off
[ 24.373248] sd 0:0:0:0: [sda] No Caching mode page found
[ 24.378630] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 24.443649] sda: sda1
3. Mount the USB memory stick and eMMC partition. The USB memory stick has in this
example the device name sda1 as can be seen in the output in step 2 above. The partition
on the eMMC that we will use is available at /dev/mmcblk2p1.
# mkdir /mnt/usb
# mount /dev/sda1 /mnt/usb

Working with Cortex-M4 on iMX6 SoloX COM Board
Page 11
Copyright 2020 © Embedded Artists AB
Rev G
# mkdir /mnt/mmcboot
# mount /dev/mmcblk2p1 /mnt/mmcboot
4. Copy the bin file(s) from the USB memory stick to the boot partition. In this example we are
only copying m4_hello_tcm.bin.
# cp /mnt/usb/m4_hello_tcm.bin /mnt/mmcboot/
5. Unmount the devices
# umount /mnt/usb
# umount /mnt/mmcboot
4.2 Change the device tree file
Some of the u-boot environment variables need to be updated.
1. You must have booted into the U-boot console.
2. Change the device tree file (dtb) to use by Linux.
=> setenv fdt_file imx6sxea-com-kit_v2-m4.dtb
=> saveenv
4.3 Run from QSPI
In this section the application is copied from eMMC to QSPI flash and then started.
Make sure you have built an application for QSPI or selected a pre-built application for QSPI (name
ends with _qspi). The application file must have been copied to eMMC as described in section 4.1
above.
1. You must have booted into the U-boot console.
2. Set the M4 file name in the m4image variable.
=> setenv m4image m4_hello_qspi.bin
3. Copy the Cortex-M4 application to QSPI flash.
=> run update_m4_from_sd
4. Boot the M4 application.
=> run m4boot
Note: If you have modified the m4boot variable as described in the sections below you can
revert back to the default setting (for QSPI booting) by running env default -a.
4.4 Run from TCM
Make sure you have built an application for TCM or selected a pre-built application for TCM (name
ends with tcm). The application file must have been copied to eMMC as described in section 4.1
above.
1. You must have booted into the U-boot console.

Working with Cortex-M4 on iMX6 SoloX COM Board
Page 12
Copyright 2020 © Embedded Artists AB
Rev G
2. Set the M4 file name in the m4image variable.
=> setenv m4image m4_hello_tcm.bin
3. Set the address where the application will run from (TCM memory in this case).
=> setenv m4runaddr 0x7f8000
4. Update the m4boot variable so it loads the image from eMMC to DDR memory, copies from
DDR memory to TCM memory and then boots the application.
=> setenv m4boot 'run loadm4image; cp.b ${loadaddr} ${m4runaddr}
${filesize}; bootaux ${m4runaddr}'
5. Save the changes
=> saveenv
6. Boot the M4 application.
=> run m4boot
4.5 Run from OCRAM
Make sure you have built an application for OCRAM or selected a pre-built application for OCRAM
(name ends with _ocram). The application file must have been copied to eMMC as described in
section 4.1 above.
1. You must have booted into the U-boot console.
2. Set the M4 file name in the m4image variable.
=> setenv m4image m4_hello_ocram.bin
3. Set the address where the application will run from (OCRAM memory in this case).
=> setenv m4runaddr 0x910000
4. Update the m4boot variable so it loads the image from eMMC to DDR memory, copies from
DDR memory to OCRAM memory and then boots the application.
=> setenv m4boot 'run loadm4image; cp.b ${loadaddr} ${m4runaddr}
${filesize}; bootaux ${m4runaddr}'
5. Save the changes.
=> saveenv
6. Boot the M4 application.
=> run m4boot

Working with Cortex-M4 on iMX6 SoloX COM Board
Page 13
Copyright 2020 © Embedded Artists AB
Rev G
4.6 Run from DDR RAM
Make sure you have built an application for DDR RAM or selected a pre-built application for DDR RAM
(name ends with _ddr). The application file must have been copied to eMMC as described in section
4.1 above.
1. You must have booted into the U-boot console.
2. Set the M4 file name in the m4image variable.
=> setenv m4image m4_hello_ddr.bin
3. Set the address where the application will run from (DDR memory in this case).
=> setenv m4runaddr 0x9ff00000
4. The default loadm4image variable will load to the address set in loadaddr variable. We
don’t want to set loadaddr to the same address as used by the M4 application since
loadaddr will also be used when loading the kernel. Instead we create a new
loadm4image_ddr variable that will load the application directly to the address where it
will be started.
=> setenv loadm4image_ddr 'fatload mmc ${mmcdev}:${mmcpart}
${m4runaddr} ${m4image}'
5. Update the m4boot variable so it loads the image from eMMC to DDR memory and then
boots the application.
=> setenv m4boot 'run loadm4image_ddr; bootaux ${m4runaddr}'
6. Save the changes.
=> saveenv
7. Boot the M4 application.
=> run m4boot

Working with Cortex-M4 on iMX6 SoloX COM Board
Page 14
Copyright 2020 © Embedded Artists AB
Rev G
5 Remote communication applications (RPMsg)
5.1 Ping-pong application
The RPMsg ping-pong application is an example of communication between the Cortex-A9 core and
the Cortex-M4 core using the RPMsg API.
1. Make sure the m4_rpmsg_ping_qspi.bin file is available on eMMC as described in
section 4.1 above.
2. Follow the instruction in section 4.3 for how to run an application from QSPI memory, but use
the file name m4_rpmsg_ping_qspi.bin instead of m4_hello_qspi.bin.
3. In the u-boot console add the boot argument uart_from_osc to extra_bootargs to
make Cortex-A9 and Cortex-M4 UART clocks match.
=> setenv extra_bootargs uart_from_osc
=> saveenv
4. Boot the M4 application
=> run m4boot
5. In the console for the Cortex-M4 you will now see the output below
RPMSG PingPong FreeRTOS RTOS API Demo...
RPMSG Init as Remote
6. In the console for Cortex-A9 boot into Linux
=> boot
7. When Linux has booted you need to load the rpmsg pingpong module.
# modprobe imx_rpmsg_pingpong
8. You will now see messages in both consoles / terminals.

Working with Cortex-M4 on iMX6 SoloX COM Board
Page 15
Copyright 2020 © Embedded Artists AB
Rev G
6 FreeRTOS
NXP has developed a number of sample applications and peripheral drivers for the Cortex-M4 bundled
together with the real-time operating system FreeRTOS.
6.1 Installation
The bundle can be downloaded from NXP’s website and the version used when writing these
instructions is v1.0.1. Follow the link below to download the bundle.
https://www.nxp.com/webapp/Download?colCode=FreeRTOS_MX6SX_1.0.1_WIN
NOTE: You need to register an account at nxp.com in order to get access to the FreeRTOS
installation package.
6.1.1 File Structure
When FreeRTOS has been installed you will have a file structure as shown in Figure 4.
Figure 4 - FreeRTOS file structure
6.2 Board Support Package (BSP)
The board support package (BSP) that is available in the FreeRTOS package is for the Freescale/NXP
i.MX6 SoloX Sabre board. Embedded Artists has at the time of writing this document not developed a
BSP for the i.MX6 SoloX COM board / Developer’s Kit. This means that changes (most often only pin
muxing) might be necessary before building and running any of the examples.
BSP files are located in the directory <FreeRTOS>\examples\imx6sx_sdb_m4\where
<FreeRTOS>is the installation path to FreeRTOS.
6.2.1 UART
The pin muxing for UART2 must be changed in order for console output (printf) to be available on
connector J15. For the Sabre board the GPIO1_IO06 and GPIO1_IO07 pins are used by UART2, but
on the iMX6 SoloX Developer’s Kit SD1_DATA0 and SD1_DATA1 must be used.
1. Open file <FreeRTOS>\examples\imx6sx_sdb_m4\pin_mux.c
2. Go to function configure_uart_pins
3. Go to the case statement and change the code as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|
\
\
I
IO
OM
MU
UX
XC
C_
_S
SW
W_
_P
PA
AD
D_
_C
CT
TL
L_
_P
PA
AD
D_
_S
SD
D1
1_
_D
DA
AT
TA
A1
1_
_S
SP
PE
EE
ED
D(
(2
2)
)
|
|
\
\
I
IO
OM
MU
UX
XC
C_
_S
SW
W_
_P
PA
AD
D_
_C
CT
TL
L_
_P
PA
AD
D_
_S
SD
D1
1_
_D
DA
AT
TA
A1
1_
_D
DS
SE
E(
(6
6)
)
|
|
\
\
I
IO
OM
MU
UX
XC
C_
_S
SW
W_
_P
PA
AD
D_
_C
CT
TL
L_
_P
PA
AD
D_
_S
SD
D1
1_
_D
DA
AT
TA
A1
1_
_S
SR
RE
E_
_M
MA
AS
SK
K
|
|
\
\
I
IO
OM
MU
UX
XC
C_
_S
SW
W_
_P
PA
AD
D_
_C
CT
TL
L_
_P
PA
AD
D_
_S
SD
D1
1_
_D
DA
AT
TA
A1
1_
_H
HY
YS
S_
_M
MA
AS
SK
K;
;
I
IO
OM
MU
UX
XC
C_
_U
UA
AR
RT
T2
2_
_I
IP
PP
P_
_U
UA
AR
RT
T_
_R
RX
XD
D_
_M
MU
UX
X_
_S
SE
EL
LE
EC
CT
T_
_I
IN
NP
PU
UT
T
=
=
I
IO
OM
MU
UX
XC
C_
_U
UA
AR
RT
T2
2_
_I
IP
PP
P_
_U
UA
AR
RT
T_
_R
RX
XD
D_
_M
MU
UX
X_
_S
SE
EL
LE
EC
CT
T_
_I
IN
NP
PU
UT
T_
_D
DA
AI
IS
SY
Y(
(2
2)
);
;
6.3 Build with ARM DS-5
This section describes how to setup ARM DS-5 to build the sample applications. The instructions are
originally from the document found at the location below (<FreeRTOS> is the path to where the
FreeRTOS bundle was installed).
<FreeRTOS>\doc\
Getting_Started_with_FreeRTOS_BSP_for_i.MX_6SoloX.pdf.
NOTE: You need a commercial license in order to run ARM DS-5 and you must also have
installed ARM DS-5 before following the instructions.
1. Start ARM DS-5
2. Import an application
a. Go to File →Import →General →“Existing Projects into Workspace” and click the
“Next” button as shown in Figure 5.

Working with Cortex-M4 on iMX6 SoloX COM Board
Page 17
Copyright 2020 © Embedded Artists AB
Rev G
Figure 5 - Import Existing Projects
b. Browse to the DS-5 project files for the application to import. In this example it is the
OCRAM version of “hello world” found at:
<FreeRTOS>\examples\imx6sx_sdb_m4\demo_apps\hello_world\
ds5
c. Click the Finish button
3. Choose build target by clicking on the arrow to the right of the “hammer” in to toolbar, see
Figure 6. When the target has been selected the project will be built. If target has previously
been selected it is enough to click on the “hammer” icon.
Figure 6 - Build targets
4. The built application is now available at the location below. There will be both an axf file and a
bin file. It is the bin file that should be loaded to the iMX6 COM SoloX Board as described in
chapter 4
<FreeRTOS>\examples\imx6sx_sdb_m4\demo_apps\hello_world\ds5\de
bug

Working with Cortex-M4 on iMX6 SoloX COM Board
Page 18
Copyright 2020 © Embedded Artists AB
Rev G
6.3.1 BSP files
Section 6.2 described changes that must be made to BSP files. When a project has been imported to
DS-5 it is possible to edit these files in DS-5 instead of an external editor. The files are found in the
“board” folder in the project, see Figure 7.
Figure 7 - DS-5 board folder
6.4 Debug using DS-5
With ARM DS-5, a Keil ULINK Pro, and a debug interface board it is possible to download and debug
an application on the Cortex-M4.
6.4.1 Setup the hardware
Figure 8 and Figure 9 show how the ULINK Pro and debug interface board is connected to the iMX6
SoloX COM Board.
Figure 8 - Debug interface board connected to COM board

Working with Cortex-M4 on iMX6 SoloX COM Board
Page 19
Copyright 2020 © Embedded Artists AB
Rev G
Figure 9 –ULINK Pro and debug interface board
6.4.2 Import TCM version of “hello world”
In this example we are going to debug the same application as was built in section 6.3 which is the
TCM version of Hello World.
6.4.3 Create a new Debug configuration
To be able to download and debug a “Debug configuration” must be created.
1. Go to Run →Debug Configurations and select DS-5 Debugger as shown in Figure 10.
Figure 10 - Debug Configurations
2. Right click on DS-5 Debugger and select “New”.
3. Give the configuration a name such as SoloX Cortex-M4 and then select the “Connection” tab
as shown in Figure 11.

Working with Cortex-M4 on iMX6 SoloX COM Board
Page 20
Copyright 2020 © Embedded Artists AB
Rev G
Figure 11 - Setup Debug Connection
4. In the “Connection” tab go to NXP →i.MX6 SoloX Sabre SDB →Bare Metal debug and
choose “Debug Cortex-M4” as shown in Figure 11.
5. Still in the “Connection” tab select ULINKpro in the “Target Connection” list and then click the
“Browse” button in the Connections section. Select the ULINKpro connection.
Please note that the ULINK pro debug adapter must be connected to your computer before
clicking the “Browse” button
6. Click on the “Files” tab and then the “Workspace” button. Select the axf file in the “debug”
folder as shown in Figure 12.
Figure 12 - Application to download
7. Go to the “Debugger” tab and select “Debug from entry point” as shown Figure 13.
This manual suits for next models
2
Table of contents
Other Embedded Artists Computer Hardware manuals