How to change Matrix TBS2910 U-Boot

This tutorial exposes all the underlying work needed to flash a new u-boot into a Matrix TBS2910. You can use this knowledge and compile your own u-boot.imx with all these included, just in case.

TBS_Matrix_Board

Requisites:

  • Matrix TBS2910
  • Mini USB cable for the OTG
  • TTL-232R-3V3 for the UART
  • Recent Linux Debian based environment (e.g Ubuntu 14.04)
  • Git/Compilation skills
  • Ethernet Cable
  • TFTP Server (e.g. tftp-hpa)

In this case you won’t need a DHCP server because you can choose to program your own IP addr.

Install iMX USB loader

git clone https://github.com/boundarydevices/imx_usb_loader.git
cd imx_usb_loader
make
sudo make install

Compile U-boot

git clone git://git.denx.de/u-boot-imx.git
cd u-boot-imx
make distclean
make tbs2910_config

Before compiling, you need a cross compiling GCC version. Look for the ones available to you.

apt-cache search arm-linux-gnuabi-gcc

Makefile will be looking for the arm-linux-gnueabi-gcc compiler.

export CROSS_COMPILE=arm-linux-gnueabi-
export ARCH=arm
make

If everything goes well you should have a u-boot.imx file now available. All you need now is to load that file into the Matrix.

  • Turn off the device
  • move switch to Update/Burn mode
  • plug USB and UART cables
  • turn on the device

Now run the following command:

sudo imx_usb --configdir=/usr/etc/imx-loader.d/ ../u-boot-imx/u-boot.imx

Output should look like this:


config file </usr/etc/imx-loader.d/imx_usb.conf>
vid=0x066f pid=0x3780 file_name=mx23_usb_work.conf
vid=0x15a2 pid=0x004f file_name=mx28_usb_work.conf
vid=0x15a2 pid=0x0052 file_name=mx50_usb_work.conf
vid=0x15a2 pid=0x0054 file_name=mx6_usb_work.conf
vid=0x15a2 pid=0x0061 file_name=mx6_usb_work.conf
vid=0x15a2 pid=0x0063 file_name=mx6_usb_work.conf
vid=0x15a2 pid=0x0041 file_name=mx51_usb_work.conf
vid=0x15a2 pid=0x004e file_name=mx53_usb_work.conf
vid=0x15a2 pid=0x006a file_name=vybrid_usb_work.conf
vid=0x066f pid=0x37ff file_name=linux_gadget.conf
config file </usr/etc/imx-loader.d/mx6_usb_work.conf>
parse /usr/etc/imx-loader.d/mx6_usb_work.conf
15a2:0054(mx6_qsb) bConfigurationValue =1
Interface 0 claimed
HAB security state: development mode (0x56787856)
== work item
filename ../u-boot-imx/u-boot.imx
load_size 0 bytes
load_addr 0x00000000
dcd 1
clear_dcd 0
plug 1
jump_mode 2
jump_addr 0x00000000
== end work item
main dcd length 310
sub dcd length 30c
loading binary file(../u-boot-imx/u-boot.imx) to 7ffff400, skip=0, fsize=48c00 type=aa
<<<297984, 297984 bytes>>>
succeeded (status 0x88888888)
jumping to 0x7ffff400

view raw

imx-usb

hosted with ❤ by GitHub

Matrix will start boot and you will be able to see through the Serial connection.


U-Boot 2015.04-rc1-19966-ge72d344 (Feb 16 2015 – 23:27:14)
CPU: Freescale i.MX6Q rev1.2 at 792 MHz
Reset cause: POR
I2C: ready
DRAM: 2 GiB
MMC: FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2
*** Warning – bad CRC, using default environment
No panel detected: default to HDMI
Display: HDMI (1024×768)
In: serial
Out: vga
Err: vga
Board: TBS2910 Matrix ARM mini PC
Net: FEC [PRIME]
Hit any key to stop autoboot: 0
Matrix U-Boot>

view raw

Matrix U-Boot

hosted with ❤ by GitHub

Where you go from here is up to you. You can type help just to check all the commands. But this is a tutorial on how to change u-boot so just type the following commands.

setenv serverip "your tftp server"
setenv ipaddr "any unused ip server in your tftp server subnet"
setenv loadaddr 0x10800000

tftp u-boot.imx
mmc dev 2 1
setexpr fw_sz ${filesize} / 0x200
setexpr fw_sz ${fw_sz} + 1
mmc erase 0x0 0x2000
mmc write ${loadaddr} 0x2 ${fw_sz}

This is merely a learning exercise I did, as I’ve never done this before. You can easily integrate these kind of things into the tbs2910.h itself, in the u-boot source code under include/configs.

This is were I took most of my info. Kudos for l3iggs for his work. U-Boot source