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.

OMAP4460 USBBOOT waiting for device

Hi,

I have a board that has an OMAP4460 and I would like to use the usbboot utility to reflash the MMC.  What target configuration is necessary in order for usbboot to find the device?  I have built and run usbboot and I get the message "waiting for OMAP44xx device".  Does the target need to have it's HW pins configured to boot from USB?  Or does there need to be an application that launches on the target prior to this?  How does the connection work? 

Unfortunately, I do not have the opportunity to change the HW pins and they are not configured to boot from USB.  If that is necessary to use usbboot, is there another way to download an image over usb and reflash?

Thank you,

Peter

  • Peter McClone said:

    I have a board that has an OMAP4460 and I would like to use the usbboot utility to reflash the MMC.  What target configuration is necessary in order for usbboot to find the device?  I have built and run usbboot and I get the message "waiting for OMAP44xx device".  Does the target need to have it's HW pins configured to boot from USB?  Or does there need to be an application that launches on the target prior to this?  How does the connection work? 

    Yes, the OMAP44xx needs to be configured to boot in Peripheral boot mode, specifically enabling USB.  This is done via hardware configuration pins as you referenced.

    http://omappedia.org/wiki/Omapboot

    Peter McClone said:

    Unfortunately, I do not have the opportunity to change the HW pins and they are not configured to boot from USB.  If that is necessary to use usbboot, is there another way to download an image over usb and reflash?

    This sounds like custom target hardware that you are using.  You will need to describe what interfaces you have available in order to help answer this question.  What is the bootmode configuration, if fixed?

  • Brandon, thanks for the reply.  Yes, this is a custom board.  It is set to boot from UART, then MMC.  Unfortunately, post factory, I only have access to the OTG port.  I do not have access to the UART or MMC.  The unit is running android.

  • Then it seems that the provider of this board, running Android, needs to provide the provisions in the Android environment for reprogramming or image updates over the available interface.

    I don't see a way out of this unless you can get access to these other interfaces and set the boot mode.

  • Thanks Brandon.  Unfortunately, the provider of this board is not capable of doing this.  My current plan is to set the software boot configuration in SAR RAM to boot from USB and cause a warm reset.  If anyone has an example of setting up the proper software boot configuration structure, please let me know.  I'm reading the technical reference manual and hoping I'm not missing anything.  Thanks.

    Peter

  • I've managed to setup the software booting configuration with the following:

            // Store address of booting configuration structure
            __raw_writel(PUBLIC_SW_BOOT_CFG_ADDR+0xA0, PUBLIC_SW_BOOT_CFG_ADDR);
     
            // Header of booting config
            __raw_writel(0xCF00AA01, PUBLIC_SW_BOOT_CFG_ADDR + 0xA0);
            // Size of booting config
            __raw_writel(0xC, PUBLIC_SW_BOOT_CFG_ADDR + 0xA4);
            // First booting device is 0x43 (UART)
            __raw_writel(0x00060000, PUBLIC_SW_BOOT_CFG_ADDR + 0xA8);
            // Second is 0x47, third is 0x45 (USB(2), USB(1))
            __raw_writel(0x00990047, PUBLIC_SW_BOOT_CFG_ADDR + 0xAC);
            // Fourth is 0x46 (USB-ULPI)
            __raw_writel(0x00000005, PUBLIC_SW_BOOT_CFG_ADDR + 0xB0);
            // SW Reset
            writel(readl(PRM_RSTCTL) | (0x01), PRM_RSTCTL);

    Then, using usbboot, I am able to detect the device and download a 2ndstage bootloader.  Similar to a lot of other posts on this forum, I am now stuck at "Waiting for 2nd stage response".  I've looked over the other posts and tried the suggestions, but seem stuck trying to read from USB and no data comes.  It seems that this symptom is usually due to a flaw in the building of the bootloader, so here is what I am doing:

    1. Got code from git://git.omapzoom.org/repo/omapboot.git

    2. Built with the command make CROSS_COMPILE=<path>/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin.arm-eabi ARCH=arm MACH=omap4 BOARD=blaze

    I'd appreciate any suggestions on debugging this further.  Thank you.

  • Had you tried this other post?

    http://e2e.ti.com/support/omap/f/885/p/284030/1016095.aspx#1016095

    it is for OMAP5 but it is something to try.

  • Thanks for the suggestion Manuel.  I have tried that with sleep times of 1,2, 20 and 200.  None of them worked.  Any idea what an appropriate wait time would be for an OMAP4 vs OMAP5?

  • Reviewing the steps there are some differences,

    1. download code, I am using OMAP5 from next link

    http://omapedia.org/wiki/Panda5AJ.1.5_Release_Notes

    UsbBoot Sources

    cd ${YOUR_PATH}
    git clone git://git.omapzoom.org/repo/omapboot.git usbboot
    cd usbboot
    git checkout 33af7cb409b603cf7988306ab2ea70f052a9a02b
    

    2. git checkout e3a6f4932138f82aa0972ffb5088925a9a63e741

    This commitID is the last one got using gitk --all, I think it could be latest commitID but it could be affected by the selected branch, it worked this way.

    3. In the build instructions it says to use compiler from prebuild directory in Android but I forgot to include that line and the value assigned to the export is the default from other builds that points to

    export CROSS_COMPILE=/home/x0056183/bin/arm-2010q1/bin/arm-none-linux-gnueabi-

    I think it should not affect,

    4. then the added value to 5,

    git diff
    diff --git a/host/tools/usbboot.c b/host/tools/usbboot.c
    index 0c82ef2..156bbf8 100644
    --- a/host/tools/usbboot.c
    +++ b/host/tools/usbboot.c
    @@ -103,6 +103,7 @@ static int usb_boot(usb_handle *usb, int fastboot_mode,
     
            if ((data2) || (fastboot_mode > 0)) {
                    fprintf(stderr,"waiting for 2ndstage response...\n");
    +sleep(5);
                    usb_read(usb, &msg_size, sizeof(msg_size));
                    if (msg_size != 0xaabbccdd) {
                            fprintf(stderr, "unexpected 2ndstage response\n");

    5. and the make command that I used is

    make ARCH=arm  BOARD=omap5uevm MACH=omap5

    it has added the ARCH=arm, the other point to check is that MACH=omap5 and omap5uevm has the u before evm.

    I know it is not that correct what I just say because it doesn't have sense the use of some values, but try to use latest commit and use 5 seconds sleep, it should work. I remember that using the commitID from this release was not working it was needed to move to recent or newer commitID, maybe that is the difference.

  • I followed the directions above, except that I built with "make ARCH=arm BOARD=blaze MACH=omap4".  Still waiting for 2nd stage bootloader.  Is there anything about a warm reset that would make this different from a cold reset?  Thanks.

  • I only read the last post before I answered, I remember and read the whole post again, you cannot switch between SYSBOOT configuration then you are using Software booting configuration.

    I need to review the information again and check it again, I thought it was only that USBBOOT was not working but in your case you SYSBOOT configuration cannot be changed.

  • Manuel,

    Are you saying that if the hardware SYSBOOT pins are set a certain way, that I cannot change that boot configuration with the software booting configuration?  The technical reference manual seems to indicate that this is possible, but I haven't gotten it to work yet.  Thanks,

    Peter

  • For what I read you have made what is required for warm reset, and you are doing what is requested in the TRM getting Software boot configuration to work, you are getting the initial boot stage.

    Next I am sharing what I know could be affecting, some points could apply and some other not but they are things to try, and I am not sure what your actual environment is, if you are running Windows and VM and/or what version of Windows are you running in this scheme, or if you are running on a Linux Machine entirely.

    Then for what I read in TRM that should work, but I haven't been able to confirm it because I am not aware of the full process by reading what USBBOOT is doing for the first and second stage code. Thinking about this last statement if there is a reset/reboot required then it would be USBBOOT that handles it, not much information about it but it could be another point to add the Software Boot Configuration if USBBOOT is SYSBOT dependent when reboot/reset.

    I remember to read 2 other posts that could be affecting,

    1. it was a post that suggested to change the number of bytes to wait from 36 to 43, but during the last 2 days i wasn't able to find the post again. It will imply some correction in code to make it work.

    2. and the other posts is about running from inside a Virtual Machine that was not able to get it working unless running USBBOOT out of the Virtual Machine in a Linux environment.

    3. Other consideration is that there when running in Windows 7 it is needed to update the Virtual Machine SW, and in some cases the USBBOOT was not working,

    it could require to configure the ProductID and VendorID for Custom Boards or Production products:

    http://source.android.com/source/initializing.html#configuring-usb-access

    I remember one issue where a Custom Board needed to configure it's own ProductID and VendorID but I didn't work directly in this issue, but you should be able to find information about it in the TRM's USB section.

    or in other cases updating the VM worked, but mostly trying it without VM using a Native Linux installation or LiveCD.

    Tor next stage for Fasboot I found next 2 patches that I don't know it it applies in your case or not, but I sharing them in case you needed then for fastboot script.

    http://review.omapzoom.org/#/c/19818/
    http://review.omapzoom.org/#/c/21064/

    If you can specify a little more about your actual development environment it will be great(OMAP4430 or OMAP4460, and is based in Tablet or Blaze, and if possible if you try same changes in Tablet or Blaze does it work? ). From my side I would need to know in what file you wrote the Software Boot Configuration changes you shared in order to try to reproduce the issue you are seeing.

  • I'm using Ubuntu 10.04 LTS as the host (not a virtual machine) and my target is OMAP4460.  I added code to the end of the cpu_init() function in /x-loader/cpu/omap4/cpu.c to cause the soft reset.  Also, I have tried building usbboot in both the blaze and blaze_tablet configurations.  Thanks for the help.  I will see if I can find where to change the number of bytes to wait for from 36 to 43.

    Peter

  • I was not able to fix the issue and I will not be able to answer more question for some time.

    But I found that with next modification it worked the first time I ran USBBOOT in the Blaze, for the second time that I tried it it didn't work.

    diff --git a/cpu/omap4/cpu.c b/cpu/omap4/cpu.c
    index 99a3316..2b066fb 100644
    --- a/cpu/omap4/cpu.c
    +++ b/cpu/omap4/cpu.c
    @@ -112,6 +112,17 @@ int cpu_init (void)
                            __raw_writel(0x000001c0, SYSCTRL_PADCONF_CORE_EFUSE_1);
            }
     
    +#define PUBLIC_SW_BOOT_CFG_ADDR 0x4A326A00
    +#define PRM_RSTCTL 0x4A307B00
    +
    +    __raw_writel(PUBLIC_SW_BOOT_CFG_ADDR+0xA0, PUBLIC_SW_BOOT_CFG_ADDR);
    +    __raw_writel(0xCF00AA01, PUBLIC_SW_BOOT_CFG_ADDR + 0xA0);
    +    __raw_writel(0xC, PUBLIC_SW_BOOT_CFG_ADDR + 0xA4);
    +    __raw_writel(0x00470000, PUBLIC_SW_BOOT_CFG_ADDR + 0xA8);
    +    __raw_writel(0x00050045, PUBLIC_SW_BOOT_CFG_ADDR + 0xAC);
    +    __raw_writel(0x00000099, PUBLIC_SW_BOOT_CFG_ADDR + 0xB0);
    +    writel(readl(PRM_RSTCTL) | (0x01), PRM_RSTCTL);
    +
            return 0;
     }

    then by tracing back it results that the boot device is being detected as 47 when it should be 45. This is terminal's output with some prints from boot_common.c and misc.c,

    Texas Instruments Inc Bootloader 1.1.0-ge3a6f493-dirty

    Build Info: Oct 2 2013 - 13:30:35

    pmic-enabled

    Configure the pbias

    pbias-configured

    bootdevice 1 47

    bootdevice 2 47

    bootdevice 3 47

    DEVICE_USB 45 DEVICE_EMMC 6 DEVICE_SDCARD 5 DEVICE_SATA: 0

    sram: wboot device: USB

    Unable to set flash slot: 71

    Unable to init storage

    boot failed

    the prints are next ones.

    diff --git a/boot_common.c b/boot_common.c
    index 07744bb..4389dab 100644
    --- a/boot_common.c
    +++ b/boot_common.c
    @@ -143,7 +143,7 @@ struct bootloader_ops *boot_common(unsigned bootdevice)
                            goto fail;
            } else
                    goto fail;
    -
    +printf("bootdevice 1 %x\n",bootdevice);
            if (bootdevice == DEVICE_USB) {
     
                    bootdevice = boot_ops->board_ops->board_get_flash_slot();
    @@ -155,12 +155,14 @@ struct bootloader_ops *boot_common(unsigned bootdevice)
                    }
            }
     
    +printf("bootdevice 2 %x\n",bootdevice);
            if (!boot_ops->board_ops->board_get_flash_slot ||
                            !boot_ops->board_ops->board_set_flash_slot)
                    goto fail;
     
    +printf("bootdevice 3 %x\n",bootdevice);
            dev_to_devstr(bootdevice, buf);
    -       printf("sram: boot device: %s\n", buf);
    +       printf("sram: wboot device: %s\n", buf);
     
            boot_ops->storage_ops = boot_ops->board_ops->board_set_flash_slot
                            (bootdevice, boot_ops->proc_ops, boot_ops->storage_ops);

    but from rom_peripheral.h the value should be


    /* Peripheral device list */
    #define DEVICE_NULL    0x40
    #define DEVICE_UART1    0x41
    #define DEVICE_UART2    0x42
    #define DEVICE_UART3    0x43
    #define DEVICE_UART4    0x44
    #define DEVICE_USB        0x45
    #define DEVICE_USBEXT    0x46

    I tried modifying the return value from unknown to USB but it only worked one time, then from the function


    struct bootloader_ops *boot_common(unsigned bootdevice)

    it is needed to traceback why next code is returning incorrect value


        if (bootdevice == DEVICE_USB) {

            bootdevice = boot_ops->board_ops->board_get_flash_slot();
            ret = boot_ops->usb_ops->usb_open(boot_ops->usb_ops->usb,
                        NO_INIT_USB, boot_ops->proc_ops);
            if (ret != 0) {
                printf("\nusb_open failed\n");
                goto fail;
            }
        }

    I will not be able to help you from this point, sorry.

  • It appears the changing the boot configuration to 0x45 as you mentioned did the trick.  I'm now one step closer.  I am able to use usbboot to download aboot.bin and a u-boot.bin.  Now I am struggling to get fastboot to format the SD card properly.  Please tell me if I should separate this into another post, but here's the symptom I am having now.

    The device goes into fastboot mode, but executing the command "sudo ./fastboot flash xloader ./MLO" fails with the message:

    sudo ./fastboot flash xloader ./MLO
    sending 'xloader' (23 KB)...
    OKAY [  0.006s]
    writing 'xloader'...
    FAILED (remote: partition does not exist)
    finished. total time: 0.010s
    

    Here is the serial output during the whole process.

    [ aboot second-stage loader ]
    
    MSV=00000000
    
    jumping to 0x80e80000...
    
    
    U-Boot 1.1.4-gc2a7c898-dirty (Oct 10 2013 - 09:09:55)
    
    Load address: 0x80e80000
    DRAM:  1024 MB
    Flash:  0 kB
    Using default environment
    
    In:    serial
    Out:   serial
    Err:   serial
    Initializing SD(0) Slot.
    ptbl slot: SD:(0).
    efi partition table not found
    efi partition table:
    ptbl slot: EMMC:(1).
    Read not permitted as Card on SLOT-1 not Initialized
    efi partition table not found
    Net:   KS8851SNL
    Tablet: HOME key pressed: entering fastboot....
    timed out in wait_for_pin: I2C_STAT=0
    I2C read: I/O error
    timed out in wait_for_pin: I2C_STAT=0
    I2C read: I/O error
    Device Serial Number: 01543E2009010014
    Fastboot entered...
    Download Size 0
    Download Size 0
    Starting download of 24484 bytes
    Download Size 24484
    Partition:'<NULL>' does not exist
    Download Size 0
    
    

    The SD card definitely has the boot partition on it, but it is formated FAT16.  The SD card has the following partitions:

    boot - formatted FAT16, 65MB

    rootfs - formatted ext3, 1.87 GB

    data - formatted FAT32, 1.64GB

    My end goal is to keep each of these partitions, but overwrite them with new files.  Thanks.

  • BTW, I forgot to say thank you for all the help getting it to boot from USB.  Thank you Manuel!