Go to file
matttcattt 30b43d6977
Fix MinGW Build (#114)
Signed-off-by: Matthew Cattle <matttcattt@gmail.com>
2020-05-16 20:45:34 -07:00
msvc Fixed build for Visual Studio 2015 Express. 2019-05-08 08:56:41 +02:00
tests mx8m_usb_sdp_spl: create generic sdp spl config for all imx8m 2020-03-17 20:20:10 +01:00
.gitignore introduce tests 2018-04-02 13:21:26 -07:00
COPYING COPYING: the license is LGPLv2.1, not GPLv3 2014-09-25 23:47:52 +02:00
Makefile add SPDS protocol support, imx8mn(nano) 2019-12-16 12:36:46 -08:00
Makefile.mingw Fix MinGW Build (#114) 2020-05-16 20:45:34 -07:00
README.md README: Include i.MX7 in the supported list of SoCs 2017-10-09 10:22:38 +02:00
image.h resync image.h with U-Boot v2017.09 2017-09-13 23:49:29 +02:00
imx_loader.h bump version to 0.2pre 2018-04-02 13:02:08 -07:00
imx_loader_config.c Fix MinGW Build (#114) 2020-05-16 20:45:34 -07:00
imx_loader_config.h move config file parsing in separate file 2018-04-24 17:44:56 +02:00
imx_sdp.c imx_sdp: don't try to load hdmi firmware 2020-01-03 16:36:29 -08:00
imx_sdp.h add SPDS protocol support, imx8mn(nano) 2019-12-16 12:36:46 -08:00
imx_sdp_simulation.c add SPDS protocol support, imx8mn(nano) 2019-12-16 12:36:46 -08:00
imx_sdp_simulation.h move SDP client-side emulation to separate compile unit 2018-04-25 13:43:57 +02:00
imx_uart.c add SPDS protocol support, imx8mn(nano) 2019-12-16 12:36:46 -08:00
imx_usb.c add SPDS protocol support, imx8mn(nano) 2019-12-16 12:36:46 -08:00
imx_usb.conf mx8m_usb_sdp_spl: create generic sdp spl config for all imx8m 2020-03-17 20:20:10 +01:00
mx6_usb_sdp_spl.conf add U-Boot header example 2017-09-13 10:39:17 +02:00
mx6_usb_work.conf imx_loader_config: rename jump_script to jump_direct 2018-04-24 18:18:04 -07:00
mx6ull_usb_work.conf mx6ull_usb_work.conf: fix copy/paste error in comment 2018-08-09 11:08:50 -07:00
mx7_usb_work.conf Add DCD loading address parameter in conf file 2016-09-26 10:44:25 +02:00
mx7ulp_usb_work.conf mx7ulp_usb_work.conf: Add support for i.MX7ULP device 2017-09-13 10:27:54 +02:00
mx8m_usb_sdp_spl.conf mx8m_usb_sdp_spl: create generic sdp spl config for all imx8m 2020-03-17 20:20:10 +01:00
mx8mm_usb_work.conf mx8mm_usb_sdp_spl.conf/ mx8mm_usb_work.conf: s/imx-mkimage/u-boot-imx6/ 2019-10-07 15:21:11 -07:00
mx8mn_usb_work.conf add SPDS protocol support, imx8mn(nano) 2019-12-16 12:36:46 -08:00
mx8mq_usb_work.conf mx8mq_usb_work.conf: load flash.bin from u-boot-imx6 directory 2019-09-20 17:22:52 -07:00
mx50_usb_work.conf Add DCD loading address parameter in conf file 2016-09-26 10:44:25 +02:00
mx51_usb_work.conf Add DCD loading address parameter in conf file 2016-09-26 10:44:25 +02:00
mx53_usb_work.conf mx53_usb_work.conf: change crlf to lf 2016-09-28 11:36:55 -07:00
portable.h portable: use __builtin_bswap16 for BE16 if >= 4.8 GNUC 2018-08-09 18:23:58 -07:00
sdp.c add SPDS protocol support, imx8mn(nano) 2019-12-16 12:36:46 -08:00
sdp.h add SPDS protocol support, imx8mn(nano) 2019-12-16 12:36:46 -08:00
sdps.c add SPDS protocol support, imx8mn(nano) 2019-12-16 12:36:46 -08:00
sdps.h add SPDS protocol support, imx8mn(nano) 2019-12-16 12:36:46 -08:00
vybrid_usb_work.conf Add DCD loading address parameter in conf file 2016-09-26 10:44:25 +02:00

README.md

imx_loader

i.MX/Vybrid recovery utility

Description

This utility allows to download and execute code on Freescale i.MX5/i.MX6/i.MX7 and Vybrid SoCs through the Serial Download Protocol (SDP). Depending on the board, there is usually some kind of recovery button to bring the SoC into serial download boot mode, check documentation of your hardware.

The utility support USB and UART as serial link.

Installation

  1. Clone
  2. Make sure libusb (1.0) is available
  3. Compile using make

Two binaries are available, imx_usb and imx_uart for the two supported connections.

Windows

Two variants have been tested successfully to build imx_usb and imx_uart on Windows:

  1. MinGW (using the Microsoft C runtime)
  2. Visual Studio 2015

MinGW

MinGW allows to use the GNU toolchain (including GCC) to compile a native Microsoft Windows application. A MinGW specific make file (Makefile.mingw) is available which allows to build imx_usb/imx_uart with the native make port (mingw32-make.exe). After installing MinGW, make sure you have a compiled copy of libusb available and build imx_loader using:

mingw32-make -f Makefile.mingw LIBUSBPATH=C:\path\to\libusb

This dynamically links against libusb, hence make sure to ship the library libusb-1.0.dll along with imx_usb.exe.

Visual Studio

The subdirectory msvc/ contains the project files for Visual Studio 2015. Make sure you have the Visual C++ component installed. There is one solution containing two projects, one for imx_usb and one for imx_uart. The imx_usb project requires libusb to be present at ../../libusb (relative to the msvc) directory. If you use an alternative location or compile libusb from source too, you will have to alter the include/library path in the project settings.

macOS

libusb and pkg-config can be installed via Homebrew.

If imx_usb fails to claim interface, com.apple.driver.usb.IOUSBHostHIDDevice needs to be unloaded so libusb can claim, run:

sudo kextunload -b com.apple.driver.usb.IOUSBHostHIDDevice

Usage

Using USB, your device should be detected automatically using the USB VID/PID from imx_usb.conf. Using UART, the user has to specify a configuration file. This file is needed to use the correct protocol variant for the target device (transfer configuration). The configuration file can also contains work item(s).

Work items can also be defined using the command line. By specifying a file in the command line, the utility automatically uses this file as a work item and reads parameter from its header:

./imx_usb u-boot.imx

However, parameters can also specified manually, e.g.

./imx_usb u-boot.imx -l0x3f400400 -s370796 -v

The UART link uses hardware flow control using RTS/CTS, so make sure those are available. The imx_uart utility will configure the target tty with the right baud rate (115200) and flow control settings:

./imx_uart /dev/ttyUSB0 vybrid_usb_work.conf u-boot.imx