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.

DDR Bootloader configuration

Other Parts Discussed in Thread: TMS320C6424

Hello all

I successfully burn dsp image in EVM6424 NOR flash. but when i placed some sections in DDR ( in  .cmd file ) the image not boot at power on ( it's booting normally when all sections placed in IRAM) . It seems that the DDR configuration is missing . could you please help me to solve this issue

I used EVM6424

my bootloader as follow

;            .title  "Flash bootup utility for c6424 EVM"
         ;   .option D,T
          ;  .length 102
          ;  .width  140

COPY_TABLE   .equ    0x42000400
;EMIF_BASE   .equ    0x01E00000 ; address of EMIF registers

            .sect ".boot_load"
            .global _boot

_boot:      
;************************************************************************
;* Debug Loop -  Comment out B for Normal Operation
;************************************************************************

            zero B1
_myloop:  ; [!B1] B _myloop  
            nop  5
_myloopend: nop

;************************************************************************
;* Configure EMIF
;************************************************************************

;        mvkl  emif_values, a3  ; load pointer to emif values
 ;       mvkh  emif_values, a3
        
 ;       mvkl  EMIF_BASE, a4    ; load EMIF base address
;        mvkh  EMIF_BASE, a4

  ;      mvkl  0x0024, b0       ; load number of registers to set
   ;     mvkh  0x0000, b0

;emif_loop:
 ;       ldw   *a3++, b5        ; load register value
  ;      sub   b0,1,b0          ; decrement counter
   ;     nop   2
; [ b0]  b     emif_loop
 ;       stw   b5, *a4++        ; store register value
  ;      nop   4  

;****************************************************************************
;* Copy code sections
;****************************************************************************
        mvkl  COPY_TABLE, a3   ; load table pointer
        mvkh  COPY_TABLE, a3

        ldw   *a3++, b1        ; Load entry point

copy_section_top:
        ldw   *a3++, b0        ; byte count
        ldw   *a3++, a4        ; ram start address
        nop   3

 [!b0]  b copy_done            ; have we copied all sections?
        nop   5

copy_loop:
        ldb   *a3++,b5
        sub   b0,1,b0          ; decrement counter
 [ b0]  b     copy_loop        ; setup branch if not done
 [!b0]  b     copy_section_top
        zero  a1
 [!b0]  and   3,a3,a1
        stb   b5,*a4++
 [!b0]  and   -4,a3,a5         ; round address up to next multiple of 4
 [ a1]  add   4,a5,a3          ; round address up to next multiple of 4

;****************************************************************************
;* Jump to entry point
;****************************************************************************
copy_done:
        b    .S2 b1
        nop   5 

  • Abdalla,

    Where did you get your boot code from? It is incomplete, which you have handled by commenting out the EMIF initialization code.

    When you find the rest of that bootloader, you can uncomment the EMIF init code so the EMIF will work with your DDR2 memory. Or you can look to the EMIF User Guide to find the registers that need to be written and determine their values. Or you can find where the EMIF is setup in the EVM GEL script and copy the values from there. Or you can run some test example that you have used in which the DDR did work as expected, then find the EMIF registers and copy their values into an appropriate table in your assembly code to write those values there.

    Or you may have a different history of this file that will explain all of this much better.

    Regards,
    RandyP
  • Hi Ali,
    In addition to Randy's questions,
    Where did you initialize the DDR ?
    I hope this bootloader code could run via emulator mode but not with flash boot since it needs DDR initialization, DDR initialization can be done by gel file for emulator mode (CCS IDE).
  • Hi
    firstly I added the commented part of the bootloader but still the DDR2 not work , i hanged the emif_values to be compatible with the data sheet . I sew that the address of configured value is not in sequence , should i programe it one by one ? if so how can i run the execute command(0x5853590D) and to which address

    below the modified emif_values
    emif_values:
    .long 0x5853590D ; Function Execute Command
    .long 0x00030000 ; Selects PLL configuration function, with 3 arguments
    .long 0x00000015 ; PLLM value
    .long 0x00000000 ; PLLDIV 0
    .long 0x00000000 ; Clock source
    .long 0x5853590D ; Function Execute Command
    .long 0x00050001 ; Selects EMIFA configuration, with 5 arguments
    .long 0x3FFFFFFC ; AB1CR control register mask
    .long 0x3FFFFFFC ; AB2CR control register mask
    .long 0x3FFFFFFC ; AB3CR control register mask
    .long 0x3FFFFFFC ; AB4CR control register mask
    .long 0x00000000 ; NANDFCR control register mask
    .long 0x5853590D ; Function Execute Command
    .long 0x00090002 ; Selects DDR memory configuration, with 9 arguments
    .long 0x00000017 ; DDR PLLM
    .long 0x00000001 ; DDR CLLK DIV
    .long 0x0000000B ; Reserved
    .long 0x00000000 ; PLL SRC
    .long 0x50006405 ; DDR Control register mask
    .long 0x00138822 ; SDRAM Config register mask
    .long 0x22923209 ; SDRAM Timer 0 register mask
    .long 0x0012c722 ; SDRAM Timer 1 register mask
    .long 0x000004EF ; SDRAM Refresh control register mask
  • Abdalla,

    You are close but you are mixing things up. You need to read and understand the Bootloader Application Note which can be found under the Technical Documents tab of the TMS320C6424 Product Folder.

    The Function Execute Command is supported by the ROM Bootloader (RBL) in the C6424's on-chip ROM when using AIS support. All boot modes are divided into 'non-FASTBOOT' modes and 'FASTBOOT' modes.

    The EMIFA boot mode can be done three different ways. Two ways will just start running from the start of the Flash memory on the EMIFA port (one in non-FASTBOOT and one in FASTBOOT), and all initialization (other than what the RBL mode may select) must be done by your code without further help from the RBL. In these two cases, the Function Execute Command is not available to you.

    The third EMIFA boot mode is in FASTBOOT and will use AIS. This is when the Function Execute Command can be used.

    The Bootloader App Note describes AIS and the tools that can be used to create a boot file. There are a lot of discussions from the past in this forum about AIS booting and the tools, and there are probably some good topics in the TI Wiki Pages to help you learn more.

    Regards,
    RandyP

  • Thank you RandyP

    I used the AIS tool ( attached with this comment) and compare the values of the ini file with GEL file and the Program works properly after power up C642x_FlashAndBootUtils_trunk.zip