<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: iMX8 flashing Cortex M4 image in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/iMX8-flashing-Cortex-M4-image/m-p/2071297#M235675</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Thank you for your interest in NXP Semiconductor products,&lt;/P&gt;
&lt;P&gt;Steps 1 to 2 can be avoided with stopping the boot at U-boot.&lt;/P&gt;
&lt;P&gt;=&amp;gt; fastboot 0&lt;/P&gt;
&lt;P&gt;Connect the USB type C cable to the board (as when you burnt the Linux image) and with run the following command in the host.&lt;/P&gt;
&lt;P&gt;$ uuu -v -b fat_write hello_world.bin mmc 0:1 cortexM7.bin&lt;/P&gt;
&lt;P&gt;I couldn't find step 3 in the guide, but you can skip this. DTB is for Linux so you don't need to change it for booting Cortex-M. Remember&lt;/P&gt;
&lt;P&gt;Step 4 and step 5 are ok. In case that something goes wrong (U-boot, U-boot env and cortexM7.bin are in the same partition) you just need to update imx-boot, in serial download mode, run:&lt;/P&gt;
&lt;P&gt;$ uuu -b -b emmc imx-boot...&lt;/P&gt;
&lt;P&gt;Finally, you can &lt;A href="https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/Custom-Scripts-in-U-Boot/ta-p/1792382" target="_self"&gt;use this alternative&lt;/A&gt; to step 4 and 5, so it runs after the bootloader, the difference is that you don't have access to U-boot console prior to loading the binary.&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
    <pubDate>Mon, 31 Mar 2025 15:55:32 GMT</pubDate>
    <dc:creator>JosephAtNXP</dc:creator>
    <dc:date>2025-03-31T15:55:32Z</dc:date>
    <item>
      <title>iMX8 flashing Cortex M4 image</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8-flashing-Cortex-M4-image/m-p/2070380#M235619</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I am currently using i.MX8 plus evaluation board. Currently this has prebuilt linux image in eMMC and when I connect my serial port - I see the linux prompt and I can check basic linux commands.&lt;/P&gt;&lt;P&gt;As I am not using A53 cores (as of now) - I focused on Cortex M7 core and developed some application to interact with the sensor/ input/ output etc. This I used to test and debug with Jlink. Now I am done with cortex M7 code and wanted to flash it so that cortex M7 boots as power on and I can see the cortex M7 working (A53 is not used at all at this point of time).&lt;/P&gt;&lt;P&gt;While searching for this, I found this article&amp;nbsp;&lt;A href="https://www.embeddedartists.com/wp-content/uploads/2019/03/iMX8M_Working_with_Cortex-M.pdf" target="_blank"&gt;https://www.embeddedartists.com/wp-content/uploads/2019/03/iMX8M_Working_with_Cortex-M.pdf&lt;/A&gt;&amp;nbsp;and seems following section 4 is sufficient to get this.&lt;/P&gt;&lt;P&gt;Gist of the steps are&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Copy the &lt;STRONG&gt;cortexM7.bin&lt;/STRONG&gt; (image that needs to be run from Cortex M7) to USB&lt;/P&gt;&lt;P&gt;2. Put it in iMX8Plus evk board&lt;/P&gt;&lt;P&gt;a. New drive is detected -sda: sda1 (I can see this in my linux prompt when I put USB drive)&lt;/P&gt;&lt;P&gt;b. Follow the mounting of USB and eMMC as below&lt;/P&gt;&lt;P&gt;# mkdir /mnt/usb&lt;/P&gt;&lt;P&gt;# mount /dev/sda1 /mnt/usb&lt;/P&gt;&lt;P&gt;# mkdir /mnt/mmcboot&lt;/P&gt;&lt;P&gt;# mount /dev/mmcblk2p1 /mnt/mmcboot&lt;/P&gt;&lt;P&gt;c. Copy &lt;STRONG&gt;cortexM7.bin&amp;nbsp;&lt;/STRONG&gt;the into eMMC&lt;/P&gt;&lt;P&gt;# cp /mnt/usb/&lt;STRONG&gt;cortexM7.bin&amp;nbsp;&lt;/STRONG&gt; /mnt/mmcboot/&lt;/P&gt;&lt;P&gt;d. unmount - as these mount points are not any more required. ( umount /mnt/usb&amp;nbsp; and&amp;nbsp; umount /mnt/mmcboot)&lt;/P&gt;&lt;P&gt;3. Get into uboot mode and Change the device tree file (currently my&amp;nbsp;fdt_file=imx8mp-evk.dtb in uboot environment) - Comment in the above .pdf [Change which device tree file to use by Linux. The example below sets the file to use for the iMX8M Mini uCOM Developer’s Kit V2. If you are using a different board just use the same name as set by default in the fdt_file variable and append ‘-m4’. ]&lt;/P&gt;&lt;P&gt;setenv fdt_file=imx8mp-evk.dtb in-m4.dtb&lt;/P&gt;&lt;P&gt;saveenv&lt;/P&gt;&lt;P&gt;4.&amp;nbsp;Run from TCM (basically instructing to copy image to TCM memory and start running).&lt;/P&gt;&lt;P&gt;setenv cm_image &lt;STRONG&gt;cortexM7.bin&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;setenv cm_addr 0x7e0000&lt;/P&gt;&lt;P&gt;setenv cm_loadimage 'fatload mmc ${mmcdev} ${loadaddr} ${cm_image}'&lt;/P&gt;&lt;P&gt;setenv cm_boot 'run cm_loadimage; cp.b ${loadaddr} ${cm_addr} ${filesize}; dcache flush; bootaux ${cm_addr}'&lt;/P&gt;&lt;P&gt;saveenv&lt;/P&gt;&lt;P&gt;run cm_boot&lt;/P&gt;&lt;P&gt;5. And to automatically boot every power on,&amp;nbsp;&lt;/P&gt;&lt;P&gt;setenv bootcmd "run cm_boot; ${bootcmd}"&lt;/P&gt;&lt;P&gt;saveenv&lt;/P&gt;&lt;P&gt;Doubt 1 : As I am very new to linux/ iMX8 - do you guys think this is correct way (for me to get only Cortex M7 image running)&lt;/P&gt;&lt;P&gt;Doubt 2 : If something goes wrong, would it be possible to get back to my eMMC linux image? I thought I can put the&lt;/P&gt;&lt;P&gt;"bootcmd=mmc dev"&amp;nbsp; and "fdt_file=imx8mp-evk.dtb" in uboot environment.&lt;/P&gt;&lt;P&gt;With best regards,&lt;/P&gt;&lt;P&gt;//P&lt;/P&gt;</description>
      <pubDate>Fri, 28 Mar 2025 14:55:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8-flashing-Cortex-M4-image/m-p/2070380#M235619</guid>
      <dc:creator>phanids</dc:creator>
      <dc:date>2025-03-28T14:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: iMX8 flashing Cortex M4 image</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8-flashing-Cortex-M4-image/m-p/2071297#M235675</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Thank you for your interest in NXP Semiconductor products,&lt;/P&gt;
&lt;P&gt;Steps 1 to 2 can be avoided with stopping the boot at U-boot.&lt;/P&gt;
&lt;P&gt;=&amp;gt; fastboot 0&lt;/P&gt;
&lt;P&gt;Connect the USB type C cable to the board (as when you burnt the Linux image) and with run the following command in the host.&lt;/P&gt;
&lt;P&gt;$ uuu -v -b fat_write hello_world.bin mmc 0:1 cortexM7.bin&lt;/P&gt;
&lt;P&gt;I couldn't find step 3 in the guide, but you can skip this. DTB is for Linux so you don't need to change it for booting Cortex-M. Remember&lt;/P&gt;
&lt;P&gt;Step 4 and step 5 are ok. In case that something goes wrong (U-boot, U-boot env and cortexM7.bin are in the same partition) you just need to update imx-boot, in serial download mode, run:&lt;/P&gt;
&lt;P&gt;$ uuu -b -b emmc imx-boot...&lt;/P&gt;
&lt;P&gt;Finally, you can &lt;A href="https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/Custom-Scripts-in-U-Boot/ta-p/1792382" target="_self"&gt;use this alternative&lt;/A&gt; to step 4 and 5, so it runs after the bootloader, the difference is that you don't have access to U-boot console prior to loading the binary.&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Mon, 31 Mar 2025 15:55:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8-flashing-Cortex-M4-image/m-p/2071297#M235675</guid>
      <dc:creator>JosephAtNXP</dc:creator>
      <dc:date>2025-03-31T15:55:32Z</dc:date>
    </item>
    <item>
      <title>Re: iMX8 flashing Cortex M4 image</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8-flashing-Cortex-M4-image/m-p/2075295#M235982</link>
      <description>&lt;P&gt;Thanks Josesh. Your suggestion helped me to understand some more details.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I am done with it and getting on to my actual custom board (not sure, if I need to create a new question for this - but anyway I will update here).&lt;/P&gt;&lt;P&gt;Basically my custom board has &lt;STRONG&gt;only NAND Flash&lt;/STRONG&gt;&amp;nbsp;(and no eMMC or any other memory) and I need to boot C4 as same way I did with eMMC. I am thinking of following steps - please let me know if you have any suggestions.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Approach I&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1. Download the linux image for my controller -&amp;nbsp;i.MX8MQ. Flash this to NAND using Seggar and see if I get the linux prompt with required switch settings (just to make sure I can on to linux with Nand flash)&lt;/P&gt;&lt;P&gt;2. Add cortexM4.bin (generated image for Cortex M4) - to this image. &lt;FONT color="#FF0000"&gt;This part I am not sure - is it possible and if yes what way I can make my cortexM4.bin as part of linux image.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;3. Now update the uboot as done with eMMC.&amp;nbsp;&lt;FONT color="#FF0000"&gt;This part again I am not very sure - as this may not be possible to update Flash as in eMMC (unless we use external tools like Seggar).&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Approach II&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;1. Download the yacto setup for&amp;nbsp;&amp;nbsp;i.MX8MQ and create the linux image.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;2. Use "some tool" to make the final image with generated linux image + cortexM4.bin along with boot sequence (which tweaks the uboot part). I read we have this "some tool" but I need to do search more and figure it out&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Basically I am trying to boot cortexM4.bin from NAND only&amp;nbsp;&amp;nbsp;i.MX8MQ custom board&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Thanks a lot,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;//P&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Apr 2025 14:59:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8-flashing-Cortex-M4-image/m-p/2075295#M235982</guid>
      <dc:creator>phanids</dc:creator>
      <dc:date>2025-04-07T14:59:40Z</dc:date>
    </item>
  </channel>
</rss>

