How do I recreate the SD Card Image that came with my freescale LS1021A-IOT Development board?

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

How do I recreate the SD Card Image that came with my freescale LS1021A-IOT Development board?

2,055 Views
tafthorne
Contributor III


I have a freescale LS1021A-IOT development kit that came with an SD card.  When the SD card is inserted the system seems to boot happily.  I take it that to customise the firmware running on this board I will need to create a new image with a similar set of files.  Currently I cannot work out how to do this in a way that results in a card the system will boot from. 

I have installed the freescale Linuc SDK for LS1021A-IOT Rev2 v0.4 SOURCE 20150907 Yocto on an Ubuntu 14.04 VM.  I am now able to generate the fsl-image-* tagets it provides using bitbake.  These output a selection of files into the ../tmp/deploy/images/ls1021aiot directry but not a compressed ext2 filesystem as is found on the SD card. 

The SD card seems to have the following files on it:

ls -l /media/thomasthorne/648A-2441/

total 104064

-rw-r--r-- 1 thomasthorne thomasthorne 102610061 Jan  7  2015 fsl-image-rds-iot-ls1021aiot.ext2.gz.u-boot

-rw-r--r-- 1 thomasthorne thomasthorne   3872416 Jan  7  2015 uImage-ls1021aiot.bin

-rw-r--r-- 1 thomasthorne thomasthorne     21873 Jan  7  2015 uImage-ls1021aiot.dtb

Looking at the partition structure with the Disks utility it seems that there is 4.2MB of free space, 3.9GB of FAT followed by 4.0GB of Free Space.  I suspect there is something important in that first few MB as my attempts to recreate the card by manually setting up similar partitions or dd copying the card have failed. 

The START_HERE.html file on the CD-ROM is also a little confusing.  Although the TWR version of the board (TWR-LS1021A) is shown in the Supported Targets section the version I have is not. Have I got the wrong version of SDK perhaps?  I am confident I downloaded it from the LS1021A-IOT Software & Tools page, as shown here: QorIQ LS1021A-IoT Gateway Reference Design|NXP

If I follow the instructions for the TWR I end up with a Linux / root filesystem on the SD card.  The LS1021A-IOT does not boot from this.  I guess I would need to change some uBoot setting to get it to but as far as I can make out those may be on a flash chip in the box and would then make it so I could not use the supplied SD card any more.

How can I try and develop any software for a board when none of the instructions or the SDK seem to generate code that will run on it?!  I must be missing something as I cannot believe it would be that hard to get going 

Labels (1)
5 Replies

1,337 Views
ufedor
NXP Employee
NXP Employee

There is a package with all images needed for the SD card creation, but its size is bigger then allowed 50 MB.

Please create a Tecnical Case so I will be abelo to provide it:

https://community.freescale.com/thread/381898

1,337 Views
williamanderson
Contributor III

I am currently working my way through this process as well.  I corrupted the factory SD card so I ended up getting a prebuilt image from techNexion before i learned more details about building my own image from NXP. I haven't actually built a flash from scratch yet but I believe I know recipe now.  My SDK is built from Freescale-Linux-SDK-for-LS1021A-IOT-Rev2-v0.4-20150907-yocto.iso which I am told is the latest. It is derived from the v1.8 SDK release.  (confusing right) . Format the card as fat32 and leave a 8K space in front of the first ext4 partition such that bootloader can be placed there. For an SD card boot the RCW (512Byte + preamble+header+PBI) followed by u-boot and checksum is placed at offset 0x8.  I’m not sure but I think the  environment variable space is in here as well.

using

sudo dd if=u-boot-ls1021aiot.bin of=/dev/sd[x] bs=512 seek=8 conv=notrunc oflag=dsync

the merged RCW uboot ...  is placed on the flash.

The uImage--3.12-r0-ls1021aiot-20160720154524.bin and dtb files can be copied to the flash if you mount the flash partition.

That should be all there is to it.

In case it helps a copy of the email from techNexion states

---------------------------------

This device was built following NXP (formerly Freescale) instructions.

Also the Software is completely from NXP.

On our Server we have the following image from NXP:

ftp://ftp.technexion.net/demo_software/ls1021a-iot-gw/ls1021a-iot-gw-revB-OpenWRT-20151111.img.zip

You can use a Program like WinDisk Imager to flash it on a SD-Card.

For more information please contact NXP.

---------------------------------

Using this factory image. If I interrupt u-boot before it loads the kernel I see

=> fatls mmc 0:1

67015565   fsl-image-rds-ls1021aiot.ext2.gz.u-boot

   550920   u-boot-sd-rcw-70.bin

  4230656   uimage-ls1021aiot.bin

    21183   uimage-ls1021a-iot.dtb

   550920   u-boot-sd-rcw-20.bin

34517139   fsl-image-x11-ls1021aiot.ext2.gz.u-boot

The 2 rcw files are meaningless on a sd card boot.  I don't know why they are there. Very confusing.

My environment variables at this point are

=> printenv

baudrate=115200

bootargs=root=/dev/ram0 rw console=ttyS0,115200

bootcmd=run mmcboot

bootdelay=3

consoledev=ttyS0

eth1addr=00:1F:7B:63:02:6E

eth2addr=00:1F:7B:63:02:6F

ethact=eTSEC2

ethaddr=00:1F:7B:63:02:6D

ethprime=eTSEC2

fdt_high=0xcfffffff

fdtaddr=82800000

initrd_high=0xcfffffff

loadaddr=82000000

mmcargs=setenv bootargs console=$consoledev,$baudrate root=/dev/ram rw rootwait $othbootargs

mmcboot=run mmcargs;mmc rescan; fatload mmc 0:1 $loadaddr uImage-ls1021aiot.bin;fatload mmc 0:1 $fdtaddr  uImage-ls1021a-iot.dtb; fatload mmc 0:1 $ramdiskaddr fsl-image-rds-ls1021aiot.ext2.gz.u-boot; bootm $loadaddr $ramdiskaddr  $fdtaddr

ramdiskaddr=83000000

scsidevs=0

stderr=serial

stdin=serial

stdout=serial

Environment size: 749/131068 bytes

This end up giving you a compressed root file system which you can't update from the running system.  not optimal so..

  I am now working on trying to put a uncompressed file system on the SD card. and changing the boot commands accordingly.  I have received  the command syntax from NXP below but I haven't tried it yet. It probably will need some tweaking.

I need to modify the SD flash partition so it will have a /boot folder which will contain uImage{bin,dtb} files along with the expanded root file system /   The - in the bootm args indicates not to create a ramdisk I am told.

bootm 81000000 - 8f000000

+++++++++

SD boot with RFS on SD Card

setenv bootfile /boot/uImage-ls1021aiot.bin

setenv fdtfile /boot/uImage-ls1021a-iot.dtb

setenv mmcargs  'setenv bootargs root=/dev/mmcblk0p1 rw rootdelay=5 console=ttyS0,115200'

setenv mmcboot  'run sdargs; ext2load mmc 0:1 81000000 $bootfile; ext2load mmc 0:1 8f000000 $fdtfile; bootm 81000000 - 8f000000'

++++++++++

If you find any corrections or  additional info  please let me know.

Thanks

Bill

1,337 Views
dusanferbas
Contributor III

Hi,

any progress guys?

We are trying to make same thing. We succeeded with kernel & rootfs, but we need to use the rcw + loader + u-boot from the SD card, which came with the board. I checked RCW config, SW2.5 = OFF setting, but after build we get different image, which does not boot.

Any idea?

0 Kudos

1,336 Views
tafthorne
Contributor III

You need to check what version of the LS1021a chip is fitted to your board.  There are multiple version of u-boot with the older version only working with older revisions of the chip and the newer version working with only the newer versions.  I think the situation I ended up in was that the updated Yocto CD-ROM image provided by Freescale would only work with the newer version of silicon but my IOT had the older revision.  That meant I could not develop with it unless I found an old version of the freescale IOT development kit.  

How do you check the version of LS1021a chip fitted?  There is a number of letter in the initial u-boot output (when it works) which relates to the silicon version somehow but I forget exactly how. 

Sadly this is further complicated by the IOT board's development kit having been generated on a branch of the main freescale development line.  This branch has not been integrated back into the main Freescale SDK line so new versions of the standard Freescale Yocto SDK do not support the IOT.  This also means that there is no community support for it in the GitHub - Freescale/meta-fsl-arm: OpenEmbedded/Yocto BSP layer for Freescale's ARM platforms  (which is the layer you also get in the standard Yocoto project: http://www.yoctoproject.org/  )

All of that meant we ultimately were advised to base any designs we made on the Tower example design, LS1021a-twr rather than the LS1021a-iot.  The IOT design was derived from the TWR one to fit a specialised application.  That means most of the parts are the same, it just has a few less general purpose things on it. 

0 Kudos

1,337 Views
tafthorne
Contributor III

Thank you Bill, I will try and put something together based on this. 

0 Kudos