I am writing firmware(MLO,u-boot.img, uImage(ver 3.12), dtb, rootfs.tar.gz) programming script for
am335x based custom board which is based on Beaglebone black.
Rootfile system is to be put onto the eMMC.
Firmware programming script runs as the one of the init script from
the nfsroot folder when board boots for the first time at programming station.
Basically script
1. Partitions the eMMC and
2. writes MLO, u-boot.img, uImage, dtb in the raw area of the first partition and
3. Then formats the other partitions as ext4 and
4. mounts ext4 partitions and extacts the rootfs.tar.gz.
Now there are two issues with the script and one with backup kernel memory area.
Script issues
1. I am not able create more than 7 partition(including logical partitions)
though sfdisk creates the partitions, device files related to partition is not available in /dev directory
Here is sfdisk command i used
#Partition emmc
sfdisk -D -H 255 -S 63 -C 467 /dev/mmcblk0 -uM << EOF
,32,C,*
,200,L
,200,L
,,E
,100,L
,60,L
,200,L
;1269,L
;
EOF
When i list the partitions fdisk/sfdisk reports 8 partitions but i don't see partition files related to 8th partition.
Here is fdisk output for the same,
# fdisk -l /dev/mmcblk0
Disk /dev/mmcblk0: 3841 MB, 3841982464 bytes
255 heads, 63 sectors/track, 467 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 * 1 5 40131 c Win95 FAT32 (LBA)
/dev/mmcblk0p2 6 31 208845 83 Linux
/dev/mmcblk0p3 32 57 208845 83 Linux
/dev/mmcblk0p4 58 467 3293325 5 Extended
/dev/mmcblk0p5 58 70 104391 83 Linux
/dev/mmcblk0p6 71 78 64228+ 83 Linux
/dev/mmcblk0p7 79 104 208813+ 83 Linux
/dev/mmcblk0p8 105 266 1301233+ 83 Linux
/dev/mmcblk0p9 267 467 1614501 83 Linux
2. Some times after partitioning eMMC device files(/dev/mmcblk0p2, /dev/mmcblk0p3 etc) doesn't appear and mkfs utility fails to format the partition and firmware flashing fails.
I used partprobe after partitioning eMMC but with not help. :(
eMMC memory issue
First partition of the eMMC is of type "Win95 FAT32 (LBA)"
We are not formatting this partition and using it as raw.
There are 3 copies of MLO, 2 copies of u-boot.img, uImage and dtb in the that partition.
After trying multiple time flashing using dd, uImage first copy memory area is corrupted and board complains the image in that partition is corrupted.
Now if eMMC is having controller handling wear leveling and error correction mechanism then how memory area where kernel is stored is corrupted?
Any suggestions/ideas/pointers to any of the mentioned problem?