New i.MX6SX & i.MX7D AMP debugging tool: imx-m4fwloader

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

New i.MX6SX & i.MX7D AMP debugging tool: imx-m4fwloader

New i.MX6SX & i.MX7D AMP debugging tool: imx-m4fwloader

Introduction


i.MX6SoloX and i.MX7D SoC contain embedded Cortex-M4 core. In a common use-case, this core runs a firmware loaded by u-boot bootloader. If you however want to debug your application for the Cortex-M4 core, you may need to reload the firmware in the secondary core without restarting Linux running on the Cortex-A core. For this reason, a tool was created: imx-m4fwloader.

The project is released as open source under GPL-2.0 licence here: GitHub - NXPmicro/imx-m4fwloader: Tool for loading firmware to M4 core on i.MX6SX and 7D 

I hope this tool will help to bring up faster your application for i.MX6SoloX and i.MX7D SoC!

How to use this

  • Either use the pre-built version
  • Or use the environment provided to you by Yocto:
    • For example:
    • source /opt/poky/1.8/environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi
    • $CC m4fwloader.c -o m4fwloader
    • You get m4fwloader binary...
  • Then you need to build your M4 application and link it to some address. (e.g 0x00910000, try: https://github.com/EmbeddedRPC/erpc-imx-demos/tree/master/MCU/example_rpmsg)
  • Load it using m4fwloader: ./m4fwloader myapp.bin 0x00910000
  • Optionally use --verbose parameter to see what is written to each registers
  • Warning: Use this tool for debugging only, since it accesses directly the registers from the user space and requires therefore root priviledges!
  • You have been warned... :-)
  • Optionally, you can trigger an interrupt using message unit (MU) to the M4 core to get RPMsg started - this is normally done by Linux Kernel during startup: ./m4fwloader kick 0
  • Whole usage is here:
    • m4fwloader [filename.bin] [0xLOADADDR] [--verbose] # loads new firmware
    • or: m4fwloader stop # holds the auxiliary core in reset
    • or: m4fwloader start # releases the auxiliary core from reset
    • or: m4fwloader kick [n] # triggers interrupt on RPMsg virtqueue n
Comments

I can't get this utility to work on an i.mx7. Could you help me out? I've started a forum post here: https://community.nxp.com/message/936211 

This is maybe an obvious question, but could you confirm that this tool runs on Linux on Cortex A core?

dry

I've forked out from original, and did bug fixes to it.  (It really wouldn't work at all without it. )

Find fork here:   GitHub - dry-75/imx-m4fwloader: Tool for loading firmware to M4 core on i.MX6SX and 7D 

Tested on what I work with now - iMX7D. OCRAM and TCM  memory.

Thank you for the tool. 

dry

Try the fork with fixes.  Works for me on IMX7D,A7,Linux.

dry

Updated by branch as per iMX7 DRM 2018 update and omissions, as per discussion here (and my support request ticket ..)

https://community.nxp.com/thread/482778

No ratings
Version history
Last update:
‎05-19-2017 07:12 AM
Updated by: