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.

some question with boot about 6437 when use the c to boot

hellow to all

              I want to use EMIFA ROM Direct Boot about 6437.when i write the boot code with asm, it is sucess, but when I

use the c instead of asm, it fails. I can not make out, I think it is same the c and the asm.

the EMIF bus is 8bit

the asm is:

CODE_START  .equ    0x10800400            
CODE_SIZE   .equ    0x00004000       
COPY_TABLE  .equ    0x42000400 

            .sect ".boot_load"                                
            .global _boot
            .ref    _c_int00

_boot:      
*************************************************************

            zero B1
_myloop: 
            nop  5
_myloopend: nop

     mvkl  EMIFA_AWCC,B4
    mvkh  EMIFA_AWCC,B4   
          
    mvkl  0x00000380,A4
    mvkh  0x00000380,A4
    stw   A4,*B4

    mvkl  0x01E00010,B4
    mvkh  0x01E00010,B4   
       mvkl  0x0050043C,A4
    mvkh  0x0050043C,A4
    stw   A4,*B4


    mvkl  COPY_TABLE,B4        
    mvkh  COPY_TABLE,B4   
          
    mvkl  CODE_START,A4
    mvkh  CODE_START,A4
    zero  A1
    
_boot_loop1:
    ldb   *B4++,B5       ; flash read
    mvkl  CODE_SIZE,B6 ; B6 = CODE_SIZE -1024
    
    add   1,A1,A1       
    ||    mvkh  CODE_SIZE,B6
    
    cmplt  A1,B6,B0
    nop    
    stb   B5,*A4++
    [B0]  b     _boot_loop1
    nop   5

    mvkl .S2 _c_int00, B0
    mvkh .S2 _c_int00, B0
    B    .S2 B0
    nop   5    

the C is:


extern far void c_int00(void);
#pragma CODE_SECTION (boot,".boot_load");


#define CODE_START      0x10800400     
#define CODE_SIZE       0x00004000        
#define COPY_TABLE      0x42000400  


#define AEMIF_BASE          0x01E00000
#define AWCCR               ( unsigned int* )( 0x01E00004 )  
#define A1CR                ( unsigned int* )( 0x01E00010 )   

void boot(void)
{  
    unsigned  int num_i = 0 ;
 
     *( unsigned int* )( 0x01E00004 ) = 0x00000380;  //AWCCR              
   *( unsigned int* )( 0x01E00010 ) =  0x0050043C;  //EMIF A1CR               

 
 for (num_i = 0; num_i < 0x00004000 ;num_i++ )
      *(unsigned char *)(0x10800400 + num_i)  = *(unsigned char *)(0x42000400 + num_i) ;
      
 c_int00();

}

the CMD is:


-l rts64plus.lib
-l evmdm6437bsl.lib

-stack          0x00000800      /* Stack Size */
-heap           0x00000800      /* Heap Size */

MEMORY
{

    BOOT:       o = 0x10800000  l = 0x00000400
    IRAM:       o = 0x10800400  l = 0x0001FA00
    DDR2:       o = 0x80000000  l = 0x10000000
}

SECTIONS
{
    .boot_load  >   BOOT
    .bss        >   IRAM
    .cinit      >   IRAM
    .cio        >   IRAM
    .const      >   IRAM
    .data       >   IRAM
    .far        >   IRAM
    .stack      >   IRAM
    .switch     >   IRAM
    .sysmem     >   IRAM
    .text       >   IRAM
    .ddr2       >   DDR2    
}

Can you tell me the difference??

  I also want to ask  the code " #pragma CODE_SECTION (boot,".boot_load")"

  when i use this ,the code and the data in fun of "boot"  will all in the the .boot_load??  also the code only???

  • Hi Yong,

    I'm looking into the your both the programs, mean while,

    Some quicky question,

    Have you tried to debug (emulator) the same "c" and "asm" CCS project through CCS ? ie not working when you are booting the code ("c" code)  from flash ?

  • Yong,

    C and asm are not nearly the same. Since you have assembly working, stop. Your project is ready to be bootloaded and you can move on.

    If you are just trying to learn things, then you will want to read the Optimizing C Compiler User Guide, especially the sections on the run-time support. Also, go to the TI Wiki Pages and look for training classes that talk about bootloading. An old archived class for the C6713 can be found by searching the TI Wiki Pages for "c6713 training" (no quotes). You can look through that material to understand more about how the booting process occurs.

    It will help in the future if you can be more precise on your information. This is a C64x forum but there is no C6437 DSP, so you either have a typo in the number or you have left off an important prefix other than C. Also, your boot mode is not clear as to which boot mode you are using, and that will also vary depending on exactly which device you are using, again meaning that the part number will be important.

    Regards,
    RandyP