AnsweredAssumed Answered

bf609 , how to use rom_Boot() function ?

Question asked by -jaro on Dec 11, 2013
Latest reply on Dec 18, 2013 by Aaronwu

My problem : I'd like to boot another  *.ldr  program existing in Flash with use of the U-boot bootloader.

(I tried to call rom_Boot() function but without any success)

 

Enviroment : BF609-EZKIT , CCES 1.0.3.0 , emulator 100B

Uboot : uboot-2013-07.2013R1  with my changes

 

1. As an example I used Power_On_Self_Test (POST) project

2. I build this example to obtain Power_On_Self_Test.ldr file (Debug config)

elfloader settings as follow :

     -v -proc ADSP-BF609 -si-revision 0.1 -b MEMORY -f binary -width 16 -init C:/Analog\ Devices/CrossCore\ Embedded\ Studio\ 1.0.3/Blackfin  /ldr/BF609_init_v01.dxe -bcode 0x1   

3. Then I programmed Power_On_Self_Test.ldr file to Flash to default address ( 0xb0000000) . After RESET it works properly !!!!

Script for cldp programmer as below :

     -proc ADSP-BF609

     -emu 100B

     -driver c:\bf609_pc28f128p33_dpia.dxe

     -cmd prog  -erase affected -offset 0x0000000 -format bin -file c:\Power_On_Self_Test.ldr

So I know that POST application works OK !!!

4.Then I programmed U-boot bootloader (u-boot.ldr)  to default address in Flash ( 0xb0000000)

  and Power_On_Self_Test.ldr to address ( 0xb0100000)

5. After RESET U-boot starts OK !!!

6. In U-boot command line I enter :

     > bootldr 0xb0100000 

      This function should boot my second program (POST)

7. My program (POST) doesn't  run , after few seconds U-boot starts again !!!

 

CHANGES IN U-BOOT CODE :

 

    Because the original U-boot code doesn't work , I performed following changes:

     ( I try to call rom_Boot() function )

 

//  _BOOTROM_MEMBOOT = 0xC800000C (pointer to rom_BOOT() function  !!!)

int32_t (*BOOTROM_MEM)(void *, int32_t, int32_t, void *,int32_t , void *) = (void *)_BOOTROM_MEMBOOT;     

BOOTROM_MEM(0xb0100000, 0, 0, NULL,0x0000001,NULL); 

 

Unfortunately it doesn't work !!!!

 

After detailed analysis of rom_Boot()  code ,   I also tried version like below:

 

        asm ("r0.h= 0xb010;");          // R0 , my application , start address in Flash : 0xb0100000
        asm ("r0.l= 0x0000;");   
         asm ("r1.h= 0x0000;");          // R1 , dFlags =0
        asm ("r1.l= 0x0000;");       
        asm ("r2.h= 0x0000;");          // R2 , dBlockCount = 0
        asm ("r2.l= 0x0000;");       
        asm ("r3.h= 0x0000;");       
        asm ("r3.l= 0x0000;");        //0
        asm ("r4.h= 0x0000;");       
        asm ("r4.l= 0x0001;");        //dBootCommand = 0x01 - memory boot
        asm ("r5.h= 0x0000;");       
        asm ("r5.l= 0x0000;");        //0
        asm ("[--sp]=r5;");
       asm ("[--sp]=r4;");
       asm ("[--sp]=r3;");
       asm ("[--sp]=r2;");
       asm ("[--sp]=r1;");
       asm ("[--sp]=r0;");
       asm ("p0.h= 0xC800;");          // 0xC800000C (call rom_BOOT !!!)
       asm ("p0.l= 0x000C;");        // jump to Blackfin BOOT ROM            
       asm ("jump (p0);");

 

Any of these versions do not work !!!!

 

What am I doing wrong ?

Could you give me any example how to do it ?

 

Thank you in advance .

 

Jaroslaw

Outcomes