• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Digital Signal Processors (DSP) » OMAP™ Processors » OMAP-L13x, AM1x and C674x Processors Forum » [ am1707 evm, UBL ] No magic number found
Share
OMAP™ Processors
  • Forums
  • Announcements
Options
  • Subscribe via RSS
Resources
  • OMAP-L1x DSP+ARM9™-based Processors Product Folder
  • OMAP3525/30 DSP+ARM Cortex™-A8-based SOCs Product Folder

  • Top OMAPL Wiki Links
  • OMAPL3x Schematic Review Checklist
  • OMAPL13x Boot resources

  • OMAPL Document Resources
  • OMAPL137 Technical reference manual
  • OMAPL138 Technical reference manual
  • OMAPL Boot loader App Notes
  • Forums

    [ am1707 evm, UBL ] No magic number found

    This question is not answered
    nzif frunze
    Posted by nzif frunze
    on Aug 29 2011 11:26 AM
    Intellectual370 points

    good day,

    I am currently using AM17x Evaluation Module.

    I want to load UBL and u-boot in serial flash.

    I do the following:


    1. edit UBL source code.

    file: spi_memboot.c

    function: SPI_MEM_BOOT_copy()

    Uint32 SPI_MEM_BOOT_copy()

    {

      SPI_MEM_InfoHandle hSpiMemInfo;

      

      Uint32 currMemAddr = 0;


      DEBUG_printString("Starting SPI Memory Copy...\r\n");

      

      // Do device specific init for SPI 

      DEVICE_SPIInit(DEVICE_SPIBOOT_PERIPHNUM);

      

      // SPI Memory Initialization

      hSpiMemInfo = SPI_MEM_open(DEVICE_SPIBOOT_PERIPHNUM, DEVICE_SPIBOOT_CSNUM, hDEVICE_SPI_config);

      if (hSpiMemInfo == NULL)

        return E_FAIL;

        

      // Read data about Application starting at start of memory and searching

      // at the start of each memory block

      DEBUG_printString("UBL_MAGIC_BINARY_BOOT: ");

      DEBUG_printHexInt(UBL_MAGIC_BINARY_BOOT);

      DEBUG_printString("\r\n");

        

        

      while (currMemAddr < hSpiMemInfo->hMemParams->memorySize)

      {

        currMemAddr += hSpiMemInfo->hMemParams->blockSize;

      

        SPI_MEM_readBytes(hSpiMemInfo, currMemAddr, sizeof(SPI_MEM_BOOT_HeaderObj), (Uint8 *) &gSpiMemBoot);

        

        DEBUG_printString("gSpiMemBoot.magicNum = ");

        DEBUG_printHexInt(gSpiMemBoot.magicNum);

        DEBUG_printString("\r\n");

      

        if (gSpiMemBoot.magicNum == UBL_MAGIC_BINARY_BOOT)

        {

          // Valid magic number found

          DEBUG_printString("Valid magicnum, ");

          DEBUG_printHexInt(gSpiMemBoot.magicNum);

          DEBUG_printString(", found at offset ");

          DEBUG_printHexInt(currMemAddr);

          DEBUG_printString(".\r\n");

          break;

        } 

      }


      if (currMemAddr >= hSpiMemInfo->hMemParams->memorySize)

      {

        DEBUG_printString("No magic number found.\r\n");

        return E_FAIL;

      }

      

      if (SPI_MEM_readBytes(hSpiMemInfo, gSpiMemBoot.memAddress, gSpiMemBoot.appSize, (Uint8 *)gSpiMemBoot.ldAddress) != E_PASS)

      {

        DEBUG_printString("Application image reading failed.\r\n");

        return E_FAIL;

      }

      

      // Application was read correctly, so set entrypoint

      gEntryPoint = gSpiMemBoot.entryPoint;


      return E_PASS;

    } 

     

    2. Build UML and generate from UBL_SPI_MEM.bin the UBL_SPI_MEM.bin with the "AISgen for D800K003" utility

    3. Build u-boot.bin for da830evm_config configuration

    4. Set AM17x Evaluation Module on UART2 BOOT MODE

     

    5. Erase 

    denis@ubuntu:~/Desktop/sdk_1_10_00_01/OMAP-L137_FlashAndBootUtils_2_20/OMAP-L137/GNU$ ./sfh_OMAP-L137.exe -targetType AM1707 -erase

     

    log:

     ./sfh_OMAP-L137.exe -targetType AM1707 -flashType SPI_MEM -erase

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

       TI Serial Flasher Host Program for OMAP-L137

       (C) 2011, Texas Instruments, Inc.

       Ver. 1.67

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



    Platform is Unix/Linux.

          [TYPE] Global erase

        [TARGET] AM1707

        [DEVICE] SPI_MEM


    Attempting to connect to device /dev/ttyS0...

    Press any key to end this program at any time.


    (AIS Parse): Read magic word 0x41504954.

    (AIS Parse): Waiting for BOOTME... (power on or reset target now)

    (AIS Parse): BOOTME received!

    (AIS Parse): Performing Start-Word Sync...

    (AIS Parse): Performing Ping Opcode Sync...

    (AIS Parse): Processing command 0: 0x58535901.

    (AIS Parse): Performing Opcode Sync...

    (AIS Parse): Loading section...

    (AIS Parse): Loaded 7984-Byte section to address 0x80000000.

    (AIS Parse): Processing command 1: 0x58535901.

    (AIS Parse): Performing Opcode Sync...

    (AIS Parse): Loading section...

    (AIS Parse): Loaded 808-Byte section to address 0x80001F30.

    (AIS Parse): Processing command 2: 0x58535906.

    (AIS Parse): Performing Opcode Sync...

    (AIS Parse): Performing jump and close...

    (AIS Parse): AIS complete. Jump to address 0x80000000.

    (AIS Parse): Waiting for DONE...

    (AIS Parse): Boot completed successfully.


    Waiting for SFT on the OMAP-L137...


    Erasing flash

     100% [ ████████████████████████████████████████████████████████████ ]

                                Erase complete                            



    Operation completed successfully.

     


     

    6. Flash UBL and u-boot.bin

    ./sfh_OMAP-L137.exe -targetType AM1707 -flashType SPI_MEM -flash 1 u-boot.bin

       TI Serial Flasher Host Program for OMAP-L137

       (C) 2011, Texas Instruments, Inc.

       Ver. 1.67

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



    Platform is Unix/Linux.

          [TYPE] UBL and application image

           [UBL] 1

     [APP IMAGE] u-boot.bin

        [TARGET] AM1707

        [DEVICE] SPI_MEM


    Attempting to connect to device /dev/ttyS0...

    Press any key to end this program at any time.


    (AIS Parse): Read magic word 0x41504954.

    (AIS Parse): Waiting for BOOTME... (power on or reset target now)

    (Serial Port): Read error! (The operation has timed-out.)

    (AIS Parse): BOOTME received!

    (AIS Parse): Performing Start-Word Sync...

    (AIS Parse): Performing Ping Opcode Sync...

    (AIS Parse): Processing command 0: 0x58535901.

    (AIS Parse): Performing Opcode Sync...

    (AIS Parse): Loading section...

    (AIS Parse): Loaded 7984-Byte section to address 0x80000000.

    (AIS Parse): Processing command 1: 0x58535901.

    (AIS Parse): Performing Opcode Sync...

    (AIS Parse): Loading section...

    (AIS Parse): Loaded 808-Byte section to address 0x80001F30.

    (AIS Parse): Processing command 2: 0x58535906.

    (AIS Parse): Performing Opcode Sync...

    (AIS Parse): Performing jump and close...

    (AIS Parse): AIS complete. Jump to address 0x80000000.

    (AIS Parse): Waiting for DONE...

    (AIS Parse): Boot completed successfully.


    Waiting for SFT on the OMAP-L137...


    Flashing UBL 1 (7652 bytes) at 0x00000000


     100% [ ████████████████████████████████████████████████████████████ ]

                      Image data transmitted over UART.                   


     100% [ ████████████████████████████████████████████████████████████ ]

                           UBL programming complete                       



    Flashing application u-boot.bin (156376 bytes)


     100% [ ████████████████████████████████████████████████████████████ ]

                      Image data transmitted over UART.                   


     100% [ ████████████████████████████████████████████████████████████ ]

                       Application programming complete                   



    Operation completed successfully.

     

    7. Set AM17x Evaluation Module on SPI0 BOOT MODE

    8. run minicom and reset AM17x Evaluation Module

    9. startup log:

    AM1707 initialization passed!

    Booting TI User Boot Loader

            UBL Version: 1.65

            UBL Flashtype: SPI 

    Starting SPI Memory Copy...

    UBL_MAGIC_BINARY_BOOT: 0x55424CBB

    gSpiMemBoot.magicNum = 0xE3500000

    gSpiMemBoot.magicNum = 0xE59F303C

    gSpiMemBoot.magicNum = 0xFFFFFFFF

    gSpiMemBoot.magicNum = 0xFFFFFFFF

    gSpiMemBoot.magicNum = 0xFFFFFFFF

    gSpiMemBoot.magicNum = 0xFFFFFFFF

    gSpiMemBoot.magicNum = 0xFFFFFFFF

    gSpiMemBoot.magicNum = 0xFFFFFFFF

    No magic number found.                                                          

    SPI Memory Boot failed.                                                         

    Aborting...


     

    please help me solve the problems:

    1. correcting start UBL and u-boot

    2. why and what it means for the constants  UBL_MAGIC_BINARY_BOOT and UBL_MAGIC_FINISHED from  ubl.h ?

    3. everything is right I do to flash UBL and u-boot?

     

    Thanks,

    Denis


    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • nzif frunze
      Posted by nzif frunze
      on Aug 29 2011 11:28 AM
      Intellectual370 points

      sorry:

      2. Build UML and generate from UBL_SPI_MEM.out the UBL_SPI_MEM.bin with the "AISgen for D800K003" utility

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • jc-ti
      Posted by jc-ti
      on Sep 02 2011 16:13 PM
      Mastermind27545 points

      Was the code working before you modified, or did you just add additional debug statements?

      I would recommend using the UBL that comes from the PSP package as opposed to the one on the /UBL directory and see if that helps.

      If that still doesn't work, add some additional debug lines to show what SPI block it is reading the gSpiMemBoot.magicNum from. The flashing tool should flash the UBL at block 0 and U-boot at block 1 with the header prepended.

      Jeff

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

      Please click the Verify Answer button on this post if it answers your question.
      ----------------------------------------------------------------------------------------------------------

      Useful Links:
      OMAP-L1x/C674x/AM18x Debug GEL File

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    TI E2E™ Community
    • Support Forums
    • Blogs
    • Videos
    • Groups
    • Site Support & Feedback
    • Settings
    TI E2E™ Community Groups
    • TI University Program
    • Make the Switch
    • Microcontroller Projects
    • Motor Drive & Control
    Other Communities
    • Deyisupport
    • Designsomething.org
    • beagleboard.org
    • TI on Element 14
    • TI on TechXchangeSM
    Other Technical & Support Resources
    • WEBENCH® Design Center
    • Product Information Centers
    • Technical Documents
    • TI Design Network
    • TI Technical Articles
    • TI Training

    All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

    Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

    Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
    TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

    TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
    embedded processors, along with software, tools and the industry’s largest sales/support staff.

    © Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
    Trademarks | Privacy Policy | Terms of Use