⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vz_flash.lcf

📁 一个linux下的usb接口源代码
💻 LCF
字号:
/*	Sample Linker Command File for M68VZ328ADS ver 1.0 */
/* please refer to ROM_readme.txt in stationery project for detail of memory footprint */

/* location to reconfig if using custom hardware instead of M68VZ328ADS */

MEMORY {
	FLASH_BUFFER(RWX) : ORIGIN = 0x00010000							/* 1. RAM buffer holding ROM image before flashing */
	FLASH_CODE(RX) :	ORIGIN = 0x8000,		LENGTH = 0x8000		/* 2. Some RAM location to hold flash program */
	BOOT (RX) :	ORIGIN = 0x01000000,			LENGTH = 0x1000		/* 3. beginning of application FLASH(beware of monitor footprint */
	TEXT (RX) : ORIGIN = AFTER(BOOT),			LENGTH = 0xf000	
	DATA (RWX): ORIGIN = 0x00000400,			LENGTH = 0x12000	/* 4. beginning of application data RAM, leaving room 
																		  in case we wish to use RAM exception vector later							
																		  (beware of vector table or monitor footprint in RAM)
																	*/
}


FORCE_ACTIVE{ copy_to_flash, ___reset }

WRITES0COMMENT "M68vz328ADS" /* write comment on ROM using S0 record */

SECTIONS {

	.flash_buffer :
	{
		___FBUF_START = .;
	} > FLASH_BUFFER

	.flash :
	{
		*(.flashinit)
	} > FLASH_CODE

	/* init boot code that must be run in ROM */
	.boot : AT(ADDR(.flash_buffer))
	{
		___FLASH_START = .;
		*(.reset)
	} > BOOT

	
	/* code and read only data in ROM */
	.main_application : AT(ADDR(.flash_buffer) + SIZEOF(.boot))
	{
		.= ALIGN(0x8);
		*(.text)
		.= ALIGN(0x8);
		*(.rodata)
	} > TEXT

	/* initialized data and C++ code will be copy to RAM by runtime function */
    .cpp_code : AT(ADDR(.flash_buffer) + SIZEOF(.boot) + SIZEOF(.main_application))
	{
		_DATA_ROM = ADDR(.boot) + SIZEOF(.boot) + SIZEOF(.main_application);
		_DATA_RAM = .;
		. = ALIGN(0x8);
		*(.exception)
		. = ALIGN(0x8);
		__exception_table_start__ = .;
		EXCEPTION
		__exception_table_end__ = .;
		. = ALIGN(0x8);
		___sinit__ = .;
	    STATICINIT
	} > DATA   
	
	.data : AT(ADDR(.flash_buffer) + SIZEOF(.boot) + SIZEOF(.main_application) + SIZEOF(.cpp_code))
	{  
		. = ALIGN(0x8);
		__START_DATA = .;
		*(.data)
		__END_DATA = .;

		__START_SDATA = .;
		*(.sdata)
		__END_SDATA = .;
		
		__SDA_BASE = .;				/* A5 set to  middle of data and bss */
	} >> DATA

	/* uninitialized data in RAM */
	.uninitialized_data :
	{
		__START_SBSS = .;
		*(.sbss)
		*(SCOMMON)
		__END_SBSS = .;

		__START_BSS = .;
		*(.bss)
		*(COMMON)
		__END_BSS = .;	
	} >> DATA

	/* ROM table is a list record of source, destination and size for memory locations 
	need to be copy from ROM to RAM, last record have null in all field */
	.romp : AT(ADDR(.flash_buffer) + SIZEOF(.boot) + SIZEOF(.main_application) + SIZEOF(.cpp_code) + SIZEOF(.data))
	{
		__S_romp = ADDR(.boot) + SIZEOF(.boot) + SIZEOF(.main_application) + SIZEOF(.cpp_code) + SIZEOF(.data);
		WRITEW(_DATA_ROM);
		WRITEW(_DATA_RAM);
		WRITEW(SIZEOF(.cpp_code) + SIZEOF(.data));
		WRITEW(0);
		WRITEW(0);
		WRITEW(0);
	}
	
	___FBUF_END = ADDR(.flash_buffer) + SIZEOF(.boot) + SIZEOF(.main_application) + SIZEOF(.cpp_code) + SIZEOF(.data) + SIZEOF(.romp);
	
	_stack_address = __END_BSS;
	_stack_address = _stack_address & ~7;	/* align top of stack by 8 after end of bss */
	__SP_INIT = _stack_address + 0x00004000; /* set stack to 0x4000 bytes (16KB) */
												
	___heap_addr = __SP_INIT;		/* heap grows in opposite direction of stack */
	___heap_size = 0x50000;			/* heap size set to 0x50000 bytes (500KB) */

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -