This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Booting blaze tablet 4460 from SD card

Other Parts Discussed in Thread: 4460

Hi all,

I have a blaze tablet 4460 GP ES1.1 and It it booting from emmc and running android. I would like to make it boot and run android from SD card.

I saw this post http://e2e.ti.com/support/omap/f/849/t/215322.aspx and the modification that they did to the u-boot. The problem is that the modification that Gina (from the post) suggested are in <u-boot folder>/board/omap4430sdp/mmc.c but I have a blaze tablet, not blaze so I think that there should be a omap44xxtablet folder for my tablet blaze where I should make the changes, but there isn't.

Can anyone please help me with the changes that I should to in order to boot from SD card?

Thank you very much,

Michael S. 

  • I don't need the showcommands command anymore. I only needed it because I thought that the errors I'm having when booting blaze are because of this first few lines "fatal: ..." in when building the AFS. In the end I figured that this is not the issue.

    Where should I push the video in order for it to show in the  android gallery app?

    I didn't understand the changes that you maid in the fastboot.sh file in order to boot with MMC card instead of SD card. What code should I delete? I tried to delete the code of userdata that changes the size but then it showed me the same error in the cache partition. 

     

  • The video needs to be located in "mnt/sdcard/Movies" you need to wait for the device to boot Android, the folder is created during boot up.

    The modification should looks like

    --- /media/f7117f61-c68d-448c-b077-69d6127a808a/michael/omap4_emmc_files_blaze_tablet (2)/fastboot.sh
    +++ /media/f7117f61-c68d-448c-b077-69d6127a808a/michael/omap4_emmc_files_blaze_tablet3/fastboot_modified.sh
    @@ -127,69 +127,25 @@
     
     echo "Flash android partitions"
     ${FASTBOOT} flash boot         ${bootimg}
     ${FASTBOOT} flash recovery    ${recoveryimg}
     ${FASTBOOT} flash system     ${systemimg}
    -
    -userdataimg_orig="${userdataimg}.orig"
    -if [ ! -f $userdataimg_orig ]; then
    -    cp $userdataimg $userdataimg_orig
    -else
    -    cp $userdataimg_orig $userdataimg
    -fi
    -
    -echo "Resizing userdata.img"
    -resizefail=0
    -userdatasize=`./fastboot getvar userdata_size 2>&1 | grep "userdata_size" | awk '{print$2}'`
    -if [ -n "$userdatasize" ]; then
    -    while [ 1 ];do
    -        echo Current userdata partition size=${userdatasize} KB
    -        if [ -d "./data" ]; then
    -            echo "Removing data"
    -            rm -rf ./data || resizefail=1
    -            if [ $resizefail -eq 1 ]; then
    -                echo "unable to remove data folder" && break
    -            fi
    -        fi
    -        mkdir ./data
    -        ./simg2img userdata.img userdata.img.raw
    -        mount -o loop -o grpid -t ext4 ./userdata.img.raw ./data || resizefail=1
    -        if [ $resizefail -eq 1 ]; then
    -            echo "Mount failed" && break
    -        fi
    -        ./make_ext4fs -s -l ${userdatasize}K -a data userdata.img data/
    -        sync
    -        umount data
    -        sync
    -        rm -rf ./data
    -        rm userdata.img.raw
    -        break
    -    done
    -else
    -    resizefail=1
    -fi
    -
    -if [ $resizefail -eq 1 ]; then
    -    echo "userdata resize failed."
    -    echo "Eg: sudo ./fastboot.sh"
    -    echo "For now, we are defaulting to original userdata.img"
    -    cp $userdataimg_orig $userdataimg
    -fi
    -${FASTBOOT} flash userdata ${userdataimg}
     
     if [ "$1" != "--noefs" ] ; then
         if [ ! -f ${efsimg} ] ; then
    @@ -218,6 +174,8 @@
     #flash cache.img
     ${FASTBOOT} flash cache         ${cacheimg}
     
    +${FASTBOOT} flash userdata ${userdataimg}
    +
     #reboot now
     ${FASTBOOT} reboot
     
    and check that userdata.img size is approx. 10MB or extract it from the original package where .orig haven't been created.

  • I think I have it working in SDCard using old the old method of copying files.

    1. Format the SDCard as mentioned at the beginning of this thread. Using the script to modify the geometry and using 2 or 3 partitions, I am using 2 partitions.

    2. modify the Kernel to use bootargs from the u-boot,

    diff --git a/arch/arm/configs/blaze_defconfig b/arch/arm/configs/blaze_defconfig
    index c8b66ef..596711b 100644
    --- a/arch/arm/configs/blaze_defconfig
    +++ b/arch/arm/configs/blaze_defconfig
    @@ -40,7 +40,8 @@ CONFIG_HIGHMEM=y
     CONFIG_COMPACTION=y
     CONFIG_ARM_FLUSH_CONSOLE_ON_RESTART=y
     CONFIG_CMDLINE="console=ttyO2,115200n8 mem=1G vmalloc=768M androidboot.console=ttyO2 omap_wdt.timer_margin=30"
    -CONFIG_CMDLINE_EXTEND=y
    +CONFIG_CMDLINE_EXTEND=n
    +CONFIG_CMDLINE_FROM_BOOTLOADER=y
     CONFIG_CPU_FREQ=y
     CONFIG_CPU_FREQ_DEFAULT_GOV_INTERACTIVE=y
     CONFIG_CPU_FREQ_GOV_PERFORMANCE=y

    3. modify u-boot to use SDCard bootargs, see 1440.uboot-diffs.txt.

    If you are compiling for Blaze the default bootargs are located in u-boot/include/configs/omap4430sdp.h.

    used bootargs are:

    setenv bootargs 'console=ttyO2,115200n8 mem=1GB root=/dev/mmcblk1p2 init=/init vram=10M omapfb.vram=0:4M androidboot.console=ttyO2'

    setenv bootcmd 'mmcinit 0; fatload mmc 0 0x80000000 uImage;bootm 80000000'

    I tested using the other ones with 512MB and 480MB values but they didn't work.

    In this point I have 3 comments,

    a). The last time modifications for SDCard doesn't work for me because of the bootargs I was using the bootcmd that you shared in previous post, and to boot in the fastboot command it requires the booti command that is loaded by default in u-boot. That means you should have used only the bootargs without the bootcmd.

    These are bootargs to use for SDCard when formated with fastboot.

    setenv bootargs 'console=ttyO2,115200n8 mem=1GB root=/dev/mmcblk1p2 init=/init vram=10M omapfb.vram=0:4M androidboot.console=ttyO2'

    not to use for SDCard when formated with fastboot.

    setenv bootcmd 'mmcinit 0; fatload mmc 0 0x80000000 uImage;bootm 80000000'

    b).The u-boot code needs some modifications provided in the diff file just mentioned, because the default bootcmd is modified for eMMC boot like next

         sprintf(booticmd, "booti mmc%d", boot_slot);
         setenv("bootcmd", booticmd);

    then it is needed to select a different when booting from SDCard, included in the diff file too.

    c). I modified the bootargs in the u-boot to allow it to boot without intervention, it worked ok, but code seems a little tricky, actual modification worked ok.

    4. The files are copied into the SDCard regularly using the old method, not the fastboot one. The files MLO, u-boot.bin and uImage are copied in the first partition, and the Android FS is copied into the second partition using root user to preserve file's permissions.

    I followed the release notes for 4AJ2.2 since they are the ones used in this thread, and copied the Android FS files from my

    http://omapedia.org/wiki/4AJ.2.2_OMAP4_Jelly_Bean_Release_Notes myfs_blaze_tablet folder, these steps are were made for Blaze tablet.

    5. There are required some modifications to the init.rc and init.omap4blazeboard.rc files, 6165.init_omap4blazeboard_rc.diff and 5415.init_rc.diff.

    For init.omap4blazeboard.rc - it is required to remove the part of mounting the partitions by name, I removed all the incidences.

    For init.rc, 2 modifications, first seems that not mounting the partitions using init.omap4blazeboard.rc removed commands is not creating some folders and giving them the nodev and nosuid and other properties needed to load the system, that is why of setting rootfs to rw made it work, and second is that /data/system folder is not created because of this.

    I think using the SDCard FS with rootfs using rw should not be an issue if it is used to debug the system and development, maybe with some extra work it can be configured to ro value.

    There are some errors for USB0 and USB1 but I haven't check them, if someone find what is wrong about them please share it. To see them run logcat from serial terminal errors are shown at the end of regular booting using these changes.

    6. After this the system booted ok, there are sometimes when a PM issue appears but I haven't identified why, it could be had been because of the bootargs being set manually, one time I set the u-boot modifications I booted 4 times and none of them presented the PM issue.

    Some extra tests that I still need to do are about using eMMC with this last changes, and to flash the SDCard and test using "booti mmc1" command just to check it.

    And I haven't had that much time to test or check the full boot log including logcat to see what other errors appears, but the system is booting from SDCard.

    One last point is the Ducati binary, could you try the one in pre-build binaries? and comment if the playback is working using it? I tested video playback and camera recording using SDCard FS, it worked ok, 1080p video playback is slightly slow but it plays fine.

  • I changed the fastboot script like you advised, however it kept on failing when writing the cache partition when I use MMC card. I deleted the code that had to do with the cache partition except the "${FASTBOOT} flash cache         ${cacheimg}" line.

    After that I ran the script on MMC card and it finished OK but it didn't boot. In the minicom log I found this line : "  [    7.403930] mmc1: error -110 whilst initialising MMC card" .

    In order to make sure that the problem is only with the MMC card, I tried to do run the script on SD card, It finished the script OK and booted to android OK.

    I also tried 3 different MMC cards and got the same results with every one of them.

    I used the ducati from the prebuilt binaries. I booted to android from SD card and push a video I recorded with my nexus 4. I think it's 720p. the video playback was a little bit laggy but it was fine overall.

  • The used SYSBOOT configuration is OFF ON OFF OFF ON OFF OFF OFF.

    I am still checking about Cache image.

    When you flash eMMC is it using the original u-boot from the release or the modified? in a previous post you mentioned that eMMC was working fine for you.

  • I am sorry I didn't explain myself very well.

    I am trying to boot with MMC card. It is not eMMC. MMC card is like an SD card only working on 8bit instead of 16bit.

    I'm having problem with using it instead of SD card. The problem is caused by its driver in the kernel. I'm trying to find the exact place. it's somewhere in the mmc init funcion (I don't remember the function name exactly because I don't have it with me right now). 

  • Ok, no problem.

    Just to summarize,

    1. Booting from eMMC is working ok in Blaze Tablet using prebuild binaries.

    2. Booting using SDCard with fastboot procedure you mentioned with some other modifications it is working for you.

    3. I finished and shared the modifications to boot using SDCard with 2 partitions system, copying the Android FS to second partition.

    Just as an update I tried to flash SDCard using fastboot procedure but using last modification where setting bootcmd for SDCard not to "booti mmc0" from last change is not booting correctly, it requires to keep separated modifications in code to use the SDCard for the 2  different uses.

    Then can we consider this post as in some way resolved? just to mark a status point.

    About MMC I thought it was the same as SDCard just how they are named, I used the term MMC when using Zoom boards, when booting was being using FAT16 for boot partition and MLO needed to be in the first part of the partition the first 32KB, if some file was modified and MLO replaced or moved after this location it required to format the partition again in order to copy the MLO first to keep this behavior.

    If possible could you elaborate in the use of MMC? I am not sure I going to be able to reproduce the issue since I cannot modify the Blaze.

  • We can consider booting from SD resolved.

    I'm trying to boot from MMC card now. The MMC has 16-bit bus and the SD has 8-bit bus and not the other way around like I wrote before. 

    I modified the fastboot.sh so it won't resize the userdata partition and made sure I can use the modified fastboot.sh and still boot successfully into android. When I use the script on MMC it finishes OK but gets stuck when booting and showing the following error: "mmc1: error -110 whilst initialising MMC card". I tried to investigate it. I started from the kernel/android-3.0/drivers/mmc/core/mmc.c function: mmc_attach_mmc -> mmc_init_card -> mmc_send_op_cnd (mmc_ops.c) ->mmc_wait_for_cmd (core.c) -> mmc_wait_for_req ->wait_for_completion. The function wait_for_completion gets timed out and returns an error. 

    I tried to understand what could cause this and came up with two suggestions:

    1. Modify the frequency that is being used in the comunication with the MMC card.   

    2. Modify the voltage that is being used by the MMC card.

    The problem is that I didn't where to modify it in the code.

    It looks like a voltage calibration is being made in kernel/android-3.0/arch/arm/mach-omap2/smartreflex-class1p5.c in the function sr_class1p5_calib_work but I'm not sure that it's the MMC slot voltages because the voltages there are too low.

    Where in the code can I change the frequency and voltage of the MMC? if one of them is not suitable for the MMC it won't reply and the function wait_for_completion will get timeout.

    I need to make the blaze tablet work with MMC card for the tests that I wont to run on it.

    Thank you,

    Michael S. 

  • I am thinking what method are you using fastboot or copying files? try copying files instead of fastboot, one thought I had is that if using SDCard is to copy files to it easily compared to flash the whole eMMC and less time consuming, just a comment not a suggestion to do.

    Apart, I found this post about your question for MMC,

    http://e2e.ti.com/support/omap/f/849/p/203339/725730.aspx

    Could you specify a difference between SDCard and MMC from you side? I thought it was the same device but name in 2 different ways, I am not clear about it.

  • Can you please elaborate on how to set this up?

    Im having trouble setting up this release to load on Blaze using my 4GB SD Card.

    So far, i have made the changes in omap4430sdp/mmc.c & include/configs/omap4430sdp.h

    What changes do I make in the rc files? Could you also elaborate on diff --git a/arch/arm/configs/blaze_defconfig b/arch/arm/configs/blaze_defconfig??

    I keep getting garbage characters on minicom. Why is that?

    Thank you!

  • If you are getting garbage from minicom that could mean that Xloader is not being found.

    1. did you set boot flag for first partition?

    2. the OMAP4460 you are using is GP or EMU or HS?

    3. did you checked when compiled Xloader to copy just before # sign? the same for u-boot? example not copying the red parts,

    cd ${YOUR_PATH}/x-loader
    make distclean	
    make ARCH=arm omap44XXsdp_config #(for Blaze)
    make ift 2>&1 |tee ${MYDROID}/logs/x-loader_make.out
    ### For fastboot.sh flashing script needs to rename MLO: #### mv MLO Blaze_Tablet_OMAP4470_GP_ES1.0_MLO #(for Tablet) 
    I think they (#) need to be replaced by ;#, just a comment.

    Elaborating about rc files, the changes where made to remove what loaded the partitions from Fastboot and to grant the rw permission needed to run, these rw permissions seemed to be granted by mount command for Fastboot partitions, then the only way to add those permission was in this way.

    For Kernel changes they are made to use the bootargs from the u-boot not the ones defined in the kernel.

    What do you mean by elaborate about those changes?

  • I did all those.
    The first partition is set to boot flag | I'm using a GP | And I do copy just before the #sign

    By elaborate, I mean to tell me which file and where the changes need to be done. I was quite lost trying to follow your procedures.

    Thanks

    P.S.

    diff --git a/board/omap4430sdp/mmc.c b/board/omap4430sdp/mmc.c
    index d703330..8b480b2 100644
    --- a/board/omap4430sdp/mmc.c
    +++ b/board/omap4430sdp/mmc.c
    @@ -36,7 +36,7 @@
     #define EFI_NAMELEN 36

    So what am I suppose to do in this section??

    What does it mean ---a +++b?? am i changing the file location??

    P.S.S

    I tried to find the problems for why my 4j2.2. wont work: So i tried to debug it and here's what showed up:

    [    9.140289] init: skipping insecure file '/default.prop'
    [    9.147399] init: skipping insecure file '/init.rc'
    [   14.010284] init: Timed out waiting for /dev/.coldboot_done
    [   14.019592] init: skipping insecure file '/system/build.prop'
    [   14.028167] init: Unable to open persistent property directory /data/property errno: 2
    [   62.005950] HDCP: failed to load keys
    [   62.010406] omap-rproc omap-rproc.1: rproc_loader_cont: failed to load ducati-m3.bin
    [   62.019256] omap-rproc omap-rproc.0: rproc_loader_cont: failed to load tesla-dsp.bin

  • For this section

    diff --git a/board/omap4430sdp/mmc.c b/board/omap4430sdp/mmc.c
    index d703330..8b480b2 100644
    --- a/board/omap4430sdp/mmc.c
    +++ b/board/omap4430sdp/mmc.c
    @@ -36,7 +36,7 @@
     #define EFI_NAMELEN 36
     
     /* Default to eMMC slot for omap4430sdp Blaze and Blaze Tablet */
    -int mmc_slot = 1;
    +int mmc_slot = 0;
     
     static const u8 partition_type[16] = {
         0xa2, 0xa0, 0xd0, 0xeb, 0xe5, 0xb9, 0x33, 0x44,

    it is suppose to replace the

    -int mmc_slot = 1;

    by
    +int mmc_slot = 0;

    The format of the file is dividing the changes in the part of @.

  • Hi Manuel,

    I've successfully booted blaze tablet from mmc card. just needed to make some voltage modification. I will explain later.

    I am trying to push a file to the root folder of the blaze and it says "failed to copy" . . . "Read-only filesystem"

    I changed mount rootfs rootfs / ro remount to mount rootfs rootfs / rw remount in /out/target/product/blaze_tablet/root/init.rc

    and I also did :

    $ sudo ./adb kill-server
    $ sudo ./adb start-server
    $ sudo ./adb root
    $ sudo ./adb remount
    $ sleep 1
    $ sudo ./adb kill-server
    $ sudo ./adb start-server
    $ sudo ./adb root
    $ sudo ./adb remount

    like you suggested in this post : http://e2e.ti.com/support/omap/f/849/p/210782/748593.aspx#748593

    but I still get the same result

  • The first idea is to ask if it is using copy-paste files method or fastboot one?

    Thinking it a little, from HW point of view even the kernel logs says that the R/W switch for the SDCard is not read and that it will assume rw value, is the SDCard's in rw or ro mode?

    I have been trying to get the boot using fastboot method and SDCard working, but I have not been able to but I have found that the kernel modification is not needed and that it should use the default values for bootargs. what bootargs are you using for this case?

    The issue should be in the way Android loads the FS but I haven't faced the issue but enabling the traces from ADB could help. By checking 4AJ2.2 release it is needed to define a environment variable when building it, maybe doing a "cd /4AJ22/mydroid/system/core/adb/" after defining the source and lunch variables and doing

    export ADB_TRACE=all

    at least from the source code it seems the way to enable it,

    /4AJ22/mydroid/system/core/adb/adb.c

    /* read a comma/space/colum/semi-column separated list of tags
     * from the ADB_TRACE environment variable and build the trace
     * mask from it. note that '1' and 'all' are special cases to
     * enable all tracing
     */
    void  adb_trace_init(void)
    {
        const char*  p = getenv("ADB_TRACE");

    Out of this could you share a Kernel and Android log? and the init*.rc files from root directory? to try to reproduce your issue? in copy-paste files method I was able to push files to the Device using adb.

  • Another question to ask is if you are seeing the same behavior with SDCard? without voltage modification.

  • I get the same ADB behavior with SD card.

    The only change in init.rc that I've made is: mount rootfs rootfs / ro remount -> mount rootfs rootfs / rw remount

    What do you mean by sharing kernel and android log? From the minicom?

    I didn't change the bootargs at all. In order to boot from SD card using the fastboot mathod I followed your instructions here: http://e2e.ti.com/support/omap/f/849/t/269068.aspx?pi239031349=2 from what you posted on Jun 19. Then I realized that the kernel boots from SD but the AFS boots from eMMC. In order to boot AFS from SD card I switched all the occurrences of omap_hsmmc.1 in init.omap4blazeboard.rc to omap_hsmmc.0 .

    After recompilation I used those three commands as you suggested:

    sudo ./fastboot  oem set_flash_slot:SD

    sudo  ./fastboot  oem format

    sudo ./fastboot.sh

    and the blaze tablet successfully booted from SD.

      

  • The kernel and Android logcat logs I asked you to share was to know if it was the same boot status that I am seeing, if it is not possible to share those it is ok.

    If you didn't modified the kernel bootargs that means you are using the default from config file, it is ok then, one change I don't have is replacing omap_hsmmc.0, for what I checked it is not needed, init process rename the used omap_hsmmc.1 to what boot device is used, one thing to try is to use omap_hsmmc.1 as original value and check, if you used it before was it booting or it is needed in order to boot?

    Let me try to reproduce this using the omap_hsmmc.0 value. Using SDCard fastboot I was not able to use adb because system was not using correct properties from init.rc when mounting the system and then system was not loaded, but this could be different test case.

  • After tracing back from init.omapblazeboard.rc to Kernel main.c file, I found that it is needed to add bootargs options to set correct rootfs.

    setenv bootargs 'console=ttyO2,115200n8 mem=1G root=/dev/mmcblk1p7 vmalloc=768M androidboot.console=ttyO2 omap_wdt.timer_margin=30  rw rootdelay=2 init=/init'

    setenv bootcmd 'booti mmc0'

    and the changes for init.omapblazeboard.rc that to change omap_hsmmc.0 are correct from you side, it needs to be omap_hsmmc.0.

    Some extra modifications I need to verify if are needed or not are:

    comment next lines about mtd, I was not able to find mtd partitions or devices when system booted, my idea was that init.rc was being replaced by next commands, but it was not, tracing back it was rootfs that was being not set to SDCard, then having mtd commands in init*.rc files seemed not needed, but I need to verify if they are needed or not tomorrow, I am sharing this bootargs for you to check it today your time.

    init.rc
    on fs
    # mount mtd partitions
        # Mount /system rw first to give the filesystem a chance to save a checkpoint
    #    mount yaffs2 mtd@system /system
    #    mount yaffs2 mtd@system /system ro remount
    #    mount yaffs2 mtd@userdata /data nosuid nodev
    #    mount yaffs2 mtd@cache /cache nosuid nodev

    init.omapblazeboard.rc
    # change permissions for mtd device
    #    chmod 0660 /dev/mtd/mtd0
    #    chown media media /dev/mtd/mtd0

    The system is booting but it is giving me a mediaplayerservice error that I going to check tomorrow.

    For omap_hsmmc.0 I checked when system booted that used system and root partitions were correct, but after creating a folder inside /system the folder was not appearing in the SDCard it was in eMMC, then I started to check the values for omap_hsmmc.0 and this value matched SDCard as you said, now using the bootargs and modifications I am able to see the created folder in the PC when inserted the SDCard.

    Other test I made was from the device mount omap_hsmmc.0 and create the folder, it was not reflected in the device rootfs but I can see it in the PC.

    Could you try using the bootargs and modification and comment if they worked for you?

    I am able to push a file to the SDCard using adb, no error is present, and the file is present in when look for it in the SDCard in the PC.

  • Michael,

    I did some check about the init.rc the part of removing MTD commands, it is not a difference, the same folders are loaded in init.omapblazeboard.rc then the ones from init.rc seems to be the final commands to set ro for system and other adjustments.

    About the MediaPlayer error it is appearing because the external is not correctly defined, one post that talks of similar issue is

    http://e2e.ti.com/support/embedded/android/f/509/p/200648/717834.aspx#717834

    but I was not able to test it today, it required to recompile MYDROID and it took some time, I going to try it tomorrow.

    This issue is similar to the one in GB where the SDCard needed to be defined for internal storage because GB used only external storage SDCard, in JB there is internal storage defined now but for some reason in this configuration the external SDCard is being referenced and MediaPlayer and Gallery are using only external media location as it was in GB.

    I checked vold.fstab and removed the EXTERNAL_STORAGE from init.omap4blazeboard.rc, but it didn't help.

    I going to need to run some test and debug the issue in order to find how to correct it, but regular system is running ok with the modification, MediaPlayer and Gallery are not working and there is a error for MediaPlayer, it seems to happen when it tries to create the SDCard Media locations or access EXTERNAL_STORAGE export, still under investigation.

    In order to avoid setting bootargs each bot I made next modification base in my last shared u-boot diff file. If you are using the first u-boot change then you will only require to use second modification.

    diff --git a/board/omap4430sdp/mmc.c b/board/omap4430sdp/mmc.c
    index 529e6db..c1f3142 100644
    --- a/board/omap4430sdp/mmc.c
    +++ b/board/omap4430sdp/mmc.c
    @@ -433,11 +433,7 @@ int omap4_mmc_init(void)
     
            mmc_slot = mmc_slot_temp;
     
    -       if (boot_slot == 0 ) {
    -               sprintf(booticmd2, CONFIG_BOOTCOMMAND, boot_slot);
    -       } else {
    -               sprintf(booticmd2, "booti mmc%d", boot_slot);
    -       }
    +    sprintf(booticmd2, "booti mmc%d", boot_slot);
            setenv("bootcmd", booticmd2);
            return myreturn;
     
    diff --git a/include/configs/omap44XXtablet.h b/include/configs/omap44XXtablet.h
    index 46930f0..399e23f 100644
    --- a/include/configs/omap44XXtablet.h
    +++ b/include/configs/omap44XXtablet.h
    @@ -153,9 +153,9 @@
            ip=dhcp"
     #else
     
    -#define CONFIG_BOOTARGS "console=ttyO2,115200n8 mem=1GB root=/dev/mmcblk1p2 init=/init vram=10M omapfb.vram=0:4M androidboot.console=ttyO2"
    +#define CONFIG_BOOTARGS "setenv bootargs 'console=ttyO2,115200n8 mem=1G root=/dev/mmcblk1p7 vmalloc=768M androidboot.console=ttyO2 omap_wdt.timer_margin=30  rw rootdelay=2 init=/init'"
     
    -#define CONFIG_BOOTCOMMAND "mmcinit 0; fatload mmc 0 0x80000000 uImage;bootm 80000000"
    +#define CONFIG_BOOTCOMMAND "booti mmc0"
     #define CONFIG_OMAP4_ANDROID_CMD_LINE 1
     
     #endif

  • These are the modifications used to get fastboot method working without media error.

    For the Kernel I used the same method of booting from U-boot, but you can set the bootargs in the Kernel instead of configuring it to use U-boot's bootargs.

    3755.0001-Kernel-Modification-to-boot-from-SDCard-using-4AJ2.2.patch.txt

    The changes for the u-boot are in next patch, these changes are the same as in previous post from where you took actual changes.

    [U-BOOT-Blaze]Modification to boot from SDCard using 4AJ2.2 for fastboot method

    http://review.omapzoom.org/#/c/33730/

    For init.rc and init.omapblazeboard.rc I took the changes from next post, this post is from other E2E forum and is for other device BeagleBone Black but it applies for Android FS, not the same changes but similar.

    http://e2e.ti.com/support/embedded/android/f/509/p/282059/1010659.aspx#1010659

    and the changes for init.omapblazeboard.rc are: (I only included Blaze Tablet, I didn't have the opportunity of testing git in Blaze but changes should apply the same)

    [MYDROID-DEVICE-TI-TABLET] Modification to boot from SDCard using 4AJ2.2 for Fastboot method.

    http://review.omapzoom.org/#/c/33747/

    it is required a modification to vold.fstab as mentioned in the other post, the change is in next patch

    http://review.omapzoom.org/#/c/33754/

    the explanation is the same than for storage_list.xml in next paragraph, but this change is based in the other post.

    From the post mentioned before

    http://e2e.ti.com/support/embedded/android/f/509/p/200648/717834.aspx#717834

    it is needed to modify one file storage_list.xml, change was referenced from the same mentioned post, it was needed because not including it generated the media error when trying to load mediaplayer because /storage/sdcard1 was incorrectly mounted and it was not providing access because of access error, then system will use /data/media to store internal Media files. I just removed the definition from the file and it fixed the access error, I tried other changes in init.omapblazeboard.rc and init.rc but none of them worked for me then I removed this line from the file and error was gone, in my understanding if the sdcard is being used by the system it should not be configured has external unit, it is my observation, I tried to remove it from init.rc files but my knowledge about Storage and Vold objects is basic, I did no further investigation.

    This modification to storage_list.xml requires to recompile all the target and update many files, it is easy to do with ./adb sync exporting ANDROID_PRODUCT_OUT to what directory contains "out/target/product/blaze_tablet/" where system.img file/system folder are located, or flashing the SDCard again.

    If may I say, using fastboot method makes work easy, I did find easy to use and one time the scripts to copy the files to fastboot directory it is not needed to remove the SDCard from the device and flashing the devices gets easy by either method.

    for init.rc the changes are in next patch,

    [MYDROID-SYSTEM] Modification to boot from SDCard using 4AJ2.2 for fastboot method

    http://review.omapzoom.org/#/c/33749/

    I did double check and almost forgot about fastboot.sh script changes. I am still getting the userdata.img mmc error, then I removed the part of code that resizes this partition, next attached file is the fastboot.sh I am using.

    7242.fastboot.sh_modified.tar

    or check

    http://review.omapzoom.org/#/c/33750/

    
    

    An extra note is that leave umulti2.sh bootargs empty, if you add them they will be concatenated with the actual ones.

    I did forget something to mention, used SYSBOOT configuration is the same as for SDCard

    OFF ON OFF OFF ON OFF OFF OFF

    /************************************************************************************************************************/

    2 useful tips I found when working in this issue.

    1. the images can be recreated using the methods found in

    http://omapedia.org/wiki/Android_eMMC_Booting

    it is required to add the path to $MYDROID directory for each ./out/... command you find, like $MYDROID/out/....

    2. And that in order to modify ramdisk.img and add it to boot.img ( this is useful to modify init.rc and init.omapblazeboard.rc) it is needed to modify ramdisk.img first then recreate it, one time recreated ramdisk.img it is needed to run umulti2.sh to add ramdisk.img to boot.img. umulti2.sh is not included in prebuild binaries for 4AJ22, then you need to find it in the release notes instructions,

    ${MYDROID}/device/ti/support-tools/boot/omap4/umulti2.sh 

    The kernel needs to be included in boot.img too, then copying zImage to emmc folder then ran umulti2.sh.

    SDCard partition was made using the mentioned script in previous posts.

    /************************************************************************************************************************/

    The instructions to boot SDCard using the other method of copying files to the SDCard is in next link

    http://e2e.ti.com/support/omap/f/849/p/272894/1008321.aspx#1008321

    /************************************************************************************************************************/

  • I did forget something to mention, used SYSBOOT configuration is the same as for SDCard

    OFF ON OFF OFF ON OFF OFF OFF

  • Michael,

    I modified the post to include what was missed in the first time I posted it, I reviewed every peace of information and steps done and those are the changes I have in the device to have SDCard with fastboot method running.

    Don't consider information contained in the email notification that was sent for the post the first time, use the information from the post in the forum.

  • Hi Manuel,

    Thanks for this great summary. I will try it when I'll have the chance.

    One more question though...

    I also get mmc error when fastboot.sh script is trying to resize userdata partition so I modified fastboot.sh so it wont resize userdata partition and then it worked fine. However I do need the userdata partition to be as big as possible. How do I set it's size?   

  • In my current testings the userdata partition size is occupying the rest of the SDCard, it is not of 13MB as the userdata.img image, then it could be correct, at your side have you checked it using gparted from Ubuntu, I noted this when I tried to add a extra partition to at it as media partition for the other issue, but I didn't followed that path since there is a emulated SDCard and media folder in /data/media folder mounted in /mnt/sdcard/, I know not that relevant information but just to share.

    These are some suggestions or ideas to check, I will check them during next week.

    1. check how Android system is doing the userdata.img and modify the size here to match the space left in the device.

    2. check or compare both procedures and modfiy fastboot.sh according, this could help if the used parameters to recreate the image are the reason of the error.

    3. it would be needed to debug the u-boot code to know the reason why it is failing and correct it.

  • Hi Manuel,

    The userdata partition occupies the rest of the available space however when I'm using adb shell and trying to write something to /mnt/sdcard/sdcard0 it says that there is only 700MB available.

    I'm not sure but I think that this is because the unresized userdata.img in fastboot.sh script.

    I tried to find where in android the size of userdata is set, however I couldn't find it. Could you plaese help me with this last problem?

    Thanks ,

    Micheal S.

  • Hi,

    I was able to isolate the issue but not to fix it.

    I tried different image sizes and resize procedures, but none of them worked.

    The error is

    mmc write error 00108000

    it indicates a timeout in the write command,

    I traced it to next file

    ./4AJ22/u-boot/cpu/omap4/mmc.c

    and next 2 functions,

    omap_mmc_write_sect

    and

    mmc_write_data

    by adding next prints

    diff --git a/cpu/omap4/mmc.c b/cpu/omap4/mmc.c
    index 9b7e962..fe22095 100644
    --- a/cpu/omap4/mmc.c
    +++ b/cpu/omap4/mmc.c
    @@ -301,7 +301,10 @@ int mmc_write_data(unsigned int base, unsigned int *input_buf)
                            OMAP_HSMMC_STAT(base) |= TC_MASK;
                            break;
                    }
    +        printf("count %08x\n", count);
            }
    +    printf("return count %08x\n", count);
            return count;
     }

     I traced it to the Multi-block process, if the partition size is  generating less than 0xffff blocks there is no error,

    count 0000ba24
    count 0000ba25
    count 0000ba26
    count 0000ba27
    count 0000ba28
    return count 0000ba28
    count 00000001
    count 00000002
    count 00000003
    count 00000004

    but if the partition size is doing it, then there is an error,


    count 0000fffb
    count 0000fffc
    count 0000fffd
    count 0000fffe
    count 0000ffff
    count 00000001
    count 00000002
    count 00000003
    mmc write error 00108000

    I used a code to modify the size of the partition

    diff --git a/board/omap4430sdp/mmc.c b/board/omap4430sdp/mmc.c
    index 5f3976d..5820711 100644
    --- a/board/omap4430sdp/mmc.c
    +++ b/board/omap4430sdp/mmc.c
    @@ -35,6 +35,10 @@
     #define EFI_ENTRIES 128
     #define EFI_NAMELEN 36
     
    +#define MULT16MASK 0xFFFFFFF0
    +#define MULT16 15
    +#define MULTIPLE16(x) ((x - MULT16) & MULT16MASK) * 35 / 100;
    +
     /* Default to eMMC slot for omap4430sdp Blaze and Blaze Tablet */
     int mmc_slot = 0;
     
    @@ -293,8 +297,10 @@ static int do_format(void)
                            next += sz;
                            continue;
                    }
    -               if (sz == 0)
    +               if (sz == 0) {
                            sz = blocks - next;
    +                       sz = MULTIPLE16(sz);
    +        }
                    if (add_ptn(ptbl, next, next + sz - 1, partitions[n].name))
                            return -1;
                    next += sz;

    then I tested some values, from where using a equation of 3 simple

    1489  = 0xba28 = 47656
    x         = 0xffff       = 65535

    x = 2047
    x = 35%

    35%    =   1489
    y          =    2047

    y = 48 %

    I found that using ~48% should be below the 0xFFFF margin. You could use the 47 % value instead of 35% for your tests.

    I know it is neither a fix nor a WA, it just make it work by now and to run some test.

    There are some functions that are executed just after the blocks are written in mmc_write_data that need to review, they are MMC_CMD12 and MMC_CMD13, they are disabling the , then the while loop is started again and it returns an error for the third block.

    I ran 4 times the same test and it is conclusive that it fails when block number is greater than 0xFFFF and it fails in the third block.

    I going to try to find the solution during next 3 days, but no promise, if you can get to the solution first please share the fix.

  • Curious fact, the maximum partition size 2048MB matches with the maximum value for a FAT32 partition, I haven't read about MMC in OMAP4 TRM there could be some note about this limitation, I will check it.

  • I tried 2 things,

    From OMAP4470 TRM, section "25.4.11 Transfer Stop", citing the TRM,

    "Stop at block gap:
    This feature is enabled by setting the MMCi.MMCHS_HCTL[16] SBGR bit to 0x1. When enabled, this
    capability holds the transfer on until the end of a block boundary. If a stop transmission is needed,
    software can use this pause to send a CMD12 to the card."

    and the respective commands and instructions for SBGR and CR for MMCHS_HCTL, to send it STOP command before CMD12 but it didn't fixed the issue, CDM12 hangs. Then it is not correct change.

    And for section "25.5.1.2.1.4 Read/Write Transfer Flow Without DMA With Polling" I tried disabling BCE to zero to do CDM12 for infinite number of blocks to follow the diagram, but it didn't worked either. And removing CMD12 from the source code for omap_mmc_write_sect is not working.

    For what I read in OMAP4 TRM there are some restrictions about the block size to be at most 2048 but I was not able to find a specific instruction on how to do multi-block writing, maybe checking in the SDCard specification.

    I don't have the full knowledge about SDCards then I will not be able to help in this issue.

    You could try creating a new post for this issue for someone else to help, or if somebody knows how to fix it can you share it?

  • Hi Manuel,

    Sorry it took me so much time to check it.

    I downloaded everything (AFS, kernel etc...)  again and followed your steps.

    I maid sure that I made only the modifications that you've mentioned and I used a regular SD card to make sure that I won't have MMC card issues.

    When I try to boot the tablet It just enters fastboot. Am I missing something? Maybe the bootargs should be different?

    I made sure again that I maid the exactly the same changes you did.

  • You could try the solution in next link.

    http://e2e.ti.com/support/omap/f/849/p/272894/1040583.aspx#1040583

    I knew of other people having the same issue you describe and it was fixed in this way, I should say that the SDCard was cleaned in one PC then this person formated it using dd command and passed it to me and I cleaned it again using dd command in my Linux PC then partitioned and formated using Gparted from Ubuntu, then the files where copied using my computer then we tried booting using Tablet 2 and it booted ok, then just to eliminate that the first Linux PC had any issues this person repeated the same process using his computer and good news was that it worked ok, but it seemed that the second computer was needed because we tried the same procedure first using the first computer and it didn't work.

    About the last issue try to use the script or procedure that modify the SDCard's geometry just to check if it corrects the blocks issue with fastboot and userdata.img, it is only a suggestion I haven't tried it and I will not be able to check it, but it one check I thought.