[부록] Scatter Loading

개발 공부 블로그·2024년 5월 7일
0

When to Use Scatter-loading

Scatter Loading 은 Link 단계에서 Linker 에게 Scatter file을 던져줘서 원하는 메모리 영역에 위치시킬 수 있다. 그럼 언제 Scatter Loading 을 사용하는가?
1. Complex Memory Maps

  • 다양한 메모리 영역에 위치시켜야 하는 Code 와 Data 은 어떤 메모리 공간에 적재시킬지 자세한 instruction 을 줘야한다.
  1. Different Types of Memory
  • Flash memory, Dram, Fast Sram 등 다양한 메모리 디바이스가 있을 때, 코드와 데이터를 적당한 메모리 디바이스에 위치시켜야 한다. 예를 들어, interrupt 같이 빠른 response 를 요구하는 애들은 Fast Sram 에 넣어놔야 좋다.

Images with a simple Memory Map


위와 같은 image 는 simple memory map이다. 이를 scatter-loading description 을 작성해자.

LOAD_ROM 0x0000 0x8000       ; Name of load region (LOAD_ROM),
                             ; Start address for load region (0x0000),
                             ; Maximum size of load region (0x8000)
{
    EXEC_ROM 0x0000 0x8000   ; Name of first exec region (EXEC_ROM),
                             ; Start address for exec region (0x0000),
                             ; Maximum size of first exec region (0x8000)
    {
        * (+RO)              ; Place all code and RO data into
                             ; this exec region
    }

    SRAM 0x10000 0x6000      ; Name of second exec region (RAM),
                             ; Start address of second exec region (0x10000),
                             ; Maximum size of second exec region (0x6000)
    {
        * (+RW, +ZI)         ; Place all RW and ZI data into
                             ; this exec region
    }
}

0개의 댓글

관련 채용 정보