2023-01-07 15:03:21 +08:00
|
|
|
/****************************************************************************************
|
|
|
|
* @file map.txt
|
|
|
|
*
|
|
|
|
* @brief This file is the map file (gnuarm or armgcc).
|
|
|
|
*
|
|
|
|
* Copyright (C) BouffaloLab 2018
|
|
|
|
*
|
|
|
|
****************************************************************************************
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* configure the CPU type */
|
|
|
|
OUTPUT_ARCH( "riscv" )
|
|
|
|
/* link with the standard c library */
|
2023-03-19 14:41:18 +08:00
|
|
|
/*INPUT(-lc)*/
|
2023-01-07 15:03:21 +08:00
|
|
|
/* link with the standard GCC library */
|
2023-03-19 14:41:18 +08:00
|
|
|
/*INPUT(-lgcc)*/
|
2023-01-07 15:03:21 +08:00
|
|
|
/* configure the entry point */
|
2023-03-19 14:41:18 +08:00
|
|
|
ENTRY(__start)
|
2023-01-07 15:03:21 +08:00
|
|
|
|
|
|
|
StackSize = 0x0400; /* 1KB */
|
2023-03-19 14:41:18 +08:00
|
|
|
HeapSize = 0x1000; /* 4KB */
|
2023-01-07 15:03:21 +08:00
|
|
|
|
|
|
|
MEMORY
|
|
|
|
{
|
2023-03-19 14:41:18 +08:00
|
|
|
fw_header_memory (rx) : ORIGIN = 0x23000000 - 0x1000, LENGTH = 4K
|
|
|
|
xip_memory (rx) : ORIGIN = 0x23000000, LENGTH = 1024K
|
|
|
|
itcm_memory (rx) : ORIGIN = 0x22010000, LENGTH = 16K
|
|
|
|
dtcm_memory (rx) : ORIGIN = 0x42014000, LENGTH = 48K
|
|
|
|
ram_memory (!rx) : ORIGIN = 0x42020000, LENGTH = 176K
|
2023-01-07 15:03:21 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
SECTIONS
|
|
|
|
{
|
|
|
|
PROVIDE(__metal_chicken_bit = 0);
|
2023-03-19 14:41:18 +08:00
|
|
|
|
|
|
|
.fw_header :
|
|
|
|
{
|
|
|
|
KEEP(*(.fw_header))
|
|
|
|
} > fw_header_memory
|
|
|
|
|
2023-01-07 15:03:21 +08:00
|
|
|
.text :
|
|
|
|
{
|
|
|
|
. = ALIGN(4);
|
|
|
|
__text_code_start__ = .;
|
2023-03-19 14:41:18 +08:00
|
|
|
|
|
|
|
KEEP (*(SORT_NONE(.init)))
|
|
|
|
KEEP (*(SORT_NONE(.vector)))
|
|
|
|
|
2023-01-07 15:03:21 +08:00
|
|
|
*(.text)
|
|
|
|
*(.text.*)
|
2023-03-19 14:41:18 +08:00
|
|
|
|
|
|
|
/* section information for finsh shell */
|
|
|
|
. = ALIGN(4);
|
|
|
|
__fsymtab_start = .;
|
|
|
|
KEEP(*(FSymTab))
|
|
|
|
__fsymtab_end = .;
|
|
|
|
. = ALIGN(4);
|
|
|
|
__vsymtab_start = .;
|
|
|
|
KEEP(*(VSymTab))
|
|
|
|
__vsymtab_end = .;
|
|
|
|
. = ALIGN(4);
|
|
|
|
|
|
|
|
/* section information for modules */
|
|
|
|
. = ALIGN(4);
|
|
|
|
__rtmsymtab_start = .;
|
|
|
|
KEEP(*(RTMSymTab))
|
|
|
|
__rtmsymtab_end = .;
|
|
|
|
|
|
|
|
/* section information for initialization */
|
|
|
|
. = ALIGN(4);
|
|
|
|
__rt_init_start = .;
|
|
|
|
KEEP(*(SORT(.rti_fn*)))
|
|
|
|
__rt_init_end = .;
|
|
|
|
|
2023-01-07 15:03:21 +08:00
|
|
|
/*put .rodata**/
|
2023-03-19 14:41:18 +08:00
|
|
|
*(EXCLUDE_FILE( *bl602_glb*.o* \
|
|
|
|
*bl602_pds*.o* \
|
|
|
|
*bl602_common*.o* \
|
|
|
|
*bl602_sf_cfg*.o* \
|
|
|
|
*bl602_sf_cfg_ext*.o* \
|
|
|
|
*bl602_sf_ctrl*.o* \
|
|
|
|
*bl602_sflash*.o* \
|
|
|
|
*bl602_sflash_ext*.o* \
|
|
|
|
*bl602_xip_sflash*.o* \
|
|
|
|
*bl602_xip_sflash_ext*.o* \
|
|
|
|
*bl602_ef_ctrl*.o*) .rodata*)
|
|
|
|
*(.rodata)
|
|
|
|
*(.rodata.*)
|
|
|
|
|
2023-01-07 15:03:21 +08:00
|
|
|
*(.srodata)
|
|
|
|
*(.srodata.*)
|
2023-03-19 14:41:18 +08:00
|
|
|
|
2023-01-07 15:03:21 +08:00
|
|
|
. = ALIGN(4);
|
|
|
|
__text_code_end__ = .;
|
2023-03-19 14:41:18 +08:00
|
|
|
|
|
|
|
} > xip_memory
|
|
|
|
|
2023-01-07 15:03:21 +08:00
|
|
|
. = ALIGN(4);
|
|
|
|
__itcm_load_addr = .;
|
2023-03-19 14:41:18 +08:00
|
|
|
|
2023-01-07 15:03:21 +08:00
|
|
|
.itcm_region : AT (__itcm_load_addr)
|
|
|
|
{
|
|
|
|
. = ALIGN(4);
|
|
|
|
__tcm_code_start__ = .;
|
|
|
|
|
|
|
|
*(.tcm_code.*)
|
2023-03-19 14:41:18 +08:00
|
|
|
*(.tcm_const.*)
|
2023-01-07 15:03:21 +08:00
|
|
|
*(.sclock_rlt_code.*)
|
|
|
|
*(.sclock_rlt_const.*)
|
|
|
|
|
2023-03-19 14:41:18 +08:00
|
|
|
*bl602_glb*.o*(.rodata*)
|
|
|
|
*bl602_pds*.o*(.rodata*)
|
|
|
|
*bl602_common*.o*(.rodata*)
|
|
|
|
*bl602_sf_cfg*.o*(.rodata*)
|
|
|
|
*bl602_sf_cfg_ext*.o*(.rodata*)
|
|
|
|
*bl602_sf_ctrl*.o*(.rodata*)
|
|
|
|
*bl602_sflash*.o*(.rodata*)
|
|
|
|
*bl602_sflash_ext*.o*(.rodata*)
|
|
|
|
*bl602_xip_sflash*.o*(.rodata*)
|
|
|
|
*bl602_xip_sflash_ext*.o*(.rodata*)
|
|
|
|
*bl602_ef_ctrl*.o*(.rodata*)
|
2023-01-07 15:03:21 +08:00
|
|
|
|
|
|
|
. = ALIGN(4);
|
|
|
|
__tcm_code_end__ = .;
|
|
|
|
} > itcm_memory
|
2023-03-19 14:41:18 +08:00
|
|
|
|
2023-01-07 15:03:21 +08:00
|
|
|
__dtcm_load_addr = __itcm_load_addr + SIZEOF(.itcm_region);
|
2023-03-19 14:41:18 +08:00
|
|
|
|
2023-01-07 15:03:21 +08:00
|
|
|
.dtcm_region : AT (__dtcm_load_addr)
|
|
|
|
{
|
|
|
|
. = ALIGN(4);
|
|
|
|
__tcm_data_start__ = .;
|
2023-03-19 14:41:18 +08:00
|
|
|
|
2023-01-07 15:03:21 +08:00
|
|
|
*(.tcm_data)
|
2023-03-19 14:41:18 +08:00
|
|
|
|
2023-01-07 15:03:21 +08:00
|
|
|
. = ALIGN(4);
|
|
|
|
__tcm_data_end__ = .;
|
|
|
|
} > dtcm_memory
|
|
|
|
|
2023-03-19 14:41:18 +08:00
|
|
|
|
2023-01-07 15:03:21 +08:00
|
|
|
/* .heap_dummy section doesn't contains any symbols. It is only
|
|
|
|
* used for linker to calculate size of heap sections, and assign
|
|
|
|
* values to heap symbols later */
|
|
|
|
.heap_dummy (NOLOAD):
|
|
|
|
{
|
|
|
|
. = ALIGN(0x4);
|
|
|
|
. = . + HeapSize;
|
|
|
|
. = ALIGN(0x4);
|
|
|
|
} > dtcm_memory
|
|
|
|
|
2023-03-19 14:41:18 +08:00
|
|
|
_HeapBase = ORIGIN(dtcm_memory) + LENGTH(dtcm_memory) - StackSize - HeapSize;
|
2023-01-07 15:03:21 +08:00
|
|
|
_HeapSize = HeapSize;
|
2023-03-19 14:41:18 +08:00
|
|
|
|
2023-01-07 15:03:21 +08:00
|
|
|
/* Check if data + heap + stack exceeds RAM limit */
|
|
|
|
ASSERT(_HeapBase >= __tcm_data_end__, "region RAM overflowed with stack")
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* .stack_dummy section doesn't contains any symbols. It is only
|
|
|
|
* used for linker to calculate size of stack sections, and assign
|
|
|
|
* values to stack symbols later */
|
|
|
|
.stack_dummy (NOLOAD):
|
|
|
|
{
|
|
|
|
. = ALIGN(0x4);
|
|
|
|
. = . + StackSize;
|
|
|
|
. = ALIGN(0x4);
|
|
|
|
} > dtcm_memory
|
2023-03-19 14:41:18 +08:00
|
|
|
|
2023-01-07 15:03:21 +08:00
|
|
|
/* Set stack top to end of RAM, and stack limit move down by
|
|
|
|
* size of stack_dummy section */
|
|
|
|
__StackTop = ORIGIN(dtcm_memory) + LENGTH(dtcm_memory);
|
|
|
|
PROVIDE( __freertos_irq_stack_top = __StackTop);
|
2023-03-19 14:41:18 +08:00
|
|
|
PROVIDE( __rt_rvstack = . );
|
2023-01-07 15:03:21 +08:00
|
|
|
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
|
2023-03-19 14:41:18 +08:00
|
|
|
|
2023-01-07 15:03:21 +08:00
|
|
|
/* Check if data + heap + stack exceeds RAM limit */
|
|
|
|
ASSERT(__StackLimit >= __tcm_data_end__, "region RAM overflowed with stack")
|
|
|
|
/*************************************************************************/
|
2023-03-19 14:41:18 +08:00
|
|
|
|
|
|
|
__ram_load_addr = __dtcm_load_addr + SIZEOF(.dtcm_region);
|
|
|
|
|
2023-01-07 15:03:21 +08:00
|
|
|
/* Data section */
|
|
|
|
RAM_DATA : AT (__ram_load_addr)
|
|
|
|
{
|
|
|
|
. = ALIGN(4);
|
|
|
|
__ram_data_start__ = .;
|
2023-03-19 14:41:18 +08:00
|
|
|
|
2023-01-07 15:03:21 +08:00
|
|
|
PROVIDE( __global_pointer$ = . + 0x800 );
|
2023-03-19 14:41:18 +08:00
|
|
|
|
2023-01-07 15:03:21 +08:00
|
|
|
*(.data)
|
|
|
|
*(.data.*)
|
|
|
|
*(.sdata)
|
|
|
|
*(.sdata.*)
|
|
|
|
*(.sdata2)
|
|
|
|
*(.sdata2.*)
|
2023-03-19 14:41:18 +08:00
|
|
|
|
|
|
|
*(.nocache_ram)
|
|
|
|
|
|
|
|
. = ALIGN(4);
|
|
|
|
__bflog_tags_start__ = .;
|
|
|
|
*(.bflog_tags_array)
|
2023-01-07 15:03:21 +08:00
|
|
|
. = ALIGN(4);
|
2023-03-19 14:41:18 +08:00
|
|
|
__bflog_tags_end__ = .;
|
2023-01-07 15:03:21 +08:00
|
|
|
__ram_data_end__ = .;
|
|
|
|
} > ram_memory
|
|
|
|
|
|
|
|
.bss (NOLOAD) :
|
|
|
|
{
|
|
|
|
. = ALIGN(4);
|
|
|
|
__bss_start__ = .;
|
2023-03-19 14:41:18 +08:00
|
|
|
|
2023-01-07 15:03:21 +08:00
|
|
|
*(.bss*)
|
|
|
|
*(.sbss*)
|
|
|
|
*(COMMON)
|
2023-03-19 14:41:18 +08:00
|
|
|
|
2023-01-07 15:03:21 +08:00
|
|
|
. = ALIGN(4);
|
|
|
|
__bss_end__ = .;
|
|
|
|
} > ram_memory
|
2023-03-19 14:41:18 +08:00
|
|
|
|
2023-01-07 15:03:21 +08:00
|
|
|
.noinit_data (NOLOAD) :
|
|
|
|
{
|
|
|
|
. = ALIGN(4);
|
|
|
|
__noinit_data_start__ = .;
|
2023-03-19 14:41:18 +08:00
|
|
|
|
2023-01-07 15:03:21 +08:00
|
|
|
*(.noinit_data*)
|
2023-03-19 14:41:18 +08:00
|
|
|
*(.nocache_noinit_ram)
|
|
|
|
|
2023-01-07 15:03:21 +08:00
|
|
|
. = ALIGN(4);
|
|
|
|
__noinit_data_end__ = .;
|
|
|
|
} > ram_memory
|
2023-03-19 14:41:18 +08:00
|
|
|
|
2023-01-07 15:03:21 +08:00
|
|
|
.heap (NOLOAD):
|
|
|
|
{
|
|
|
|
. = ALIGN(4);
|
|
|
|
__HeapBase = .;
|
2023-03-19 14:41:18 +08:00
|
|
|
|
2023-01-07 15:03:21 +08:00
|
|
|
/*__end__ = .;*/
|
|
|
|
/*end = __end__;*/
|
|
|
|
KEEP(*(.heap*))
|
2023-03-19 14:41:18 +08:00
|
|
|
|
2023-01-07 15:03:21 +08:00
|
|
|
. = ALIGN(4);
|
|
|
|
__HeapLimit = .;
|
|
|
|
} > ram_memory
|
|
|
|
__HeapLimit = ORIGIN(ram_memory) + LENGTH(ram_memory);
|
2023-03-19 14:41:18 +08:00
|
|
|
|
2023-01-07 15:03:21 +08:00
|
|
|
}
|
|
|
|
|