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.

rom image generation

Other Parts Discussed in Thread: OMAP-L137

Hi,

Can someone explain me step by step how to generate a binary file suitable to be used as a flat binary in RAM ?

I would like to get an output of only one section mixing code&data to produce a one section AIS file at the end using HexAIS program. ( this AIS is to be called by a secondary bootloader UBL that copies it to RAM before giving it the hand.)

 

At the momment I still get 3 sections in the AIS image at the end of the process...

 

I tried to do this in my linker file :

--absolute_exe
--rom_model
--fill_value 0x00000000
-c
-heap  0x1000
-stack 0x1000
--library=rts6740.lib
--map_file sdram.map


MEMORY
{
   L1D            (RX)  : origin = 0x00F00000          length = 0x00008000
   L1P            (RX)  : origin = 0x00E00000          length = 0x00008000
   L2             (RWX) : origin = 0x00800000          length = 0x00040000
   SHARED         (RWX) : origin = 0x80000000          length = 0x00020000
   APP_SDRAM      (RWX) : origin = 0xC0000000          length = 0x00100000
   FREE_SDRAM     (RW)  : origin = 0xC1000000          length = 0xC4000000
}

SECTIONS
{
    .text   >       SHARED
    .const  >       SHARED
    .data   >       SHARED
    .bss    >       SHARED
    .cinit  >       SHARED
    .pinit  >       SHARED
    .stack  >       SHARED
    .far    >       SHARED
    .sysmem >       SHARED
    .switch >       SHARED
    .cio    >       SHARED
}

Best regards,

Frederic

 

This are the settings used for the AIS generation

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

; General settings that can be overwritten in the host code
; that calls the AISGen library.
[General]

; Can be 8 or 16 - used in emifa
busWidth=8           

; EMIFA,NONE
; EMIFA required for NOR boot modes, along with busWidth field
BootMode=none

; NO_CRC,SECTION_CRC,SINGLE_CRC
crcCheckType=NO_CRC


[INPUTFILE]
FILENAME=sdram.out
USEENTRYPOINT=Set


; Enable sequential read mode for boot modes that support it.
; Does not impact boot modes that don't use it.
[AIS_SeqReadEnable]


; No Params required - simply include this section for the fast boot function to be called
;[FASTBOOT]

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

 

This is the AIS file generated :

 

// Generated by aisparse v1.14

const unsigned int nvram_image[] = {

/* 0x00000000 */ 0x41504954, // MAGIC

/* 0x00000004 */ 0x58535901, // Section Load
/* 0x00000008 */ 0x00800000, //   Address (DSP L2 RAM, Local)
/* 0x0000000C */ 0x000065C0, //   Size
/* 0x00000010 */             //   Data
/* 0x00000010 */ 0x257725F7,
/* 0x00000014 */ 0x95779677,
/* 0x00000018 */ 0x86778777,
/* 0x0000001C */ 0xC2460647,
/* 0x00000020 */ 0x100C8813,
/* 0x00000024 */ 0x01BCD4F7,

.........................

* 0x000065C0 */ 0x00000000,
/* 0x000065C4 */ 0x00000000,
/* 0x000065C8 */ 0x00000000,
/* 0x000065CC */ 0x00000000,

/* 0x000065D0 */ 0x58535901, // Section Load
/* 0x000065D4 */ 0x00808930, //   Address (DSP L2 RAM, Local)
/* 0x000065D8 */ 0x00000284, //   Size
/* 0x000065DC */             //   Data
/* 0x000065DC */ 0x46494D45,
/* 0x000065E0 */ 0x6E492042,
/* 0x000065E4 */ 0x61697469,

.........................

/* 0x00006854 */ 0x41393837,
/* 0x00006858 */ 0x45444342,
/* 0x0000685C */ 0x00250046,

/* 0x00006860 */ 0x58535901, // Section Load
/* 0x00006864 */ 0x00808BB8, //   Address (DSP L2 RAM, Local)
/* 0x00006868 */ 0x00000194, //   Size
/* 0x0000686C */             //   Data
/* 0x0000686C */ 0x00000048,
/* 0x00006870 */ 0x008085C0,
/* 0x00006874 */ 0x00000000,

.........................

/* 0x000069F4 */ 0x00000000,
/* 0x000069F8 */ 0x00000000,
/* 0x000069FC */ 0x00000000,

/* 0x00006A00 */ 0x58535963, // Sequential Read Enable

/* 0x00006A04 */ 0x58535906, // Jump N Close
/* 0x00006A08 */ 0x008060C0, //   Address (DSP L2 RAM, Local)

};

  • I tried this approach using hex6x :

     

    hex6x sdram2bin.cmd

    Translating ../bin/Debug/sdram.out to Binary format...
       "../bin/Debug/sdram.out"   ==> .text         (BOOT LOAD)
       "../bin/Debug/sdram.out"   ==> .cinit        (BOOT LOAD)
       "../bin/Debug/sdram.out"   ==> .const        (BOOT LOAD)

    Then I get a binary file at the end of 128k but I suspect there are still 3 sections.

    I am unsure the second level bootloader can handle this correctly.

    I will have a try.

    Frederic

     

    This is the content of sdram2bin.cmd :

    ../bin/Debug/sdram.out

    -b
    -boot
    -image
    -zero
    -memwidth 8
    -linkerfill
    -fill 0x00000000
    -e=0x80000000

    ROMS
    {
      SHARED: org = 0x80000000, len=0x00020000
    }

  • In spru186t.pdf it is written

    "The hex conversion utility supports the second level bootloader by automatically building the boot table."

    But the Hex file produced begins in my case by :

    00 00 00 80 c0 65 00 00 00 00 80 00 f7 25 77 25 77 96 77 95 77 87 77 86 47 06 46 c2 13 88 0c 10 f7 d4 bc 01 c7 26 c6 e2 a0 00 e0 e9 d8 0f 10 00 90 4c 00 c0 10 84 0c d0 06 94 86 b4 6e 2c 6e 0c 63 01 88 01 00 00 00 00 00 02 00 e3 a6 06 4e 02 56 83 c7 93 93 02 d6 63 f9 8f 94 02 29 00 02 0f a2 09 12 02 a1 89 16 02 2f 00 e0 e0 92 44 00 c0 a1 8c

    There is no AI magic word in the first bytes...

    So my understanding is to give this binary to hexais_omap-l137 to produce an AIS file...

    But it fails :


    HexAIS_OMAP-L137.exe -entrypoint 0x8000000 -ini entrymini.ini sdram.b0

    -----------------------------------------------------
       TI AIS Hex File Generator for OMAP-L137
       (C) 2010, Texas Instruments, Inc.
       Ver. 1.23
    -----------------------------------------------------


    Begining the AIS file generation.
    AIS file being generated for bootmode: NONE.
    ERROR: Not a valid object file.
    AIS file generation was successful.
    Wrote 16 bytes to file sdram.bin.
    Conversion is complete

  •  

    My mistake...

     

    It seems that Serial Flasher Target encapsulates the binary file in AIS format correctly. No need of hexais in the process anymore...

    The Bootloader handles the AIS file correctly. Copies the binary file in RAM. But nothing more happens.

     

    Hum , something wrong with the binary file generation process ?

    I will have a look tomorrow...

  • Hi,

    I finally got it working.

     

    At the momment I am still looking for the address of the entry point in the .map file.

    I need to add the right option to set the entry point at 0xc1000000 for instance.

    If someone knows....

     

    UBL is using first 16MB of SDRAM for nothing... but if you overwrite 0xc0000000 up to 0xc1000000, UBL can't jump to the entrypoint.

     

    I put all DSP\BIOS sections to SDRAM at 0xc1000000.

     

    my linker file is:

     

    myapp.out

    -b
    -image
    -zero
    -memwidth 8
    -linkerfill
    -fill=0x00000000

    ROMS
    {
      SDRAM: org = 0xC1000000, len=0x00040000
    }

    my cmd file for hex6x.exe :

     

    gpiosample.out

    -b
    -image
    -zero
    -memwidth 8
    -linkerfill
    -fill=0x00000000

    ROMS
    {
      SDRAM: org = 0xC1000000, len=0x00040000
    }

    Then I use SFH of the FlashAndBootUtils like that :

     

    sfh_omap-l137 -p COM1 -targetType C6747 -flashType NOR -appLoadAddr 0xC1000000 -appStartAddr 0xC10296D0 -flash UBL_NOR_C6747.bin myapp.bin