]> git.friedersdorff.com Git - max/tmk_keyboard.git/blobdiff - keyboard/stm32_f103_onekey/ld/STM32F103x8_stm32duino_bootloader.ld
Merge pull request #355 from papodaca/XT
[max/tmk_keyboard.git] / keyboard / stm32_f103_onekey / ld / STM32F103x8_stm32duino_bootloader.ld
index 425616af1a7242f019d6f7f93f6808d390796083..00613328ed16dfa482f0060698b9327d5bfe5cb4 100644 (file)
@@ -1,40 +1,73 @@
 /*\r
-    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio.\r
+    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio\r
 \r
-    This file is part of ChibiOS.\r
+    Licensed under the Apache License, Version 2.0 (the "License");\r
+    you may not use this file except in compliance with the License.\r
+    You may obtain a copy of the License at\r
 \r
-    ChibiOS is free software; you can redistribute it and/or modify\r
-    it under the terms of the GNU General Public License as published by\r
-    the Free Software Foundation; either version 3 of the License, or\r
-    (at your option) any later version.\r
+        http://www.apache.org/licenses/LICENSE-2.0\r
 \r
-    ChibiOS is distributed in the hope that it will be useful,\r
-    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-    GNU General Public License for more details.\r
-\r
-    You should have received a copy of the GNU General Public License\r
-    along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
+    Unless required by applicable law or agreed to in writing, software\r
+    distributed under the License is distributed on an "AS IS" BASIS,\r
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+    See the License for the specific language governing permissions and\r
+    limitations under the License.\r
 */\r
 \r
 /*\r
- * ST32F103xB memory setup.\r
+ * ST32F103xB memory setup for use with the maplemini bootloader.\r
+ * You will have to\r
+ *     #define CORTEX_VTOR_INIT 0x5000\r
+ * in your projects chconf.h\r
  */\r
 MEMORY\r
 {\r
-    flash : org = 0x08002000, len = 64k - 0x2000\r
-    ram0  : org = 0x20000C00, len = 20k - 0xC00\r
-    ram1  : org = 0x00000000, len = 0\r
-    ram2  : org = 0x00000000, len = 0\r
-    ram3  : org = 0x00000000, len = 0\r
-    ram4  : org = 0x00000000, len = 0\r
-    ram5  : org = 0x00000000, len = 0\r
-    ram6  : org = 0x00000000, len = 0\r
-    ram7  : org = 0x00000000, len = 0\r
+    flash0  : org = 0x08002000, len = 128k - 0x2000\r
+    flash1  : org = 0x00000000, len = 0\r
+    flash2  : org = 0x00000000, len = 0\r
+    flash3  : org = 0x00000000, len = 0\r
+    flash4  : org = 0x00000000, len = 0\r
+    flash5  : org = 0x00000000, len = 0\r
+    flash6  : org = 0x00000000, len = 0\r
+    flash7  : org = 0x00000000, len = 0\r
+    ram0    : org = 0x20000000, len = 20k\r
+    ram1    : org = 0x00000000, len = 0\r
+    ram2    : org = 0x00000000, len = 0\r
+    ram3    : org = 0x00000000, len = 0\r
+    ram4    : org = 0x00000000, len = 0\r
+    ram5    : org = 0x00000000, len = 0\r
+    ram6    : org = 0x00000000, len = 0\r
+    ram7    : org = 0x00000000, len = 0\r
 }\r
 \r
+/* For each data/text section two region are defined, a virtual region\r
+   and a load region (_LMA suffix).*/\r
+\r
+/* Flash region to be used for exception vectors.*/\r
+REGION_ALIAS("VECTORS_FLASH", flash0);\r
+REGION_ALIAS("VECTORS_FLASH_LMA", flash0);\r
+\r
+/* Flash region to be used for constructors and destructors.*/\r
+REGION_ALIAS("XTORS_FLASH", flash0);\r
+REGION_ALIAS("XTORS_FLASH_LMA", flash0);\r
+\r
+/* Flash region to be used for code text.*/\r
+REGION_ALIAS("TEXT_FLASH", flash0);\r
+REGION_ALIAS("TEXT_FLASH_LMA", flash0);\r
+\r
+/* Flash region to be used for read only data.*/\r
+REGION_ALIAS("RODATA_FLASH", flash0);\r
+REGION_ALIAS("RODATA_FLASH_LMA", flash0);\r
+\r
+/* Flash region to be used for various.*/\r
+REGION_ALIAS("VARIOUS_FLASH", flash0);\r
+REGION_ALIAS("VARIOUS_FLASH_LMA", flash0);\r
+\r
+/* Flash region to be used for RAM(n) initialization data.*/\r
+REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0);\r
+\r
 /* RAM region to be used for Main stack. This stack accommodates the processing\r
-   of all exceptions and interrupts*/\r
+   of all exceptions and interrupts.*/\r
 REGION_ALIAS("MAIN_STACK_RAM", ram0);\r
 \r
 /* RAM region to be used for the process stack. This is the stack used by\r
@@ -43,6 +76,7 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0);
 \r
 /* RAM region to be used for data segment.*/\r
 REGION_ALIAS("DATA_RAM", ram0);\r
+REGION_ALIAS("DATA_RAM_LMA", flash0);\r
 \r
 /* RAM region to be used for BSS segment.*/\r
 REGION_ALIAS("BSS_RAM", ram0);\r
@@ -50,4 +84,5 @@ REGION_ALIAS("BSS_RAM", ram0);
 /* RAM region to be used for the default heap.*/\r
 REGION_ALIAS("HEAP_RAM", ram0);\r
 \r
+/* Generic rules inclusion.*/\r
 INCLUDE rules.ld\r