Skip to main content
Visitor II
March 31, 2006
Question

booting from flash str7

  • March 31, 2006
  • 19 replies
  • 4065 views
Posted on March 31, 2006 at 06:32

booting from flash str7

    This topic has been closed for replies.

    19 replies

    prabathAuthor
    Visitor II
    March 7, 2006
    Posted on March 07, 2006 at 21:06

    in project properties *link advanced does it ignore the Auto via file settings when I have a scatter file defined?

    it does not seem to come up with flash memory control when I hit F5 when I have scatter file defined. But seems fine with Auto via file settings.

    Visitor II
    March 8, 2006
    Posted on March 08, 2006 at 20:32

    Hi RISC,

    I want to debug the code using ICE. I must place the code to ext sram 0x62000000.But i found something strangely. When I place the code to cpu sram 0x20000000, It works well. I relink the code to 0x62000000,and download the code to ext sram 0x62000000,It can't run to main function.

    Another question,You said remap RAM to address 0 ,I have to enable the RAM remapping, therefore uncomment the GBLL remapping and GBLL remap_flash.

    Why not uncomment the GBLL remapping and GBLL remap_ram?

    uncomment remap_flash means remap cpu flash 0x400000000 to 0x0000, and does't remap cpu sram 0x20000000 to 0x0000.

    [ This message was edited by: dom on 09-03-2006 03:05 ]

    prabathAuthor
    Visitor II
    March 9, 2006
    Posted on March 09, 2006 at 17:08

    ok I wrote some code to copy all the contents from the flash to ram... do I place this code before the GBLL remap? or is it the first instruction before the resethandler?

    LDR R1, =FLASHBASE ;FLASH START ADDR

    LDR R2, =RAMB ;RAM STAR ADDR

    LDR R3, =RAML ;RAM END ADDR

    COPY CMP R2, R3

    LDRLO R0,[R1],#4

    STRLO R0,[R2],#4

    BLO COPY

    well i want to start from flash====>copy to ram=====>remap ram to 0x0000

    Visitor II
    March 9, 2006
    Posted on March 09, 2006 at 20:27

    Hi RISC,

    I have enable the EMI Bank 1 using the EMI_config.inc file.

    I can download the code to EXT SRAM 0X62000000. But It can run to main.

    Visitor II
    March 10, 2006
    Posted on March 10, 2006 at 10:20

    Hi RISC,

    Here is my scat file.

    I want to download and debug my program to ext sram 0x62000000.

    I can't go to main function and the debug says ''DBT Warning 00135: Cannot set breakpoints in literal pools''

    When i try to step to B __main. I don't what's wrong!

    When relink the program to cpu sram 0x20000000 It works well.

    Visitor II
    March 10, 2006
    Posted on March 10, 2006 at 22:54

    Here is my project.

    I am using ADS1.2

    using ****_cpu_sram to link,the program works well

    but using ****_ext_sram to link, the program can't go to main.

    The debug says ''DBT Warning 00135: Cannot set breakpoints in literal pools''.

    ________________

    Attachments :

    str7.rar : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HtBy&d=%2Fa%2F0X0000000aK9%2FQqAFJq0b3I_KzBKNacRIBG0v1SlUYcXdUybHdZY9JCs&asPdf=false
    prabathAuthor
    Visitor II
    March 30, 2006
    Posted on March 30, 2006 at 19:49

    Quote:

    On 10-03-2006 at 09:58, Anonymous wrote:

    @Dom, could you send me your scatter file.

    @fixxer, You do not need to copy the code from FLASH to RAM by hand. With an appropriate scatter file the __main will copy the code from FLASH to RAM.

    Here an example of scatter file:

    FLASH 0x40000000 0x40000

    {

    FLASH 0x40000000

    {

    71x_init.o (Init,+First)

    * (InRoot$$Sections)

    }

    RAM 0x20000000 0x10000000

    {

    71x_vect.o (Vect, +First)

    * (+RO)

    * (+RW)

    * (+ZI)

    }

    }

    In your init.s file you should have the following instruction at the beginning:

    Reset_Handler

    LDR pc, =NextInst

    NextInst

    NOP

    NOP

    NOP

    :

    :

    RAM_remapping

    B __main

    Regards.

    Hi what goes in * (InRoot$$Sections) ?

    I made some good progress, can boot from flash, but stack pointers seem to get confused, while running from flash.

    prabathAuthor
    Visitor II
    March 30, 2006
    Posted on March 30, 2006 at 20:56

    This is my MMAP

    Image Entry point : 0x40000000

    Load Region FLASH (Base: 0x40000000, Size: 0x0000677c, Max: 0x00040000, ABSOLUTE)

    Execution Region FLASH (Base: 0x40000000, Size: 0x00005db4, Max: 0xffffffff, ABSOLUTE)

    Base Addr Size Type Attr Idx E Section Name Object

    0x40000000 0x0000012c Code RO 412 * Init 71x_init.o

    0x4000012c 0x00000008 Code RO 415 * !!!main __main.o(c_a__un.l)

    0x40000134 0x00000038 Code RO 470 !!!scatter __scatter.o(c_a__un.l)

    0x4000016c 0x0000006c Code RO 468 !!dczerorl2 __dczerorl2.o(c_a__un.l)

    0x400001d8 0x00000028 Code RO 472 !!handler_copy __scatter_copy.o(c_a__un.l)

    0x40000200 0x0000002c Code RO 474 !!handler_zi __scatter_zi.o(c_a__un.l)

    Execution Region RAM (Base: 0x20000000, Size: 0x00006294, Max: 0xffffffff, ABSOLUTE, COMPRESSED[0x000001d8])

    Base Addr Size Type Attr Idx E Section Name Object

    0x20000000 0x000004c0 Code RO 405 * Vect 71x_vect.o

    Visitor II
    March 30, 2006
    Posted on March 30, 2006 at 23:16

    Thank you!