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.

How to get USB stick mounted and unmounted in android 2.3.4 on BeagleBoard-xm using init.rc?

HI

What i am doing:

I am successfully able to mount my USB stick on Android 2.3.4 on Beagleboard-xm using this code from the following link.

http://processors.wiki.ti.com/index.php/Android_Developer_FAQs#Q:_How_to_get_USB_stick_installed.C2.A0.3F_How_to_install_apk_residing_on_USB_stick.C2.A0.3F

=====================================================================================================================================

Q: How to get USB stick installed ? How to install apk residing on USB stick ?

Ans: :
a) In the init.rc file do the following changes as shown with '+' sign (patch)

# mount sdcard third partition on /part-3
mkdir /part-3
+ mkdir /usbmountd
mount vfat /dev/block/mmcblk0p3 /part-3/

# mount mtd partitions
@@ -361,6 +369,9 @@
on property:persist.service.adb.enable=0
stop adbd

+on device-added-/dev/block/sda
+ service usbmountd /system/bin/usbmountd start
+
service servicemanager /system/bin/servicemanager
user system
critical

b) Create a new file /system/bin/usbmountd and copy the below

 #!/system/bin/sh

case "$1" in
"start")
mount -t vfat /dev/block/sda1 /usbmountd
 ;;
"stop")
sync
umount /dev/block/sda1
 ;;
*)
echo "$0: unknown argument $1." >&2;
 ;;
esac

Make sure that /system/bin/usbmountd has executable permissions

c) Use the Filemanager app#http://openintents.googlecode.com/files/FileManager-1.1.4.apk,when you browse the USB folder, it should show the .apk file, just click on this, it will install the application on the device directly.

==================================================================================================================================

using this i am able to browse through my "USB Stick" which i have mounted on Android 2.3.4 on Beagleboard-xm

THE PROBLEM:

The problem started when i remove and the USB stick and again i inserted the USB Stick i am not able to browse the through the files in the USB stick and get the message

"No files in the folder"

by seeing the above patch code, i added the following in the "init.rc " file.

===============================================================================================================================

on device-removed-/dev/block/sda
service usbmountd /system/bin/usbmountd stop


==============================================================================================================================

so that the stop case in the "usbmountd" get executed to get the umount the USB stick.


even after adding the above code in init.rc file i am not able to mount the USB stick on the device when i reinsert the usb.


I am looking for a solution when i remove the USB Stick, the Android OS should unmount the it automatically and when i insert the USB Stick it should get mounted.

Please help me out in getting a solution.


Regards
Aslam
  • Hi Aslam,

    You need to add entry in vold.fstab file so that volume deamon (vold) can mount and unmount mass storage device automatically.

    Please refer to below porting guide for more details.

    http://processors.wiki.ti.com/index.php/TI-Android-GingerBread-2.3.4-DevKit-2.1_PortingGuides#Mass_storage

    Regards,

    Pankaj Bharadiya

  • Hi Pankaj

    Good Morning !

    The answer which u had provide was really helpful.

    Regards

    Aslam

  • Dear Pankaj,

    I am facing another issue apart from this , could you please provide me some inputs or support to solve this issue.

    The issue is:

     I am customizing Android 2.3.4 on Beagleboard-xm,

    I have change the resolution of the screen of android to 1280 X 720 successfully.

    When i am browse through the following url: www.youtube.com
      and select a video from the youtube.com to play on the browser i see that video is playing in the Portrait format on the Left side of the screen.

    Playing video in Portrait format not only happens in Browser but also when i play a video file with the media player.

    I want a solution for :

    I want to display or play the video  in "Landscape format" in the center of the screen when i play in browser  from youtube or from any other site or from any other media player.


    With this i am sending a screen shot of the problem attached.

    I would be thankful if you suggest any solution for this.

    Regards

    Aslam



  • Hi Aslam,

    Overlay is used for video rendering. In overlay coed LCD width and height parameters are hardcoded to for time being.

    Please change following width and height parameter macors as per your resolution in /hardware/ti/omap3/liboverlay/overlay.cpp file and try again.

    #define LCD_WIDTH

    #define LCD_HEIGHT

    Regards,

    Pankaj Bharadiya

  • Dear Pankaj

    Thanks for the solution for screen overlay problem, The link you sent was helpful.

    I have an other problem now which is as follows.

    What i am doing:

    In android 2.3.4 on Beagleboard-xm , i have changed the boot.scr file for changing the system boot arguments of  memory from mem=256M to mem=512M as follows.

    FROM:

    setenv bootargs 'console=ttyO2,115200n8 androidboot.console=ttyO2 mem=256M root=/dev/mmcblk0p2 rw rootfstype=ext3 rootdelay=1 init=/init ip=off omap_vout.vid1_static_vrfb_alloc=y vram=8M omapfb.vram=0:8M omapfb.mode=dvi:1280x720MR-24@60'

    TO:

    setenv bootargs 'console=ttyO2,115200n8 androidboot.console=ttyO2 mem=512M root=/dev/mmcblk0p2 rw rootfstype=ext3 rootdelay=1 init=/init ip=off omap_vout.vid1_static_vrfb_alloc=y vram=8M omapfb.vram=0:8M omapfb.mode=dvi:1280x720MR-24@60'

    when i make a change like the above in TO: mem=512M the system doesn't boot at all.

    I have this log information which i had taken during booting process which i am pasting below:

    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

                                                 LOGFILE

    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    Texas Instruments X-Loader 1.51 (Apr  3 2012 - 12:40:00)
    Unsupported Chip!
    Beagle xM Rev C
    Starting X-loader on MMC
    Reading boot sector

    218792 Bytes Read from MMC
    Starting OS Bootloader from MMC...
    Starting OS Bootloader...


    U-Boot 2010.06 (Apr 20 2012 - 17:27:48)

    OMAP34xx/35xx-GP ES2.1, CPU-OPP2 L3-165MHz
    OMAP3 Beagle board + LPDDR/NAND
    DRAM:  384 MiB
    NAND:  HW ECC [Kernel/FS layout] selected
    0 MiB
    *** Warning - bad CRC or NAND, using default environment


    mmc1 is available
    reading boot.scr

    490 bytes read
    Running bootscript from mmc ...
    ## Executing script at 82000000
    reading uImage

    2922144 bytes read
    ***** Kernel: /dev/mmcblk0p1/uImage *****
    ***** RootFS: /dev/mmcblk0p2 *****
    ## Booting kernel from Legacy Image at 82000000 ...
       Image Name:   Linux-2.6.37-g06ebbba
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    2922080 Bytes = 2.8 MiB
       Load Address: 80008000
       Entry Point:  80008000
       Verifying Checksum ... OK
       Loading Kernel Image ... OK
    OK

    Starting kernel ...

    Uncompressing Linux... done, booting the kernel.

    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    Booting process fails after printing the following:

    Uncompressing Linux... done, booting the kernel.

    I am looking :

    How to increase the system memory from 256M to 521M on beagleboard-xm for android 2.3.4 by change the boot arguments in boot.src file as follows:

    setenv bootargs 'console=ttyO2,115200n8 androidboot.console=ttyO2 mem=512M root=/dev/mmcblk0p2 rw rootfstype=ext3 rootdelay=1 init=/init ip=off omap_vout.vid1_static_vrfb_alloc=y vram=8M omapfb.vram=0:8M omapfb.mode=dvi:1280x720MR-24@60'

    if there is any other process of changing the system memory from 256M to 512M please guide us with the documentation.

    I would be thankful to you .

    Regards

    Aslam.

  • Dear Pankaj

    Thanks for the solution for screen overlay problem, The link you sent was helpful.

    I have an other problem now which is as follows.

    What i am doing:

    In android 2.3.4 on Beagleboard-xm , i have changed the boot.scr file for changing the system boot arguments of  memory from mem=256M to mem=512M as follows.

    FROM:

    setenv bootargs 'console=ttyO2,115200n8 androidboot.console=ttyO2 mem=256M root=/dev/mmcblk0p2 rw rootfstype=ext3 rootdelay=1 init=/init ip=off omap_vout.vid1_static_vrfb_alloc=y vram=8M omapfb.vram=0:8M omapfb.mode=dvi:1280x720MR-24@60'

    TO:

    setenv bootargs 'console=ttyO2,115200n8 androidboot.console=ttyO2 mem=512M root=/dev/mmcblk0p2 rw rootfstype=ext3 rootdelay=1 init=/init ip=off omap_vout.vid1_static_vrfb_alloc=y vram=8M omapfb.vram=0:8M omapfb.mode=dvi:1280x720MR-24@60'

    when i make a change like the above in TO: mem=512M the system doesn't boot at all.

    I have this log information which i had taken during booting process which i am pasting below:

    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

                                                 LOGFILE

    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    Texas Instruments X-Loader 1.51 (Apr  3 2012 - 12:40:00)
    Unsupported Chip!
    Beagle xM Rev C
    Starting X-loader on MMC
    Reading boot sector

    218792 Bytes Read from MMC
    Starting OS Bootloader from MMC...
    Starting OS Bootloader...


    U-Boot 2010.06 (Apr 20 2012 - 17:27:48)

    OMAP34xx/35xx-GP ES2.1, CPU-OPP2 L3-165MHz
    OMAP3 Beagle board + LPDDR/NAND
    DRAM:  384 MiB
    NAND:  HW ECC [Kernel/FS layout] selected
    0 MiB
    *** Warning - bad CRC or NAND, using default environment


    mmc1 is available
    reading boot.scr

    490 bytes read
    Running bootscript from mmc ...
    ## Executing script at 82000000
    reading uImage

    2922144 bytes read
    ***** Kernel: /dev/mmcblk0p1/uImage *****
    ***** RootFS: /dev/mmcblk0p2 *****
    ## Booting kernel from Legacy Image at 82000000 ...
       Image Name:   Linux-2.6.37-g06ebbba
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    2922080 Bytes = 2.8 MiB
       Load Address: 80008000
       Entry Point:  80008000
       Verifying Checksum ... OK
       Loading Kernel Image ... OK
    OK

    Starting kernel ...

    Uncompressing Linux... done, booting the kernel.

    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    Booting process fails after printing the following:

    Uncompressing Linux... done, booting the kernel.


    I have generated this boot.scr file by using mkbootscr to generate the boo.scr file with mem=512M

    I am looking for :

    How to increase the system memory from 256M to 521M on beagleboard-xm for android 2.3.4 by change the boot arguments in boot.src file as follows:

    setenv bootargs 'console=ttyO2,115200n8 androidboot.console=ttyO2 mem=512M root=/dev/mmcblk0p2 rw rootfstype=ext3 rootdelay=1 init=/init ip=off omap_vout.vid1_static_vrfb_alloc=y vram=8M omapfb.vram=0:8M omapfb.mode=dvi:1280x720MR-24@60'

    if there is any other process of changing the system memory from 256M to 512M please guide us with the documentation.

    I would be thankful to you .

    Regards

    Aslam.

  • There were some patches pushed to our rowboat project to fix this issue. Please update to the latest u-boot sources.

    http://gitorious.org/rowboat/u-boot/commits/OMAPPSP_04.02.00.07

  • Dear Pankaj and Vishveshwar

    Thanks for the solution of increasing system memory  problem, The dump downloaded from the link  you had sent was handy.

    I have an other problem now which is as follows.

    What i am working on:

    As you know i am working on BeagleBoard-xm Rev C board with Android 2.3.4 which has a DM37x mounted on it, Processor speed is +1Ghzs, i have a serial port connected to the system, when i try to find out the processor speed  by typing the following command:

                  # cat /proc/cpuinfo

    I see the following log infomation.


    Processor       : ARMv7 Processor rev 2 (v7l)
    BogoMIPS        : 597.64
    Features        : swp half thumb fastmult vfp edsp thumbee neon vfpv3
    CPU implementer : 0x41
    CPU architecture: 7
    CPU variant     : 0x3
    CPU part        : 0xc08
    CPU revision    : 2

    Hardware        : OMAP3 Beagle Board
    Revision        : 0020
    Serial          : 0000000000000000
    # usb 1-2.2: USB disconnect, address 4

    looking at the above log we can make out that "BogoMIPS   : 597.64" where it shows that processor is not working at full fledge 1Ghzs frequency instead it is working at 597.64 Mhzs frequency.

    The reason why i am asking for this is for the following reason below:

    when i play a video from "Youtube.com" portal the video is not playing consistantly, smoothly and contineously or with jurks.

    To solve this issue i have added one of the bootarguments in the boot.scr as follows"

    setenv bootargs 'console=ttyO2,115200n8 androidboot.console=ttyO2 mem=512M root=/dev/mmcblk0p2 rw rootfstype=ext3 rootdelay=1 init=/init ip=off omap_vout.vid1_static_vrfb_alloc=y vram=8M omapfb.vram=0:8M omapfb.mode=dvi:1280x720MR-24@60 mpurate=1000'

    by running mkbootscr file.

    Adding this mpurate=1000 didnt solve the issue and found in the log that it speed of the processor was at the same value which was before adding this.

    What i am looking for:

    Could you please guide a solution by which  i can make the Beagleboard-xm Rev C to work efficiently at rated speed of 1Ghzs.

    Or please guide me if any patch has to be installed to fix this problem so that the system works at 1Ghzs speed.

    Making this system work at rated speed of 1Ghzs will allow the system to play any online videos from the youtube.com like protals efficiently and smoothly.

    Regards
    Aslam

  • I am working on Rowboat JellyBean for BeagleBoard xM. u-boot has the patch and I modified 'mem' from 256M to 512M in boot.scr.  But I cannot boot the kernel, and hang up here "Uncompressing Linux... done, booting the kernel".

    So I called mem_ok() to check the RAM in dram_init() in u-boot.

    /********************************************************
     *  mem_ok() - test used to see if timings are correct
     *             for a part. Helps in guessing which part
     *             we are currently using.
     *******************************************************/
    u32 mem_ok(u32 cs)
    {
        u32 val1, val2, addr;
        u32 pattern = 0x12345678;

        addr = OMAP34XX_SDRC_CS0 + get_sdr_cs_offset(cs);

        writel(0x0, addr + 0x400);    /* clear pos A */
        writel(pattern, addr);        /* pattern to pos B */
        writel(0x0, addr + 4);        /* remove pattern off the bus */
        val1 = readl(addr + 0x400);    /* get pos A value */
        val2 = readl(addr);        /* get val2 */

        if ((val1 != 0) || (val2 != pattern))    /* see if pos A val changed */
            return 0;
        else
            return 1;
    }

    And mem_ok() return 0, so I doubt  that the address 256M~512M RAM is not configured correctly.

    I also checked init DDR codes in config_3430sdram_ddr() in x-loader, I did not find the problem.

    So Could you test the RAM with mem_ok() on your BeagleBoard xM?

    Thanks!