Spaces
Browse
Pages
Blog
Labels
Space Operations
Quick Search
Help
Online Help
Keyboard Shortcuts
Feed Builder
What’s new
Available Gadgets
About Embedian
Log In
Sign Up
Linux on SMARC
Linux on SMARC
SMARC-iMX8M_imx_4.19.35_1.0.0
Copy Page
You are not logged in. Any changes you make will be marked as
anonymous
. You may want to
Log In
if you already have an account. You can also
Sign Up
for a new account.
This page is being edited by
.
image-effects
image-attributes
search
attachments
weblink
advanced
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
Colour picker
More colours
Formatting
Strikethrough
Subscript
Superscript
Monospace
Clear Formatting
Bullet list
Numbered list
Task list
Outdent
Indent
Align left
Align center
Align right
Page Layout
Link
Table
Insert
Insert Content
Image
Link
Attachment
Symbol
Emoticon
Markup
Horizontal rule
Task List
Insert Macro
User Mention
JIRA Issue/Filter
Info
Status
Gallery
Table of Contents
Other Macros
Page Layout
No Layout
Two column (simple)
Two column (simple, left sidebar)
Two column (simple, right sidebar)
Three column (simple)
Two column
Two column (left sidebar)
Two column (right sidebar)
Three column
Three column (left and right sidebars)
Undo
Redo
Find/Replace
Keyboard Shortcuts Help
<p><img class="editor-inline-macro" src="/plugins/servlet/confluence/placeholder/macro?definition=e3RvYzpzdHlsZT1zcXVhcmV9&locale=en_GB&version=2" data-macro-name="toc" data-macro-parameters="style=square"></p><h1><span style="color: rgb(0,51,102);">Build and Install FreeRTOS for <em>SMARC-iMX8M</em> (<em>Cortex-M4</em> core)</span></h1><hr /><p>This document provides instructions for advanced users how Embedian offers patches and builds a customized version of FreeRTOS for Embedian's <em>SMARC-iMX8M</em> product platform and how to install the images to bring the evaluation board up and running. </p><p><span style="color: rgb(51,51,51);">Our aim is to fully support our hardware through device drivers. We also provide unit tests so that testing a board is easy and custom development can start precisely. The recommended host environment is Ubuntu 16.04.</span></p><p><span style="color: rgb(128,128,128);"><span style="color: rgb(51,51,51);">Before using this guide, we assume you understand how to setup a Yocto, Debian or Ubuntu working SD card. This guild apply to U-boot 2019.04 and Linux kernel 4.19.35 or higher. Here we are not mention Yocto/Debian/Ubuntu setup and compilation. There are well document available from Embedian.</span></span></p><p>There are several options in both processors, code can be located in one of the following:</p><ul><li><a href="https://github.com/boundarydevices/freertos-boundary/blob/imx8m_2.3_ga/boards/nitrogen8m/demo_apps/hello_world/armgcc/MIMX8MQ6xxxJZ_cm4_ram.ld">TCM</a> (Tightly Coupled Memory): 128kB available</li><li><a href="https://github.com/boundarydevices/freertos-boundary/blob/imx8m_2.3_ga/boards/nitrogen8m/demo_apps/hello_world/armgcc/MIMX8MQ6xxxJZ_cm4_ddr_ram.ld">DDR</a>: up to 1MB available (can be increased, set in the device tree)</li></ul><p>Note that the TCM is the preferred option when possible since it offers the best performances since it is an internal memory dedicated to the Cortex-M4.</p><p>External memories, such as the DDR, offer more space but are also much slower to access. </p><p>In this article, it is assumed that every application runs<span> from the TCM</span>.</p><h1><span style="color: rgb(0,51,102);">Availability</span></h1><hr /><p><a href="http://www.embedian.com/index.php?main_page=product_info&cPath=1&products_id=26">SMARC-iMX8M</a> from Embedian</p><h1><span style="color: rgb(0,51,102);">Carrier Board</span></h1><hr /><p><a href="http://www.embedian.com/index.php?main_page=product_info&cPath=8&products_id=25">EVK-STD-CARRIER-S20</a> (universal carrier board for all SMARC 2.0 modules) from Embedian</p><h1><span style="color: rgb(0,51,102);">Basic Resources</span></h1><hr /><p><span style="color: rgb(0,51,102);"> </span></p><ul><li>AArch64 Cross Compiler<ul><li>Linaro: <span class="nolink"><a href="https://launchpad.net/linaro-toolchain-binaries">https://launchpad.net/linaro-toolchain-binaries</a></span></li></ul></li><li>Bootloader<ul><li>Das U-Boot – the Universal Boot Loader <span class="nolink"><a href="http://www.denx.de/wiki/U-Boot">http://www.denx.de/wiki/U-Boot</a></span></li><li>Source – <span class="nolink"><a href="http://git.denx.de/?p=u-boot.git;a=summary">http://git.denx.de/?p=u-boot.git;a=summary</a></span></li></ul></li><li>Linux Kernel<ul><li>Linus's Mainline tree: <span class="nolink"><a href="http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=summary">http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=summary</a></span></li><li>Freescale Linux source tree: <a href="git://git.freescale.com/imx/linux-imx.git">git://git.freescale.com/imx/linux-imx.git</a></li><li>Freescale BSP meta layer: <a href="git://git.freescale.com/imx/meta-fsl-bsp-release">git://git.freescale.com/imx/meta-fsl-bsp-release</a></li><li>OpenEmbedded/Yocto BSP layer for Freescale's ARM platform <a href="git://git.yoctoproject.org/meta-fsl-arm">git://git.yoctoproject.org/meta-fsl-arm</a></li><li>Embedian SMARC-iMX8M kernel source tree for linux smarc-8m_imx_4.19.35_1.0.0:<a> git@git.embedian</a>.<a href="http://comdeveloper/">com:developer/smarc-fsl-linux-kernel.git</a></li></ul></li><li>ARM based rootfs<ul><li>Debian Squeeze: <a class="external-link" href="http://www.debian.org/" rel="nofollow">http://www.debian.org/</a></li></ul></li></ul><h1><span style="color: rgb(0,51,102);">ARM Cross Compiler: GCC</span></h1><hr /><p><span style="color: rgb(0,0,0);">To build Embedian’s </span><em>SMARC-iMX8M</em><span style="color: rgb(0,0,0);"> FreeRTOS, you will need to install the following ARM GNU gcc compiler first: </span></p><p>For <span style="color: rgb(0,51,102);"><strong>MCUXpresso 2.8.0 FreeRTOS</strong></span>, you need to use the following ARM GNU GCC coss compilier.<span style="color: rgb(0,0,0);"> </span></p><table class="wysiwyg-macro" data-macro-name="info" data-macro-parameters="icon=false" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm86aWNvbj1mYWxzZX0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p><code><span style="color: rgb(0,51,102);">$ wget -c <span class="nolink">https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2</span><span class="nolink"> </span></span></code></p><p><code><span style="color: rgb(0,51,102);">$ </span><span style="color: rgb(0,51,102);">sudo tar -C /opt -xvf gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2</span></code></p><p><code><span style="color: rgb(0,51,102);">$ export ARMGCC_DIR=/opt/gcc-arm-none-eabi-9-2019-q4-major</span></code></p></td></tr></table><p>Test:</p><p><strong>If this test fails, verify that you have the 32bit libraries installed on your development system.</strong></p><table class="wysiwyg-macro" data-macro-name="info" data-macro-parameters="icon=false" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm86aWNvbj1mYWxzZX0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p><code><span style="color: rgb(0,51,102);">$ ${ARMGCC_DIR}/bin/arm-none-eabi-gcc --version</span></code></p><p>arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 9-2019-q4-major) 9.2.1 20191025 (release) [ARM/arm-9-branch revision 277599]<br />Copyright (C) 2019 Free Software Foundation, Inc.<br />This is free software; see the source for copying conditions. There is NO<br />warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</p></td></tr></table><p><span style="color: rgb(0,51,102);">To download the source codes, you need to register at Embedian's git server first and put your ssh public key there.</span></p><h1><span style="color: rgb(0,51,102);">Generating SSH Keys</span></h1><hr /><p>We recommend you use SSH keys to establish a secure connection between your computer and <a href="http://git.embedian.com">Embedian Gitlab server</a>. The steps below will walk you through generating an SSH key and then adding the public key to our Gitlab account.</p><h3><span style="color: rgb(0,51,102);">Step 1. Check for SSH keys</span></h3><hr /><p>First, we need to check for existing ssh keys on your computer. Open up <span class="platform-windows">Git Bash</span> and run:</p><table class="wysiwyg-macro" data-macro-name="code" data-macro-parameters="language=cpp|theme=Confluence" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6dGhlbWU9Q29uZmx1ZW5jZXxsYW5ndWFnZT1jcHB9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>$ cd ~/.ssh $ ls # Lists the files in your .ssh directory</pre></td></tr></table><p>Check the directory listing to see if you have a file named either <code>id_rsa.pub</code> or <code>id_dsa.pub</code>. If you don't have either of those files go to <strong>step 2</strong>. Otherwise, you already have an existing keypair, and you can skip to <strong>step 3</strong>.</p><h3><span style="color: rgb(0,51,102);">Step 2. Generate a new SSH key</span></h3><hr /><p>To generate a new SSH key, enter the code below. We want the default settings so when asked to enter a file in which to save the key, just press enter.</p><table class="wysiwyg-macro" data-macro-name="code" data-macro-parameters="language=cpp|theme=Confluence" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6dGhlbWU9Q29uZmx1ZW5jZXxsYW5ndWFnZT1jcHB9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>$ ssh-keygen -t rsa -C "your_email@example.com" # Creates a new ssh key, using the provided email as a label # Generating public/private rsa key pair. # Enter file in which to save the key (/c/Users/you/.ssh/id_rsa): [Press enter] $ ssh-add id_rsa</pre></td></tr></table><p>Now you need to enter a passphrase.</p><table class="wysiwyg-macro" data-macro-name="code" data-macro-parameters="language=cpp|theme=Confluence" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6dGhlbWU9Q29uZmx1ZW5jZXxsYW5ndWFnZT1jcHB9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>Enter passphrase (empty for no passphrase): [Type a passphrase] Enter same passphrase again: [Type passphrase again]</pre></td></tr></table><p>Which should give you something like this:</p><table class="wysiwyg-macro" data-macro-name="code" data-macro-parameters="language=cpp|theme=Confluence" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6dGhlbWU9Q29uZmx1ZW5jZXxsYW5ndWFnZT1jcHB9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>Your identification has been saved in /c/Users/you/.ssh/id_rsa. Your public key has been saved in /c/Users/you/.ssh/id_rsa.pub. The key fingerprint is: 01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db your_email@example.com</pre></td></tr></table><h3><span style="color: rgb(0,51,102);">Step 3. Add your SSH key to Embedian Gitlab Server</span></h3><hr /><p>Copy the key to your clipboard.</p><table class="wysiwyg-macro" data-macro-name="code" data-macro-parameters="language=cpp|theme=Confluence" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6dGhlbWU9Q29uZmx1ZW5jZXxsYW5ndWFnZT1jcHB9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>$ cat ~/.ssh/id_rsa.pub ssh-rsa AAAAB3NzaC1yc2EAAABDAQABAAABAQDQUEnh8uGpfxaZVU6+uE4bsDrs/tEE5/BPW7jMAxak 6qgOh6nUrQGBWS+VxMM2un3KzwvLRJSj8G4TnTK2CSmlBvR+X8ZeXNTyAdaDxULs/StVhH+QRtFEGy4o iMIzvIlTyORY89jzhIsgZzwr01nqoSeWWASd+59JWtFjVy0nwVNVtbek7NfuIGGAPaijO5Wnshr2uChB Pk8ScGjQ3z4VqNXP6CWhCXTqIk7EQl7yX2GKd6FgEFrzae+5Jf63Xm8g6abbE3ytCrMT/jYy5OOj2XSg 6jlxSFnKcONAcfMTWkTXeG/OgeGeG5kZdtqryRtOlGmOeuQe1dd3I+Zz3JyT your_email@example.c om</pre></td></tr></table><p>Go to <a href="http://git.embedian.com/">Embedian Git Server</a>. At <span style="color: rgb(0,51,102);">Profile Setting --> SSH Keys --> Add SSH Key </span></p><p>Paste your public key and press "<span style="color: rgb(0,51,102);">Add Key</span>" and your are done.</p><h1><span style="color: rgb(0,51,102);">Download Source Codes</span></h1><hr /><p><span style="color: rgb(0,0,0);">For downloading the latest source code of FreeRTOS for SMARC-iMX8M, we have to use MCUExpresso SDK generator online tool. Below is the link: </span></p><p><span style="color: rgb(0,0,0);"><span style="color: rgb(0,0,0);"><span class="nolink"><span class="nolink">https://mcuxpresso.nxp.com/en/select</span></span></span></span></p><p><span style="color: rgb(0,0,0);"><span style="color: rgb(0,0,0);"><span class="nolink">Embedian has customized it for SMARC-iMX8M.</span></span></span></p><table class="wysiwyg-macro" data-macro-name="info" data-macro-parameters="icon=false" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm86aWNvbj1mYWxzZX0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p><code><span style="color: rgb(0,51,102);">$ git clone git@git.embedian.com:developer/freertos-embedian.git freertos -b mcuxpresso_sdk_2.8.0-8mq</span></code></p></td></tr></table><p>The file structures are as below.</p><table class="wysiwyg-macro" data-macro-name="info" data-macro-parameters="icon=false" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm86aWNvbj1mYWxzZX0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p><span style="color: rgb(0,51,102);"><code>$ tree freertos -L 1</code></span><br /><span style="color: rgb(0,51,102);"><code>freertos</code></span><br /><span style="color: rgb(0,51,102);"><code>├── boards</code></span><br /><span style="color: rgb(0,51,102);"><code>├── CMSIS</code></span><br /><span style="color: rgb(0,51,102);"><code>├── components</code></span><br /><span style="color: rgb(0,51,102);"><code>├── COPYING-BSD-3</code></span><br /><span style="color: rgb(0,51,102);"><code>├── devices</code></span><br /><span style="color: rgb(0,51,102);"><code>├── docs</code></span><br /><span style="color: rgb(0,51,102);"><code>├── EVK-MIMX8MQ_manifest_v3_6.xml</code></span><br /><span style="color: rgb(0,51,102);"><code>├── middleware</code></span><br /><span style="color: rgb(0,51,102);"><code>├── MIR</code></span><br /><span style="color: rgb(0,51,102);"><code>├── rtos</code></span><br /><span style="color: rgb(0,51,102);"><code>├── SMARC-iMX8MQ_manifest_v3_6.xml</code></span><br /><span style="color: rgb(0,51,102);"><code>├── SW-Content-Register.txt</code></span><br /><span style="color: rgb(0,51,102);"><code>└── tools</code></span></p><p><span style="color: rgb(0,51,102);"><code>9 directories, 4 files</code></span><br /><span style="color: rgb(0,51,102);"><code>$</code></span></p></td></tr></table><p> </p><hr /><h1><span style="color: rgb(0,51,102);">Install Required Packages</span> </h1><hr /><p>Install cmake.<span style="color: rgb(0,51,102);"> </span></p><table class="wysiwyg-macro" data-macro-name="info" data-macro-parameters="icon=false" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm86aWNvbj1mYWxzZX0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p><code><span style="color: rgb(0,51,102);">$ sudo apt-get install cmake</span></code></p></td></tr></table><h1><span style="color: rgb(0,51,102);">Build ROMSG Sample Application</span></h1><hr /><p><span style="color: rgb(0,0,0);">Change the directory to the application project directory, which has a path similar to the following</span>:</p><table class="wysiwyg-macro" data-macro-name="info" data-macro-parameters="icon=false" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm86aWNvbj1mYWxzZX0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p><span style="color: rgb(0,51,102);"><code>$ cd <span style="color: rgb(0,51,102);"><install_dir>/freertos/boards/smarcimx8mq/multicore_examples/rpmsg_lite_str_echo_rtos/armgcc</span></code></span></p><p><span style="color: rgb(0,51,102);"><code>$ <span style="color: rgb(0,51,102);">./build_all.sh</span></code></span></p></td></tr></table><p><span style="color: rgb(0,0,0);">This will compile and create binaries. The binaries will be available as <install_dir>freertos/boards/smarcimx8mq/multicore_examples/rpmsg_lite_str_echo_rtos/armgcc/release/rpmsg_lite_str_echo_rtos_imxcm4.bin</span></p><p>Same steps will be applied for other sample applications.</p><h1><span style="color: rgb(0,51,102);">Test Application at U-Boot</span></h1><hr /><p><span style="color: rgb(0,0,0);">Once you finished compilation of rtos application, you can test it at U-Boot first. </span><span style="color: rgb(0,0,0);">Prepare a working SD card.</span></p><table class="wysiwyg-macro" data-macro-name="info" data-macro-parameters="icon=false" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm86aWNvbj1mYWxzZX0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p><span style="color: rgb(0,51,102);"><code>$ <span style="color: rgb(0,51,102);">export DISK=/dev/sdb</span></code></span></p><p><span style="color: rgb(0,51,102);"><code>$ cd </code></span><code><span style="color: rgb(0,51,102);"><install_dir>/freertos/boards/smarcimx8mq/multicore_examples/rpmsg_lite_str_echo_rtos/armgcc/release/</span></code></p><p><code><span style="color: rgb(0,51,102);">$ sudo mount <code class="java plain">${DISK}</code><code class="java value">1</code><span> </span><code class="java plain">/media/boot/</code></span></code></p><p><code><span style="color: rgb(0,51,102);">$ sudo cp -v rpmsg_lite_str_echo_rtos_imxcm4.bin /media/boot</span></code></p><p><code><span style="color: rgb(0,51,102);">$ sudo umount /media/boot</span></code></p></td></tr></table><p><span style="color: rgb(0,0,0);">Bootup the device and stop at U-Boot Command Prompt.</span></p><table class="wysiwyg-macro" data-macro-name="info" data-macro-parameters="icon=false" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm86aWNvbj1mYWxzZX0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p><span style="color: rgb(0,51,102);">u-boot$ load mmc 1:1 0x48000000 rpmsg_lite_str_echo_rtos_imxcm4.bin</span></p><p><span style="color: rgb(0,51,102);"><code>16828 bytes read in 16 ms (1 MiB/s)</code></span><br /><span style="color: rgb(0,51,102);"><code>u-boot$ run cpm4mem</code></span><br /><span style="color: rgb(0,51,102);"><code>u-boot$ run m4boot</code></span><br /><span style="color: rgb(0,51,102);"><code>Booting M4 from TCM</code></span><br /><span style="color: rgb(0,51,102);"><code>## Starting auxiliary core at 0x007E0000 ...</code></span><br /><span style="color: rgb(0,51,102);"><code>u-boot$</code></span></p></td></tr></table><p><span style="color: rgb(0,0,0);">You will see messages from Cortex-M4 debug port at SER2.</span></p><p><span style="color: rgb(153,153,153);">"RPMSG String Echo FreeRTOS RTOS API Demo..."</span></p><table class="wysiwyg-macro" data-macro-name="note" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e25vdGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p>If your u-boot version is v2020.04, the log message will be somewhat different</p><p><span style="color: rgb(0,51,102);">u-boot$ load mmc 1:1 0x48000000 rpmsg_lite_str_echo_rtos_imxcm4.bin</span></p><p><span style="color: rgb(0,51,102);"><code>16828 bytes read in 16 ms (1 MiB/s)</code></span><br /><span style="color: rgb(0,51,102);"><code>u-boot$ run cpm4mem</code></span><br /><span style="color: rgb(0,51,102);"><code>u-boot$ run m4boot</code></span><br /><span style="color: rgb(0,51,102);"><code>Booting M4 from TCM</code></span><br /><span style="color: rgb(0,0,255);"><code>## Starting auxiliary core stack = 0x20020000, pc = 0x1FFE0355...</code></span><br /><span style="color: rgb(0,51,102);"><code>u-boot$</code></span></p></td></tr></table><h1><span style="color: rgb(0,51,102);">Setup SD Card</span></h1><hr /><p><span style="color: rgb(0,0,0);">Assuming that you have a working Yocto/Debian/Ubuntu SD card.</span></p><h3><span style="color: rgb(0,51,102);"><strong>Replace kernel device tree file:</strong></span></h3><p><span style="color: rgb(0,0,0);">The FreeRTOS examples uses SER2, I2C3 (I2C_GP, S48 and S49), GPIO0 (P108) and PWM3 (GPIO5). It is therefore, we need to disable those pin for Cortex-A53 and reserve a dedicate memory area for Cortex-M4. </span><br /><span style="color: rgb(0,0,0);">All available DTB files for Cortex-M4 are listed in the table below.</span></p><p><span style="color: rgb(0,0,0);"> </span></p><table class="confluenceTable"><tbody><tr><th class="confluenceTh">DTB File Name (for Cortex-M4)</th><th class="confluenceTh">Description</th></tr><tr><td class="confluenceTd"><code><span style="color: rgb(0,51,102);"><em>fsl-smarcimx8mq-m4.dtb</em></span></code></td><td class="confluenceTd"><span style="color: rgb(0,0,0);">Device tree blob for no display configuration.</span></td></tr><tr><td class="confluenceTd"><code><em><span style="color: rgb(0,51,102);">fsl-smarcimx8mq-m4hdmi.dtb</span></em></code></td><td class="confluenceTd"><span style="color: rgb(0,0,0);">Device tree blob for HDMI display configuration (DCSS).</span></td></tr><tr><td class="confluenceTd"><code><span style="color: rgb(0,51,102);"><em>fsl-smarcimx8mq-m4-dp.dtb</em></span></code></td><td class="confluenceTd"><span style="color: rgb(0,0,0);">Device tree blob for Display Port (DP) display configuration (DCSS).</span></td></tr><tr><td class="confluenceTd"><code><span style="color: rgb(0,51,102);"><em>fsl-smarcimx8mq-m4lcdif-lvds.dtb</em></span></code></td><td class="confluenceTd"><span style="color: rgb(0,0,0);">Device tree blob for LCDIF LVDS display configuration.</span></td></tr><tr><td class="confluenceTd"><code><em><span style="color: rgb(0,51,102);">fsl-smarcimx8mq-m4-dcss-lvds.dtb</span></em></code></td><td class="confluenceTd"><span style="color: rgb(0,0,0);">Device tree blob for DCSS LVDS display configuration.</span></td></tr><tr><td class="confluenceTd"><code><em><span style="color: rgb(0,51,102);">fsl-smarcimx8mq-m4-dual-display.dtb</span></em></code></td><td class="confluenceTd"><span style="color: rgb(0,0,0);">Device tree blob for dual LVDS+HDMI display configuration. </span></td></tr></tbody></table><p>Replacing Kernel device tree file to adopt Cortex-M4</p><table class="wysiwyg-macro" data-macro-name="info" data-macro-parameters="icon=false" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm86aWNvbj1mYWxzZX0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p><span style="color: rgb(0,51,102);">$ </span><span style="font-family: monospace;color: rgb(0,51,102);">export DISK=/dev/sdb</span></p><p><span style="font-family: monospace;color: rgb(0,51,102);"> </span><code><span style="color: rgb(0,51,102);">$ sudo mount <code class="java plain">${DISK}</code><code class="java value">1</code> <code class="java plain">/media/boot/</code></span></code></p><p><code><span style="color: rgb(0,51,102);"> </span></code><span style="color: rgb(0,51,102);"><code>$ sudo cp -v arch/arm64/boot/dts/embedian/<device tree name> /media/boot/dtbs/<span style="color: rgb(128,0,0);">fsl-smarcimx8mq.dtb</span></code></span></p><p><span style="color: rgb(0,51,102);"><code><span style="color: rgb(128,0,0);"> </span></code></span><code><span style="color: rgb(0,51,102);">$ sudo umount /media/boot</span></code></p></td></tr></table><table class="wysiwyg-macro" data-macro-name="note" data-macro-parameters="icon=false" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e25vdGU6aWNvbj1mYWxzZX0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><code>The device tree name in your SD card has be to fsl-smarcimx8mq.dtb</code></td></tr></table><h3><span style="color: rgb(0,51,102);">Pass Kernel Parameters to Kernel (uEnv.txt)</span></h3><hr /><p>At uEnv.txt file, you need to add the following parameters.</p><table class="wysiwyg-macro" data-macro-name="info" data-macro-parameters="icon=false" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm86aWNvbj1mYWxzZX0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><pre><span style="color: rgb(0,51,102);">$ sudo mount <code class="java plain">${DISK}</code><code class="java value">1</code> <code class="java plain">/media/boot/</code></span></pre><pre><span style="color: rgb(0,51,102);">$ sudo vim /media/boot/uEnv.txt</span></pre><pre><span style="color: rgb(0,51,102);">$ sudo umount /media/boot</span></pre></td></tr></table><p>Add the following parameter below the line "image=Image"</p><table class="wysiwyg-macro" data-macro-name="info" data-macro-parameters="icon=false" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm86aWNvbj1mYWxzZX0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p>m4_bin=m4_binary_name.bin<br />m4_addr=0x7e0000<br />m4_addr_tmp=0x48000000</p></td></tr></table><p>Add the following parameters in the "uenvcmd" and before "run mmcboot".</p><table class="wysiwyg-macro" data-macro-name="info" data-macro-parameters="icon=false" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm86aWNvbj1mYWxzZX0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><div>uenvcmd=run loadimage; run loadfdt; <span style="color: rgb(153,51,0);">run loadm4bin; run cpm4mem; run m4boot;</span> run mmcboot</div></td></tr></table><p>Boot up the device and you will see "<span style="color: rgb(0,0,0);">M4 is started" at dmesg.</span></p><h1><span style="color: rgb(0,51,102);">Demo Programs</span></h1><hr /><p><span style="color: rgb(0,0,0);">In this section, we will show how to use the demo programs.</span></p><h4><u><span style="color: rgb(0,51,102);">RPMsg TTY demo</span></u></h4><p><span style="color: rgb(0,0,0);"><span>This demo application demonstrates the </span><span>RPMsg</span><span> remote peer stack. It works with </span><span>Linux</span><span> RPMsg master peer to transfer string content back and forth. The Linux driver creates a tty node to which you can write to. The MCU displays what is received, and echoes back the same message as an acknowledgement. The tty reader on ARM Cortex-A53 core can get the message, and start another transaction. The demo demonstrates RPMsg’s ability to send arbitrary content back and forth.</span></span></p><p><span style="color: rgb(0,0,0);">Copy <span style="color: rgb(0,51,102);"><em>rpmsg_lite_str_echo_rtos_imxcm4.bin</em></span> to the first partition of your SD card and add <em><span style="color: rgb(0,51,102);">m4_bin=rpmsg_lite_str_echo_rtos_imxcm4.bin</span></em> at uEnv.txt file. Boot up the device. You will see SER2 print out the following Cortex-M4 messages.</span></p><p><span style="color: rgb(128,128,128);">RPMSG String Echo FreeRTOS RTOS API Demo...</span></p><p><span style="color: rgb(128,128,128);">Nameservice sent, ready for incoming messages...</span></p><p><span style="color: rgb(128,128,128);"><span style="color: rgb(51,51,51);">At device side,</span></span></p><table class="wysiwyg-macro" data-macro-name="info" data-macro-parameters="icon=false" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm86aWNvbj1mYWxzZX0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p><span style="color: rgb(0,51,102);"><code>$ modprobe imx_rpmsg_tty</code></span></p><p><span style="color: rgb(0,51,102);"><code>$ echo "this is a test" > /dev/ttyRPMSG30</code></span></p></td></tr></table><p><span style="color: rgb(0,0,0);">You will see SER2 print out the following messages.</span></p><p><span style="color: rgb(128,128,128);">Get Message From Master Side : "hello world!" [len : 12]</span><br /><span style="color: rgb(128,128,128);">Get Message From Master Side : "this is a test" [len : 14]</span><br /><span style="color: rgb(128,128,128);">Get New Line From Master Side</span></p><h4><u><span style="color: rgb(0,51,102);">RPMsg Ping Pong demo</span></u></h4><p><span style="color: rgb(0,0,0);">Same as previous demo, this one demonstrates the </span><span style="color: rgb(0,0,0);">RPMsg</span><span style="color: rgb(0,0,0);"> communication. After the communication channels are created, Linux OS transfers the first integer to FreeRTOS OS. The receiving peer adds 1 to the integer and transfers it back, a hundred times and then stops.</span></p><p><span style="color: rgb(0,0,0);"><span style="color: rgb(0,0,0);">Copy <em><span style="color: rgb(0,51,102);">rpmsg_lite_pingpong_rtos_linux_remote.bin</span></em></span><span style="color: rgb(0,0,0);"> to the first partition of your SD card and add </span><em><span style="color: rgb(0,51,102);">m4_bin=rpmsg_lite_pingpong_rtos_linux_remote.bin</span></em><span style="color: rgb(0,0,0);"> at uEnv.txt file. Boot up the device. You will see SER2 print out the following Cortex-M4 messages.</span></span></p><p><span style="color: rgb(128,128,128);">RPMSG Ping-Pong FreeRTOS RTOS API Demo...</span><br /><span style="color: rgb(128,128,128);">RPMSG Share Base Addr is 0xb8000000</span><br /><span style="color: rgb(128,128,128);">Link is up!</span><br /><span style="color: rgb(128,128,128);">Nameservice announce sent.</span></p><p><span style="color: rgb(128,128,128);"><span style="color: rgb(51,51,51);">At device side,</span></span></p><table class="wysiwyg-macro" data-macro-name="info" data-macro-parameters="icon=false" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm86aWNvbj1mYWxzZX0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p><span style="color: rgb(0,51,102);"><code>$ modprobe imx_rpmsg_pingpong</code></span></p></td></tr></table><p><span style="color: rgb(0,0,0);">You will see SER2 print out the following messages.</span></p><p><span style="color: rgb(128,128,128);">Waiting for ping...</span><br /><span style="color: rgb(128,128,128);">Sending pong...</span><br /><span style="color: rgb(128,128,128);">Waiting for ping...</span><br /><span style="color: rgb(128,128,128);">Sending pong...</span><br /><span style="color: rgb(128,128,128);">Waiting for ping...</span><br /><span style="color: rgb(128,128,128);">Sending pong...</span><br /><span style="color: rgb(128,128,128);">Waiting for ping...</span><br /><span style="color: rgb(128,128,128);">Sending pong...</span><br /><span style="color: rgb(128,128,128);">Waiting for ping...</span><br /><span style="color: rgb(128,128,128);">Sending pong...</span><br /><span style="color: rgb(128,128,128);">Waiting for ping...</span><br /><span style="color: rgb(128,128,128);">Sending pong...</span><br /><span style="color: rgb(128,128,128);">Waiting for ping...</span><br /><span style="color: rgb(128,128,128);">Sending pong...</span><br /><span style="color: rgb(128,128,128);">Waiting for ping...</span><br /><span style="color: rgb(128,128,128);">Sending pong...</span><br /><span style="color: rgb(128,128,128);">Waiting for ping...</span><span style="color: rgb(0,51,102);"> </span></p><h4><u><span style="color: rgb(0,51,102);">Hello World demo</span></u></h4><p><span style="color: rgb(51,51,51);">The Hello World project is a simple demonstration program that uses the BSP software. It prints the “Hello World” message to the ARM Cortex-M4 debug terminal SER2.</span></p><p><span style="color: rgb(0,0,0);">Copy <em><span style="color: rgb(0,51,102);">hello_world</span><span style="color: rgb(0,51,102);"><em>.</em>bin</span></em></span><span style="color: rgb(0,0,0);"> to the first partition of your SD card and add </span><em><span style="color: rgb(0,51,102);">m4_bin=hello_world.bin</span></em><span style="color: rgb(0,0,0);"> at uEnv.txt file. Boot up the device. You will see SER2 print out the following Cortex-M4 messages.</span></p><p><span style="color: rgb(0,51,102);"><span style="color: rgb(128,128,128);">hello world.</span> </span></p><h4><u><span style="color: rgb(0,51,102);">GPIO demo</span></u></h4><p><span style="color: rgb(0,51,102);"><span style="color: rgb(0,0,0);">The GPIO demo code uses GPIO0 as an example to toggle this pin.</span></span></p><p><span style="color: rgb(0,51,102);"><span style="color: rgb(0,0,0);"><span style="color: rgb(0,0,0);">Copy <span style="color: rgb(0,51,102);"><em>igpio_led_output.bin</em></span></span><span style="color: rgb(0,0,0);"> to the first partition of your SD card and add </span><em><span style="color: rgb(0,51,102);">m4_bin=igpio_led_output.bin</span></em><span style="color: rgb(0,0,0);"> at uEnv.txt file. Boot up the device. You will see SER2 print out the following Cortex-M4 messages.</span></span></span></p><p><span style="color: rgb(128,128,128);">GPIO Driver example</span></p><p><span style="color: rgb(128,128,128);">The LED is blinking.</span></p><p><span>Use scope to measure GPIO0, you will see a square wave that means this pin is toggled.</span></p><h4><u><span style="color: rgb(0,51,102);">PWM demo</span></u></h4><p><span style="color: rgb(0,51,102);"><span style="color: rgb(0,0,0);">The PWM demo code uses GPIO5 (PWM3) as an example.</span></span></p><p><span style="color: rgb(0,51,102);"><span style="color: rgb(0,0,0);"><span>Copy <span style="color: rgb(0,51,102);"><em>ipwm.bin</em></span></span><span> to the first partition of your SD card and add </span><em><span style="color: rgb(0,51,102);">m4_bin=ipwm.bin</span></em><span> at uEnv.txt file. Boot up the device. You will see SER2 print out the following Cortex-M4 messages.</span></span></span></p><p><span style="color: rgb(128,128,128);">PWM driver example.</span></p><p>Use scope to measure GPIO5, you will see PWM signals</p><h1><span style="color: rgb(0,51,102);">Setup eMMC</span></h1><hr /><p>For <em>SMARC-iMX8M</em>, the SD card is always emulated as /dev/mmcblk1 and on-module eMMC is always emulated as /dev/mmcblk0. Setting up eMMC now is nothing but changing the device descriptor. </p><p>Follow exactly the same steps as that set up SD card. This time, the first partition of eMMC will be /dev/mmcblk0p1.</p><div><div class="paragraph"><div class="paragraph"><div class="paragraph"><hr />version 1.0a, 8/25/2020 Last updated 2020-8-25</div></div></div></div>
If you are unable to use this CAPTCHA please
contact your administrator
for assistance.
Attachments
Labels
Location
Edit
Preview
Save
Cancel
Next hint