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.

OMAPL138 problem with serial flashing utility for SPI Flash on the experimenter board

Other Parts Discussed in Thread: OMAPL138, OMAP-L138

I followed the instructions in http://wiki.davincidsp.com/index.php/Serial_Boot_and_Flash_Loading_Utility_for_OMAP-L138 to flash the SPI flash on the OMAPL138 experimenter board. I tried flashing the default UBL and U-Boot bin files that we get from TI.

I used the following command

sfh_OMAP-L138.exe -flash <ubl bin file> <u-boot bin file> -p COM4

I set the S7 switch to boot from UART2 i.e. switched 1-6 off and 7 and 8 on

 

I get the message

Interfacing to the OMAP-L138 via UART failed.
Please reset or power-cycle the board and try again...

Unhandled Exception: System.IO.IOException: The I/O operation has been aborted
ecause of either a thread exit or an application request.

   at System.IO.Ports.InternalResources.WinIOError(Int32 errorCode, String str)
   at System.IO.Ports.SerialStream.Dispose(Boolean disposing)
   at System.IO.Ports.SerialStream.Finalize()

 

Please help. I havent set up a linux environment to re-build the flash utility. I am just using the pre-build sfh__OMAP-L138.exe program

  • 1. Please make sure you have the latest version of the .NET Framework installed (at least version 3.5)

    2. Can you print out the entire console log from the moment you run the sfh exe?

    3. Are you using a USB to serial port adapter or a built in serial port on the PC?

    4. Try running on another PC.

    Jeff

  • I went to my C:\WINDOWS\Microsoft.NET\Framework directory and I see three directorires v1.0.3705, v1.1.4322 and v2.0.50727. So I guess I mustl try and install 3.5. Will it be sufficient to just install the latest 3.5 .NET framework, or do I have reconfigure the program in anyway?

  • I have not yet upgraded to 3.6 but with the above .NET frameworks installed following is the detailed console output that I get


    C:\Documents and Settings\ajjosep9\papers\OMAP\OMAP-L138_FlashAndBootUtils_2_2
    OMAP-L138\GNU>sfh_OMAP-L138.exe -p COM4 -flash ubl_OMAPL138_SPI_MEM.bin u-boot
    in
    -----------------------------------------------------
       TI Serial Flasher Host Program for OMAP-L138
       (C) 2010, Texas Instruments, Inc.
       Ver. 1.67
    -----------------------------------------------------


          [TYPE] UBL and application image
           [UBL] ubl_OMAPL138_SPI_MEM.bin
     [APP IMAGE] u-boot.bin
        [DEVICE] SPI_MEM

    Attempting to connect to device COM4...
    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): Read invalid BOOTME string.
    (AIS Parse): Boot aborted.
    Booting SFT failed. Trying again (you may need to reset the target)...
    (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): Read invalid BOOTME string.
    (AIS Parse): Boot aborted.
    Booting SFT failed. Trying again (you may need to reset the target)...
    (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): Read invalid BOOTME string.
    (AIS Parse): Boot aborted.
    Booting SFT failed. Trying again (you may need to reset the target)...
    (AIS Parse): Read magic word 0x41504954.
    (AIS Parse): Waiting for BOOTME... (power on or reset target now)
    (Serial Port): Read error! (The I/O operation has been aborted because of eith
     a thread exit or an application request.
    )
    (AIS Parse): Read invalid BOOTME string.
    (AIS Parse): Boot aborted.
    Booting SFT failed. Trying again (you may need to reset the target)...
    (AIS Parse): Read magic word 0x41504954.
    (AIS Parse): Waiting for BOOTME... (power on or reset target now)
    The I/O operation has been aborted because of either a thread exit or an appli
    tion request.

     

    Interfacing to the OMAP-L138 via UART failed.
    Please reset or power-cycle the board and try again...

    Unhandled Exception: System.IO.IOException: The I/O operation has been aborted
    ecause of either a thread exit or an application request.

       at System.IO.Ports.InternalResources.WinIOError(Int32 errorCode, String str
       at System.IO.Ports.SerialStream.Dispose(Boolean disposing)
       at System.IO.Ports.SerialStream.Finalize()

  • Can you open Hyperterminal or another serial port program and see the output when you reset the EVM? It should say "BOOTME". Are you seeing this?

    Jeff

  • Good point - I set the pins 7 and 8 of S7 on the experimenter board to ON and all other switches to off. I reset the board and dont see anything on the COM port. I am using a USB-RS232 converter. I know this works becoz I see U-Boot prompt when booted from SPI flash.

  • If you can't see the BOOTME in hypterterminal, then the serial flasher will not work.

    Make sure you've set the baud rate to 115200, and that you are sure your USB-RS232 converter is on COM4. Try selecting other COM ports until you see BOOTME. You might want to try a different type of serial cable as well (NULL Modem).

    Jeff

  • I know my setup cables, hyperterminal etc is correct because when I boot from the SPI flash I see the U-Boot prompy and information coming out of the board. Jujst when I change the switch to boot from UART that I do not see BOOTME>

  • Set the boot switches to UART and reset the board. Then connect to CCS and read the BOOTCFG register and verify the bootmode is the appropriate UART. If it is, try probing the UART_TX pin after reset to see if it toggles at all or not.

    Jeff

  • When I set the switches for UART2 Boot Mode i.e. S7:8 is ON and S7:7 is ON and all other pins off the BOOTCFG reads 0x4 similarly for UART0 mode it reads 0x6

    So it does not read 0x14 and 0x16 as expected. This might be the problem. Looking at the board schematic at first glance looks like this should work though.

  • When S7:8 is on, BOOT[4] should be pulled up by R149. Please verify that both pins 8 and 9 of S7 are high when the switch S7:8 is on. If not, try checking R149 to make sure it is populated.

    Jeff

  • Yes both pins 8 and 9 of S7 are high when S7:8 is ON. - But the BOOTCFG register does not read 0x16 or 0x14 only read 0x4 and 0x6

  • Try probing the net closer to the actual device. Look at "uP_VPIF_DOUT12" on the SOM schematic.

    You can probe it at the following places:

    R124
    R163
    J3: Pin 4
    J1: Pin 9

    If it is not high at these places, you may have a short or bad connection from the baseboard to the SOM.

    Jeff

  • I found that the S7 switch had a loose solder joint in pin 8 . Once that was fixed I started getting the BOOTME message when set to boot from UART2 mode.

    I then used the uart loader program sfh_OMAP-L138.exe and updated the ubl and u-boot but after doing this, the bootloader does not come up anymore. I also ran the spi-flashwriter program and that says

    SF: Unsupported STMicro ID 00

    Serial Flash not detected.

    But the uart loader seems to be able to load the UBL and U-boot but something gets messed up after that. Before this happened I was able to flash the load using the mulator and the spi-flashwriter program.

  • Just to clarify, you ran the serial flasher and it wrote and verified the write successfully, correct?

    Please make sure you are using the UBL called "ubl_OMAPL138_SPI_MEM.bin" found in the GNU\ubl directory of the serial flasher tool. The UBL from the spi-flashwriter is not compatible with the serial flasher.

    Jeff

  • Thanks that fixes that issue.

    But can you please explain why this incompatibilty or point me to the appropriate documentation. I would like to technically build from CCSv4, use AISGEN to create the ais file and then use the serial flasher if possible. The spi-flashwriter is very slow on the XDS100v2. Also even though I corrupted the boot loader I am surprised that spi-flashwriter is unable to recognize the SPI Flash - I boot with emulation mode and I should be able to read the SPI flash yes

  • You have to run the gel file first which sets up the SPI peripheral and sets the correct pinmuxing for the spi-flashwriter to work.

    The UBLs are incompatible because the serial flasher uses a different header format for the target program than the spi-flashwriter. If you build from CCSv4, you will have to modify the program to write the same header and magic number as the serial flasher. The source code for the serial flasher is available so you shouldn't have a problem making the changes.

    Jeff

  • Thanks Jeff. I think that puts to bed the flash loader issue completely.

    the only issue remaining for me then is that the XDS100v2 is very flaky when connecting to the ARM. Sometimes it works for quite a while. If I disconnect the emulator USB then try again I get the following error

    Error connecting to the target:

    Error 0x80002240/-150

    Fatal Error during: Register, Initialization, OCS

     

    This stays for quite a while - a computer restart fixes this. Sometimes connecting and disconnecting multiple times with both fixed at 1MHz clocking and adpative clocking fixes. Any suggestions on this will be greatly appreciated.

    Once again thanks for helping out with the loading issue.

  • You should always disconnect from both the ARM and DSP in CCS  before unplugging the emulator. Otherwise bad things like this can occur.

    Jeff

  • Actually in all my experiments I only tried connecting to the ARM. Very frustrating.