Quantcast
Channel: Processors forum - Recent Threads
Viewing all articles
Browse latest Browse all 17527

[ am1707 evm, UBL ] No magic number found

$
0
0

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.

 

7Set 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



Viewing all articles
Browse latest Browse all 17527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>