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.

[OMAP-L138] UBL seems not to load after written to flash

Other Parts Discussed in Thread: OMAP-L138, OMAPL138

We are using a custom board and have demonstrated using CCS4 in debug mode that we can run the ARM UBL (armubl) that comes with the 03.20.00.13 release of the PSP.

However, when I try to flash that UBL using "sfh_OMAP-L138.exe" I cannot get the board to execute after transitioning tp SPI1 bootmode.

Also, I've also tried using the pre-built images that came with the PSP and they too generated the same outcome.

I suspect that it has something to do with having the OMAP-L138 retrieve the UBL from flash and loading it to memory.

I am also confused if I need to load some initial UBL in the DSP core since according to this post the DSP UBL will access the ARM UBL from flash and load it to RAM. But I did not have any steps from "OMAPL138 Software Developers Guide" that indicates I have to load the DSP UBL in the DSP.

I hope this can be clarified.

 

For your reference, below is the screen dump of the output of the sfh_OMAP-L138.exe.

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

C:\ sfh_OMAP-L138.exe -p COM6 -flash arm-ubl-spi.bin u-boot-da850-omapl138-evm.bin
-----------------------------------------------------
   TI Serial Flasher Host Program for OMAP-L138
   (C) 2010, Texas Instruments, Inc.
   Ver. 1.67
-----------------------------------------------------


      [TYPE] UBL and application image
       [UBL] arm-ubl-spi.bin
 [APP IMAGE] u-boot-da850-omapl138-evm.bin
    [TARGET] OMAPL138
    [DEVICE] SPI_MEM

Attempting to connect to device COM6...
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 8656-Byte section to address 0x80000000.
(AIS Parse): Processing command 1: 0x58535901.
(AIS Parse): Performing Opcode Sync...
(AIS Parse): Loading section...
(AIS Parse): Loaded 768-Byte section to address 0x800021D0.
(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...

Flashing UBL arm-ubl-spi.bin (8820 bytes) at 0x00000000

 100% [ ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ ]
                  Image data transmitted over UART.

 100% [ ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ ]
                       UBL programming complete


Flashing application u-boot-da850-omapl138-evm.bin (171548 bytes) at 0x00010000

 100% [ ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ ]
                  Image data transmitted over UART.

 100% [ ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ ]
                   Application programming complete


Operation completed successfully.

 

 

  • Can you let me know which version of the serial flasher package you downloaded? Does anything show up on the UART terminal after booting?

    You should also try flashing the UBL that comes with the serial flasher, found in the /GNU/UBL directory. Let me know if that one works.

    Also use this debug gel file to see where the PC is and if there are any errors in the boot loader:

    http://processors.wiki.ti.com/index.php/OMAP-L1x_Debug_Gel_Files

    Jeff

  • I'm using OMAP-L138_FlashAndBootUtils_2_29.

    I've tried what you suggested and issues this command from .\OMAP-L138\GNU of the serial flash package:

    sfh_OMAP-L138.exe -p COM6 -flash ubl\ubl_OMAPL138_SPI_MEM.bin u-boot-da850-omapl138-evm.bin

    The output is still the same as indicated above.

    When I tried using the GEL file you provided it generated the output below:

    Also, when I run the GEL file I assume that I need to launch the target configuration and then connect to the device right?

    ARM9_0: Output: ---------------------------------------------
    ARM9_0: Output: |               BOOTROM Info                |
    ARM9_0: Output: ---------------------------------------------
    ARM9_0: Output: ROM ID: d800k004 
    ARM9_0: Output: Silicon Revision 1.1
    ARM9_0: Output: Boot Mode: SPI1 Flash
    ARM9_0: Output:  ROM Status Code: 0x00000009  Description:
    ARM9_0: Output: Invalid AIS keyword
    ARM9_0: Output:  Program Counter (PC) = 0xFFFD397C

    ARM9_0: Output:  ---------------------------------------------
    ARM9_0: Output: |             Device Information            |
    ARM9_0: Output: ---------------------------------------------
    ARM9_0: Output: DEV_INFO_00 = 0x0B7D102F
    ARM9_0: Output: DEV_INFO_01 = 0x00000000
    ARM9_0: Output: DEV_INFO_02 = 0x0000000C
    ARM9_0: Output: DEV_INFO_03 = 0x00000031
    ARM9_0: Output: DEV_INFO_04 = 0x00000000
    ARM9_0: Output: DEV_INFO_05 = 0x000003E0
    ARM9_0: Output: DEV_INFO_06 = 0x00000000
    ARM9_0: Output: DEV_INFO_07-DEV_INFO_08-DEV_INFO_09-DEV_INFO_10-DEV_INFO_11-DEV_INFO_12 = 0-0-6415775-1-28-20
    ARM9_0: Output: DEV_INFO_13,DEV_INFO_14,DEV_INFO_15,DEV_INFO_16 = 1,0,0,7251
    ARM9_0: Output: -----
    ARM9_0: Output: DEV_INFO_17 = 0x00030003
    ARM9_0: Output: DEV_INFO_18 = 0x00000000
    ARM9_0: Output: DEV_INFO_19 =
    ARM9_0: Output: 0
    ARM9_0: Output: 0
    ARM9_0: Output: 0
    ARM9_0: Output: 0
    ARM9_0: Output: 0
    ARM9_0: Output: 
    ARM9_0: Output: -----
    ARM9_0: Output: DEV_INFO_20 = 0x00000000
    ARM9_0: Output: DEV_INFO_21 = 0x00000000
    ARM9_0: Output: DEV_INFO_22 = 0x30303864
    ARM9_0: Output: DEV_INFO_23 = 0x3430306B
    ARM9_0: Output: -----
    ARM9_0: Output: DEV_INFO_24 = 0x0101401C
    ARM9_0: Output: DEV_INFO_25 = 0x0061E59F
    ARM9_0: Output: DEV_INFO_06 = 0x00000000
    ARM9_0: Output: DEV_INFO_26 = 0x38A60001
    ARM9_0: Output:  

  • According to the output, it shows that both images were flashed correctly. However the bootloader is not reading the image correctly when booting.

    The PSP package comes with CCS based flashing utilities. Can you try using these on your board and seeing if those are successful? In the least you could use them to read out the contents of the SPI flash and verify it was written correctly yourself.

    Jeff

  • I just found out the the SPI flash chip we are using (M25P128) has a different sector size (1024) with the flash chip used in the EVM board (M25P64; 256).

    How will this affect the UBL or the flash utility for that matter?

  • i've figured out that the root cause of this issue is the difference in sector size between our flash chip M25P128 and  the EVM flash chip M25P64.

    After changing DEVICE_SPI_MEM_params.blockSize to 256*1024 and DEVICE_SPI_MEM_params.memorySize to 16*1024*1024 I can load the UBL and U-Boot to our custom board.

  • Hi Grant,

    Did you use the serial flash writer (command prompt)  or SFWriter with CCS ?
    If you used the serial flash writer, I wonder if you remember where are the changes and how to build it all ?

    Thanks,

    Ran

  • Hi Ran,

     

    I used the serial flash writer. First thing is you need to download the source code (the one i had is OMAP-L138_FlashAndBootUtils_2_29). I forgot where I exactly got it but ithe link should be in TI's wiki.


    Once you got the source code, you can configure your SPI flash memory settings in Device_spi.c (DEVICE_SPI_MEM_params) in .\Common\Src folder.

    To rebuild you then use cygwin and recompile the whole package by issuing "make all" in .\OMAP-L138\GNU

    that's what I remember I did.

  • hi ,GrantHatamosa:

                  can you tell me how to get  blockSize of  M25P128 ,I can't find any information  from M25P128 datasheet. By the way, In DEVICE_SPI_MEM_params the sectorsize is defined 0 to L138,but In the datasheet  the sectorsize is 1024*256,why is it defined o?Thanks!

  • Hi Etree Zhou,

    The block size is equivalent to the sector size that is described in the M25P128 datasheet.

    The reason for them setting the sector size to zero is that they are using the block size to indicate the sector size if you get what I mean.

    Hope this helps.

    Regards,

    Grant

  • hi GrantHatamosa,

      if the block size means thesectorsize,why your source set the block to 1024*1024 for M25P128.In the M25P128 datasheet the sector size should 1024 pages *256 Bytes.how to get 1024*1024?Thanks! 

  • i just looked at my code and here's what I actually did:

    the original code which uses M24P64 have this  DEVICE_SPI_MEM_params settings:

    const SPI_MEM_ParamsObj DEVICE_SPI_MEM_params = 
    {
    SPI_MEM_TYPE_FLASH,
    24, // addrWidth
    256, // pageSize
    0, // sectorSize
    64*1024, // blockSize
    8*1024*1024 // memorySize
    };
    
    
    Now to be able to support M25P128 I have to change it to this settings:
    const SPI_MEM_ParamsObj DEVICE_SPI_MEM_params = 
    {
    SPI_MEM_TYPE_FLASH,
    24, // addrWidth
    256, // pageSize
    0, // sectorSize
    256*1024, // blockSize
    16*1024*1024 // memorySize
    };
    So as you can see, my previous post was misleading, I actually changed the block size from 64*1024 to 256*1024 and the memory size from 8*1024*1024 to 16*1024*1024.
    Sorry for confusing you guys.
    
    
    Regards,
  • hi,GrantHatamosa

                 Thanks!By the way, Whether change device_spi.h file ,i  think that   original code “ #define  DEVICE_SPI_APP_HDR_OFFSET     (64*1024) ” 64*1024 is  smaller than size of  vector(1024*256).If the code writes uboot- image,the flash will be erased from address o start.