HT32F52342_ANNEPRO2_C15.ld (3511B)
1 /* 2 * Copyright (c) 2013-2016 Fabio UJonathan A. Kollaschtzig, http://fabioutzig.com 3 * (c) 2020 Yaotian Feng (Codetector) <codetector@codetector.cn> 4 * 5 * Permission is hereby granted, free of charge, to any person obtaining 6 * a copy of this software and associated documentation files (the "Software"), 7 * to deal in the Software without restriction, including without limitation 8 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 * and/or sell copies of the Software, and to permit persons to whom the 10 * Software is furnished to do so, subject to the following conditions: 11 * 12 * The above copyright notice and this permission notice shall be included in 13 * all copies or substantial portions of the Software. 14 * 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 16 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 * SOFTWARE. 22 */ 23 24 /* 25 * HT32F52342 w/ Anne Pro 2 bootloader memory setup. 26 */ 27 MEMORY { 28 flash0 : org = 0x00004000, len = 64k - 16k /* firmware */ 29 flash1 : org = 0x00000000, len = 0 30 flash2 : org = 0x00000000, len = 0 31 flash3 : org = 0x00000000, len = 0 32 flash4 : org = 0x00000000, len = 0 33 flash5 : org = 0x00000000, len = 0 34 flash6 : org = 0x00000000, len = 0 35 flash7 : org = 0x00000000, len = 0 36 ram0 : org = 0x20000000, len = 8k - 4 /* RAM */ 37 ram1 : org = 0x00000000, len = 0 38 ram2 : org = 0x00000000, len = 0 39 ram3 : org = 0x00000000, len = 0 40 ram4 : org = 0x00000000, len = 0 41 ram5 : org = 0x00000000, len = 0 42 ram6 : org = 0x00000000, len = 0 43 ram7 : org = 0x00000000, len = 0 44 } 45 46 /* For each data/text section two region are defined, a virtual region 47 and a load region (_LMA suffix).*/ 48 49 /* Flash region to be used for exception vectors.*/ 50 REGION_ALIAS("VECTORS_FLASH", flash0); 51 REGION_ALIAS("VECTORS_FLASH_LMA", flash0); 52 53 /* Flash region to be used for constructors and destructors.*/ 54 REGION_ALIAS("XTORS_FLASH", flash0); 55 REGION_ALIAS("XTORS_FLASH_LMA", flash0); 56 57 /* Flash region to be used for code text.*/ 58 REGION_ALIAS("TEXT_FLASH", flash0); 59 REGION_ALIAS("TEXT_FLASH_LMA", flash0); 60 61 /* Flash region to be used for read only data.*/ 62 REGION_ALIAS("RODATA_FLASH", flash0); 63 REGION_ALIAS("RODATA_FLASH_LMA", flash0); 64 65 /* Flash region to be used for various.*/ 66 REGION_ALIAS("VARIOUS_FLASH", flash0); 67 REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); 68 69 /* Flash region to be used for RAM(n) initialization data.*/ 70 REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); 71 72 /* RAM region to be used for Main stack. This stack accommodates the processing 73 of all exceptions and interrupts.*/ 74 REGION_ALIAS("MAIN_STACK_RAM", ram0); 75 76 /* RAM region to be used for the process stack. This is the stack used by 77 the main() function.*/ 78 REGION_ALIAS("PROCESS_STACK_RAM", ram0); 79 80 /* RAM region to be used for data segment.*/ 81 REGION_ALIAS("DATA_RAM", ram0); 82 REGION_ALIAS("DATA_RAM_LMA", flash0); 83 84 /* RAM region to be used for BSS segment.*/ 85 REGION_ALIAS("BSS_RAM", ram0); 86 87 /* RAM region to be used for the default heap.*/ 88 REGION_ALIAS("HEAP_RAM", ram0); 89 90 /* Generic rules inclusion.*/ 91 INCLUDE rules.ld