Page 1 of 1

Linux questions

PostPosted: Thu Jan 23, 2014 11:00 am
by updatelee
OK Ive searched everywhere, cant find the info anywhere.

How do I flash the Matrix in Liinux ?

UDL

Re: Linux questions

PostPosted: Thu Jan 23, 2014 9:41 pm
by Cjcr
updatelee Wrote:OK Ive searched everywhere, cant find the info anywhere.

How do I flash the Matrix in Liinux ?

UDL

I think I've saw something about it (and how to do) in a BoundaryDevices(.com) page ... but I can't find the link right now.

I think they have written a tool to write on the eMMC/flash from Linux but I don't know if it will work on Matrix ...

Re: Linux questions

PostPosted: Fri Jan 24, 2014 12:11 am
by updatelee
It's worth a try, esp if it's open source. I'll look tonight.

Wine doesn't have access to low level USB interactions, qemu doesn't support USB hot plug. Virtual box kernel modules won't compile on 3.13

So I'm stuck

UDL

Re: Linux questions

PostPosted: Fri Jan 24, 2014 12:41 am
by mijanek
Actually I don't know (didn't try ) hoy you can access the flash in boot mode under linux. But the relevant files and procedures from log:

booting into flash mode (but don't know how):
Code: Select All Code
ModuleID[2] LevelID[10]: ExecuteCommand--Boot[WndIndex:0], File is G:\Matrix\Matrix-System\MatrixTV\Profiles\MX6Q Linux Update\OS Firmware\u-boot-mx6q-sabresd.bin
ModuleID[2] LevelID[10]: ExecuteCommand--Load[WndIndex:0], File is G:\Matrix\Matrix-System\MatrixTV\Profiles\MX6Q Linux Update\OS Firmware\uImage, address is 0x10800000
ModuleID[2] LevelID[10]: PortMgrDlg(0)--Command Load excute successfully, retry count: 0
ModuleID[2] LevelID[10]: ExecuteCommand--Load[WndIndex:0], File is G:\Matrix\Matrix-System\MatrixTV\Profiles\MX6Q Linux Update\OS Firmware\initramfs.cpio.gz.uboot, address is 0x10C00000
ModuleID[2] LevelID[10]: PortMgrDlg(0)--Command Load excute successfully, retry count: 0
ModuleID[2] LevelID[10]: ExecuteCommand--Jump[WndIndex:0]


At this stage it changes the device to block device so you may write the flash...

The Update:
Code: Select All Code
ModuleID[2] LevelID[10]: ExecuteCommand--Push[WndIndex:0], Body is $ ls /dev/*
ModuleID[2] LevelID[10]: ExecuteCommand--Push[WndIndex:0], Body is $ dd if=/dev/zero of=/dev/mmcblk0 bs=512 seek=1536 count=16
ModuleID[2] LevelID[10]: ExecuteCommand--Push[WndIndex:0], Body is $ echo 0 > /sys/block/mmcblk0boot0/force_ro
ModuleID[2] LevelID[10]: ExecuteCommand--Push[WndIndex:0], Body is send
ModuleID[2] LevelID[10]: ExecuteCommand--Push[WndIndex:0], Body is $ dd if=$FILE of=/dev/mmcblk0boot0 bs=512 seek=2 skip=2
ModuleID[2] LevelID[10]: ExecuteCommand--Push[WndIndex:0], Body is $ echo 1 > /sys/block/mmcblk0boot0/force_ro
ModuleID[2] LevelID[10]: ExecuteCommand--Push[WndIndex:0], Body is $ echo 8 > /sys/devices/platform/sdhci-esdhc-imx.3/mmc_host/mmc0/mmc0:0001/boot_config
ModuleID[2] LevelID[10]: ExecuteCommand--Push[WndIndex:0], Body is send
ModuleID[2] LevelID[10]: ExecuteCommand--Push[WndIndex:0], Body is $ dd if=$FILE of=/dev/mmcblk0 bs=1M seek=1 conv=fsync
ModuleID[2] LevelID[10]: ExecuteCommand--Push[WndIndex:0], Body is send
ModuleID[2] LevelID[10]: ExecuteCommand--Push[WndIndex:0], Body is $ tar xf $FILE
ModuleID[2] LevelID[10]: ExecuteCommand--Push[WndIndex:0], Body is $ sh mksdcard.sh /dev/mmcblk0
ModuleID[2] LevelID[10]: ExecuteCommand--Push[WndIndex:0], Body is $ mkfs.ext3 -j /dev/mmcblk0p1
ModuleID[2] LevelID[10]: ExecuteCommand--Push[WndIndex:0], Body is $ mkdir -p /mnt/mmcblk0p1
ModuleID[2] LevelID[10]: ExecuteCommand--Push[WndIndex:0], Body is $ mount -t ext3 /dev/mmcblk0p1 /mnt/mmcblk0p1
ModuleID[2] LevelID[10]: ExecuteCommand--Push[WndIndex:0], Body is pipe tar -jxv -C /mnt/mmcblk0p1
ModuleID[2] LevelID[10]: ExecuteCommand--Push[WndIndex:0], Body is frf
ModuleID[2] LevelID[10]: ExecuteCommand--Push[WndIndex:0], Body is $ umount /mnt/mmcblk0p1
ModuleID[2] LevelID[10]: ExecuteCommand--Push[WndIndex:0], Body is $ echo Update Complete!


Here it looks like it writes raw the uImage kernel on the begin of the mmcblk0 with 1M offset, which is behind the boot part of the u-boot, then in makes the FS... this looks like that:
Code: Select All Code
#!/bin/sh

# partition size in MB
BOOT_ROM_SIZE=10


# call sfdisk to create partition table
# destroy the partition table
node=$1
dd if=/dev/zero of=${node} bs=1024 count=1

sfdisk --force -uM ${node} << EOF
${BOOT_ROM_SIZE},,83
EOF

and than you just untar the rootfs on it...

but all is more or les guessing... :-(

Re: Linux questions

PostPosted: Sun Apr 13, 2014 6:42 am
by l3iggs
I'm very interested in how to flash the matrix from a linux host as well. I've done some searching and I found this thread: https://community.freescale.com/thread/284170
It doesn't look good...
I'd love the hear if anyone else has made any headway on this.

Re: Linux questions

PostPosted: Sun Apr 13, 2014 8:55 am
by updatelee
I gave up, wasnt worth the time.

I now flash by booting to an SD card then writing the eMMC from there. or just boot by tftp, its super fast if your going to be making alot of changes.

UDL