• 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 » Loading code to SPI Flash using OMAPL138
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

    Loading code to SPI Flash using OMAPL138

    This question has suggested answer(s)
    MikeSutton
    Posted by MikeSutton
    on May 14 2012 12:45 PM
    Prodigy30 points

    I'm trying to follow the instructions of the following wiki to program the SPI Flash connected to an OMAPL138 processor on a custom board.  It freezes at at: "Waiting for SFT on the OMAP-L138..."

    http://processors.wiki.ti.com/index.php/Boot_Images_for_OMAP-L138

    We have the SPI Flash connected to SPI1 of the OMAPL138.  The SPI flash we are using is the N25Q128A21.

    Following is the output from the sfh utility (Perhaps it is also worth noting that I get something similar when I just try and erase the flash with the command: sfh_OMAP-L138.exe -erase -p COM5 -v):

    D:\work\tmp\OMAP-L138_FlashAndBootUtils_2_40\OMAP-L138\GNU>sfh_OMAP-L138.exe -flash_noubl -p COM5 -v d:\work\tmp\ais.out
    -----------------------------------------------------
    TI Serial Flasher Host Program for OMAP-L138
    (C) 2012, Texas Instruments, Inc.
    Ver. 1.67
    -----------------------------------------------------


    [TYPE] Single boot image
    [BOOT IMAGE] d:\work\tmp\ais.out
    [TARGET] OMAPL138
    [DEVICE] SPI_MEM
    [SPI Block] 0


    Attempting to connect to device COM5...
    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 9200-Byte section to address 0x80000000.
    (AIS Parse): Processing command 1: 0x58535901.
    (AIS Parse): Performing Opcode Sync...
    (AIS Parse): Loading section...
    (AIS Parse): Loaded 736-Byte section to address 0x800023F0.
    (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-L138...

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • MikeSutton
      Posted by MikeSutton
      on May 14 2012 15:42 PM
      Prodigy30 points

      I'm continuing to work this and thought I'd post a bit of an update.

      1) I was able to boot load my program through the UART using the slh_OMAP-L138.exe program.  So UART stuff seems to be working just fine and AISgen must be working correctly.

      2) I can't even issue a sfh_OMAP-L138.exe -erase command.  Something isn't working correctly when talking to the SPI flash.

      I have been looking around for the code that is running on the OMAPL138 to try and understand what's happening, but I haven't found that code.  Can anyone point me towards that code?  Is that was "u-boot" is?

      Looking at the flash memory we have on the board (N25Q128A21) (here's the datasheet by the way), it says: 

      To program one data byte, two instructions are required: write enable (WREN), which is one
      byte, and a page program (PP) sequence, which consists of four bytes plus data.

      I saw a comment in the Wiki somewhere that I seem to remember saying that by default the SPI writer doesn't perform a write enable.  That's why I'd like to see to the source of the SPI writer so I can figure out exactly what it's trying to do.

      OMAPL138 u-boot
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • MikeSutton
      Posted by MikeSutton
      on May 15 2012 15:52 PM
      Prodigy30 points

      Our custom board does not have any external RAM.  I think the tools might require external RAM to hold the image before it is transferred to the SPI flash.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Christian Riesch
      Posted by Christian Riesch
      on May 16 2012 06:06 AM
      Suggested Answer
      Intellectual480 points

      Hi Mike,

      see http://processors.wiki.ti.com/index.php/Serial_Boot_and_Flash_Loading_Utility_for_OMAP-L138. This wiki page describes where you can get the source code of the flash loader utility and how to build it.

      MikeSutton

      Our custom board does not have any external RAM.  I think the tools might require external RAM to hold the image before it is transferred to the SPI flash.

      Yes, that's correct. The tool (sfh) first loads some code (sft) to the internal RAM of the SoC. This code is then executed, it initializes the external RAM, downloads the firmware image to the external RAM and flashes it to the flash memory from there (see the code in Common/sft/src/*.c). Usually only small modifications to the sft are required for custom boards (e.g. I had to change the initialization of the DDR memory controller since I use DDR2 memory instead of mobile DDR). These changes are also described on the wiki page. But as you don't have any external RAM, you'll have to do larger modifications, probably you'll have to download the firmware image in smaller chunks that fit into the internal SRAM...? Regards, Christian

      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