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.

DSP 6455 go to entry point with EMIFA boot

 Hello All,

I placed function #1 in address 0xB0000000 that copies function #2 from 0xB0020000 to 0x00800000. then I verify result. Then I have two ways. In 1st way I jump to 0xB0020000 that starts original func#2 then it executes. In 2nd way I want jump to 0x00800000, but dsp doesn`t initialise (because func#1 doesn't starts)

 func#1  //placed in 0xB0000000 starts in boot

 int main(void) {

Uint32* PERLOCK = (Uint32*)0x02AC0004;
Uint32* PERCFG0 = (Uint32*)0x02AC0008;

Uint32* GPIO_DIR = (Uint32*) 0x02B00010;
Uint32* GPIO_OUT = (Uint32*) 0x02B00014;
                                                                                                 //GPIO enable
*PERLOCK = (Uint32) 0x0F0A0B00;
*PERCFG0 |= (Uint32) 0x400;

asm(" nop 9");
asm(" nop 9");
asm(" nop 9");
                                                                                                    //GPIO config 
*GPIO_DIR = (Uint32)0xCF3F;
*GPIO_OUT = (Uint32)0x3000;                                            //light up light-emitting diode #1 and #2

Uint32* dst = (Uint32*) 0x00800000;
Uint32* src = (Uint32*) 0xB0020000;
                                                                                                  //transfer func#2
short i, b=0;
for(i=0; i<64; i++) {*dst++ = *src++;}
                                                                                                  //verify transfer
for(i=0;i<64;i++){ if(*(Uint32*)(0x800000 + i) != *(Uint32*)(0xB0020000+i)) b = 1;}

if(b==0) *GPIO_OUT = (Uint32)0x3080;                            //light up light-emitting diode #1 and #2 and #3
                                                                                                  //jump to func #2
void (*init)();
init = (void*) 0xB0020000;     //1st way
// init = (void*) 0x800000;       //2nd way 
(*init)();

asm(" nop 9");
asm(" nop 9");
asm(" nop 9");
asm(" nop 9");
 return 0;
}

 func#2 //original placed in 0xB0020000 and copy placed in 0x00800000 after transfer

 void prog(void) {
              Uint32* GPIO_OUT = (Uint32*) 0x02B00014;
              *GPIO_OUT |= (Uint32)0x40;                     //light up light-emitting diode #4 
}

All results of work I watched with diods

functions loaded with JTAG and 2nd way completely works after system reset (without power off). All four diodes lights

And doesn't works after power off/on. no one diode lights, I think DSP does not initialize  (I can not find out why!!!)

1st way completely works every time. All four diodes lights

 

 

  • Igor,

    Your problem probably has to do with cache, but I cannot prove that from what I see in the code.

    Does your linker command .cmd file use LOAD= and RUN= for the prog function's allocation at 0xB0020000/0x00800000?

    Are you using a DSK6455 or EVM6455, or some other board?

    Use CCS to debug the problem. After programming the Flash for "2nd way", set the DIP switches to NoBoot, use CCS to Load Symbols Only for func#1. If needed, set the PC to 0xB0000000, then run-to or step to the copy for-loop.

    Open a Browser Window to look at memory at 0x00800000 and run-to/step past the copy. Use the Memory Browser's check boxes to look at the different cache contents to see whether the data is being saved in one or more of the caches.

    My suspicion is that you need to writeback the L1D cache and invalidate the L1P program cache, but I cannot prove that logically from your code. Your debug will be needed for you to find the problem.

    In the Wiki, you can find additional guidelines for debug boot problems. Go to the Wiki and search for "debugging boot issues" (no quotes).

    Regards,
    RandyP