[Reprinted] ADS 1.2 mem. SCF file comment

Source: Internet
Author: User

Reprinted, please state the author and source-papaya-Hexun

; A total of three scattered loading files: mem_a.scf, mem_ B .scf, and mem_c.scf. The difference is that the loading address is different.

In debuginexram> arm linker> scatter, select scattered as the link type.

; Image entry point must be the same as the rom_load Value

; Rom_load is the name of the loading area, followed by 0x00000000 indicates the starting address of the loading area (StorageProgramCodeStarting address)
Rom_load 0x0
{
Rom_exec describes the address of the execution zone, which is defined at the first position.
Rom_exec 0x00000000
{
From the starting address, place the vector table (that is, startup. O (vectors, + first), where startup. O is the target file of startup. s)

; + First indicates that the vector segment is placed at the beginning

Startup. O (vectors, + first)

; then place other code (that is, * (+ RO). * is a wildcard, similar to the wildcard used for searching in the window.
* (+ RO)
}< br>; the starting address of the Variable Area Iram is 0x40000000
Iram 0x40000000
{< br>; place startup. O (mystacks)
startup. O (mystacks)
}< br>; + 0 indicates the next section, and uninit indicates that the initialization is not performed.
stacks_bottom + 0 uninit
{< br>; place area stackbottom, Data, noinit
startup. O (stackbottom)
}< br>; then, from 0x40004000, place area stacks, Data, noinit, uninit indicates no initialization
stacks 0x40004000 uninit
{< br> startup. O (stacks)
}< br>; External RAM starts from 0x80000000 as the variable zone

If the ram start address is not 0x8000 0000, modify the mem _. SCF file.
Eram 0x80000000
{
* (+ RW, + zi)
}
; + 0 indicates the next section, and uninit indicates that the initialization is not performed.
Heap + 0 uninit
{
; Place the heap bottom, area heap, Data, noinit
Startup. O (HEAP)
}
Then place the heap top in the external 0x80080000

; This address is the end address of the off-board RAM, which can be modified according to the actual situation.
Heap_bottom 0x80080000 uninit
{
Startup. O (heaptop)
}
}

; Redirection _ user_initial_stackheap Function

; Assign a new bottom_of_heap address, etc. The R0-R3 is a required return value of the function and returns the value of bottom_of_heap.

The description file is loaded discretely and its location is redirected. bottom_of_heap and so on have been defined as the data type in startup. S.

_ User_initial_stackheap
LDR r0, = bottom_of_heap
; LDR R1, = stackusr
LDR R2, = top_of_heap
LDR R3, = bottom_of_stacks
MoV PC, LR

 

;ArticleSource: http://www.diybl.com/course/3_program/rg/200865/122670.html

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.