cancel
Showing results for 
Search instead for 
Did you mean: 

Initialising variables after scatter loading?

prabath
Associate II
Posted on July 10, 2006 at 07:54

Initialising variables after scatter loading?

3 REPLIES 3
prabath
Associate II
Posted on May 10, 2006 at 04:57

When I run program from ram, all the variables are initialised.

When I run program after scatter loading ie: from flash, what’s copied to ram is not initialised.

How do I make the variables initialised? when I boot load from flash so what copied to ram looks like initialised data?

prabath
Associate II
Posted on May 11, 2006 at 03:28

I figured it out, rather than using B main, I had to use B __main. It works. All the variables are initialised now.

Can some one explain the difference?

julienduay
Associate II
Posted on July 07, 2006 at 12:47

Hello, I have the same problem.

I load code in Bank1, but when I execute it the variables don't be initialised.

Where must I write ''B __main'', in 71x_init.s file?

Thanks

Here is my scatter file:

BANK0 0x40000000

{

FLASH_B0 0x40000000 ; for bank0 of internal flash

{

71x_vect.o (Vect, +First)

71x_init.o (Init)

* (+RO)

}

FLASH_B1 0x400C0000 ; for bank1 of internal flash

{

flash_prog.o (+RO) ; code of flash_prog file

flash.o (+RO) ; code of flash file

serial_flash.o (+RO) ; code of serial_flash file

}

RAM_0 0x20000000 ; for internal RAM

{

flash_prog.o (+RW,+ZI) ; data of flash_prog file

flash.o (+RW,+ZI) ; data of flash file

serial_flash.o (+RW,+ZI) ; data of serial_flash file

* (+RW)

* (+ZI)

}

}