1/* 2 * Copyright 2022 The Pigweed Authors 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 * use this file except in compliance with the License. You may obtain a copy of 6 * the License at 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 * License for the specific language governing permissions and limitations under 14 * the License. 15 */ 16 17/* This linker script is for test purposes only and should not be used in a 18 * production environment. 19*/ 20#ifndef PW_BOOT_VECTOR_TABLE_BEGIN 21#error "PW_BOOT_VECTOR_TABLE_BEGIN is not defined, and is required to use pw_boot_cortex_m" 22#endif // PW_BOOT_VECTOR_TABLE_BEGIN 23 24 25 /* Note: This technically doesn't set the firmware's entry point. Setting the 26 * firmware entry point is done by setting vector_table[1] 27 * (Reset_Handler). However, this DOES tell the compiler how to optimize 28 * when --gc-sections is enabled. 29 */ 30ENTRY(pw_boot_Entry) 31 32MEMORY 33{ 34 /* TODO(pwbug/57): Make it possible for projects to freely customize 35 * memory regions. 36 */ 37 38 /* Vector Table (typically in flash) */ 39 VECTOR_TABLE(rx) : \ 40 ORIGIN = PW_BOOT_VECTOR_TABLE_BEGIN, \ 41 LENGTH = PW_BOOT_VECTOR_TABLE_SIZE 42 /* Internal Flash */ 43 FLASH(rx) : \ 44 ORIGIN = PW_BOOT_FLASH_BEGIN, \ 45 LENGTH = PW_BOOT_FLASH_SIZE 46 /* Internal SRAM */ 47 RAM(rwx) : \ 48 ORIGIN = PW_BOOT_RAM_BEGIN, \ 49 LENGTH = PW_BOOT_RAM_SIZE 50} 51 52