AnsweredAssumed Answered

_mi_initialize - data initialization on boot in bypass mode

Question asked by alemannia on Nov 30, 2010
Latest reply on Dec 3, 2010 by alemannia

Hi,

 

I am currently settings up my own bootloader on a cutomized BF537 board. The boot mode is set to "bypass" which makes the BF start from NOR flash without bothering the ROM code. I have read and followed the explanations in the EE-239. In my LDF file I put the following sections into FLASH:

 

code

    {

      INPUT_SECTION_ALIGN(4)

      INPUT_SECTIONS( $OBJECTS(program) $LIBRARIES(program) )

      ...

 

    } >MEM_ASYNC0

 

bsz_init

    {

      INPUT_SECTION_ALIGN(4)

      INPUT_SECTIONS( $OBJECTS(bsz_init) $LIBRARIES(bsz_init) )

      ...

    } > MEM_ASYNC0

 

.meminit

    {

      ALIGN(4)

    } > MEM_ASYNC0

 

Ther are 2 sections in RAM that will contain data

 

scratchpad RUNTIME_INIT

    {

      INPUT_SECTION_ALIGN(4)

      INPUT_SECTIONS( $OBJECTS(L1_data)   $LIBRARIES(L1_data)   )

      INPUT_SECTIONS( $OBJECTS(constdata)  $LIBRARIES(constdata) )

      ...

    } >MEM_L1_SCRATCHPAD

 

    scratchpad_bsz ZERO_INIT

    {

      INPUT_SECTION_ALIGN(4)

      INPUT_SECTIONS( $OBJECTS(L1_bsz) $LIBRARIES(L1_bsz) )

      ...

    } >MEM_L1_SCRATCHPAD

 

The job of the memory initializer on startup (basiccrt.s) is to copy all necessary data from FLASH into RAM, before starting any custom software. I have seen however that the mi_initialize function itself needs initialized data for it to work! Here is the classic chicken and egg problem. I had to move the "constdata" section from the data area declared in RAM into a new data area declared in FLASH (MEM_ASYNC_0). I don't know if I am missing something but that's certainly not explained in the EE-239. Is there a way to avoid putting all constdata into FLASH? It would be good to have an extra label for constants used by the memory initializer functions (mi_constdata?). Then I could only leave the neccesary minimum in FLASH and put the rest into RAM. Any sugestions?

 

Cheers.

 

PS: My VisualDSP++ is 5.0 Update 8


 

 

Outcomes