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.

Few problems with booting from flash c6713



Hi everyone,

I had read posts about problems with booting from flash on C6713, but i have'nt found answers for my problems.

First problem is different behaviour of the same programs while booted from flash and loaded from code composer studio. All sections I have located in IRAM (0x400, length 0x2fc00). It is an audio app (voice processing) which uses ADC (mic) and DAC. When loaded using CCS it works properly in real time, but when booted from flash, output looses a lot of frames (256 samples per frame) (obout 50%). Can it be problem with interrupt vectors? I use DSP/BIOS, boot file bootDSK6713.asm from blink tutorial, and additional cmd file:

/* Allocation of the custom code and data sections */

SECTIONS

{

    .boot_load: > BOOT

    .vectors: > vecs

}

where BOOT is 0x200, len 0x200

vecs 0x00 len 0x200

 

File for hex6x is as follow:

 

speech_processing.out            /* Input File: COFF file format (.out) */

-a                          /* Output Format: ASCII Hex format (.hex) */

-image                      /* Select image mode */

-memwidth 8                 /* Set memory width */

-zero

-o speech_processing.hex         /* Output File: ASCII Hex file (.hex) */


ROMS

{

    FLASH: org = 000h, len = 0x2fc00, romwidth = 8

}

 

I have found another boot file with interrupt vectors vect_int_flash.asm:

 

*vecs_int_flash.asm Vector file. Setup interrupt vectors and boot section for flash:

 

FLASH_START   .equ    0x90000400        ;flash start address

CODE_START    .equ    0x00000400        ;start of non boot code

CODE_SIZE     .equ    0x0003ffff        ;application code size in byte, seems to be sufficient


   .global _vectors  

   .global _c_int00

   .global _vector1

   .global _vector2

   .global _vector3

   .global _vector4

   .global _vector5

   .global _vector6

   .global _vector7

   .global _vector8

   .global _vector9  

   .global _vector10 

   .global _c_int11   

   .global _vector12  

   .global _vector13   

   .global _vector14

   .global _vector15


   .ref _c_int00  


VEC_ENTRY .macro addr  

    STW   B0,*--B15

    MVKL  addr,B0

    MVKH  addr,B0

    B     B0

    LDW   *B15++,B0

    NOP   2

    NOP   

    NOP   

   .endm


_vec_dummy:  

  B    B3

  NOP  5


 .sect ".vecs"

 .align 1024


_vectors:

_vector0:   VEC_ENTRY _boot_start ;RESET to start of boot loader 

   ;to copy code from FLASH

_vector1:   VEC_ENTRY _vec_dummy  ;NMI

_vector2:   VEC_ENTRY _vec_dummy  ;RSVD

_vector3:   VEC_ENTRY _vec_dummy

_vector4:   VEC_ENTRY _vec_dummy

_vector5:   VEC_ENTRY _vec_dummy

_vector6:   VEC_ENTRY _vec_dummy

_vector7:   VEC_ENTRY _vec_dummy

_vector8:   VEC_ENTRY _vec_dummy

_vector9:   VEC_ENTRY _vec_dummy

_vector10:  VEC_ENTRY _vec_dummy

_vector11:  VEC_ENTRY _c_int11

_vector12:  VEC_ENTRY _vec_dummy

_vector13:  VEC_ENTRY _vec_dummy

_vector14:  VEC_ENTRY _vec_dummy

_vector15:  VEC_ENTRY _vec_dummy


.sect "bootload"


_boot_start:

mvkl  .S1  0x90080000, A1 ;added for signalize properly copied boot section

mvkh  .S1  0x90080000, A1

mvkl  .S1  0xA, A2

mvkl  .S1  0xA, A2

stw   .D1  A2,*A1


     mvkl  FLASH_START,B4 ;flash start address ->B4

     mvkh  FLASH_START,B4   

      

mvkl  CODE_START,A4 ;apps code start address ->A4

mvkh  CODE_START,A4

zero  A1

_boot_loop1:

ldb   *B4++,B5       ;flash read

mvkl  CODE_SIZE-4,B6 ;B6 = BOOT_SIZE -1024

add   1,A1,A1           ;A1+=1,inc outer counter

 ||   mvkh  CODE_SIZE-4,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

but _c_int11 is not declared here and in any other header file .and I really don't know what to do with it. I think that NOP is not a solution :) Is it problem with interrupt vectors? Or am I wrong :) More complex audio apps, which can be located in IRAM, does not run at all when booted from flash.

Another problem is locating sections in SDRAM (0x80000000, length 0x10000000) because length of code (length of IRAM is not sufficient). I use the same cmd and boot files, but hex6x tees me that this memory is unconfigured (section [...] at 0x80020000 falls in unconfigured memory (20000 offset is because of stack)). I thought that maybe EMIF is not properly configured and added c6713_emif.s62 and boot_c671x.h62 files to project (founded in SPRA999A1 rar file, rf3_dsk6713_boot_with_table catalog) but cmd  file for hex6x tells me always the same. What is the proper way to configure external memory?
Thank you in advance for every reply .