Skip to main content
Visitor II
July 10, 2006
Question

Initialising variables after scatter loading?

  • July 10, 2006
  • 3 replies
  • 1133 views
Posted on July 10, 2006 at 07:54

Initialising variables after scatter loading?

    This topic has been closed for replies.

    3 replies

    prabathAuthor
    Visitor II
    May 10, 2006
    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?

    prabathAuthor
    Visitor II
    May 11, 2006
    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?

    Visitor II
    July 7, 2006
    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)

    }

    }