Quellcode durchsuchen

Compile firmware for STM32F072x8 instead of xB

Since the firmware is under 32 KiB, I figured there's not much reason to
use a microcontroller with 128 KiB of flash.  The new boards use
STM32F072x8 chips, which only have 64 KiB of flash.  This allows for the
firmware to grow, while not being quite so ridiculous as before.

This commit sets the Makefile to put the configuration at the end of the
64 KiB flash chip, and to use a new linker script for the same chip.
Clara Hobbs vor 7 Jahren
Ursprung
Commit
f09094de6a
2 geänderte Dateien mit 55 neuen und 2 gelöschten Zeilen
  1. 2
    2
      Makefile
  2. 53
    0
      ld/STM32F072x8.ld

+ 2
- 2
Makefile Datei anzeigen

@@ -96,7 +96,7 @@ include $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/mk/port_v6m.mk
96 96
 include $(CHIBIOS)/test/rt/test.mk
97 97
 
98 98
 # Define linker script file here
99
-LDSCRIPT=$(CHIBIOS)/../ld/STM32F072xB.ld
99
+LDSCRIPT=$(CHIBIOS)/../ld/STM32F072x8.ld
100 100
 
101 101
 # C sources that can be compiled in ARM or THUMB mode depending on the global
102 102
 # setting.
@@ -191,7 +191,7 @@ CPPWARN = -Wall -Wextra -Wundef
191 191
 #
192 192
 
193 193
 # List all user C define here, like -D_DEBUG=1
194
-UDEFS = -DPDB_CONFIG_BASE=0x0801F800
194
+UDEFS = -DPDB_CONFIG_BASE=0x0800F800
195 195
 
196 196
 # Define ASM defines here
197 197
 UADEFS =

+ 53
- 0
ld/STM32F072x8.ld Datei anzeigen

@@ -0,0 +1,53 @@
1
+/*
2
+    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
3
+
4
+    Licensed under the Apache License, Version 2.0 (the "License");
5
+    you may not use this file except in compliance with the License.
6
+    You may obtain a copy of the License at
7
+
8
+        http://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,
12
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+    See the License for the specific language governing permissions and
14
+    limitations under the License.
15
+*/
16
+
17
+/*
18
+ * STM32F072x8 memory setup.
19
+ *
20
+ * Flash is defined as 2k smaller than it really is to reserve the last page
21
+ * for configuration.
22
+ */
23
+MEMORY
24
+{
25
+    flash : org = 0x08000000, len = 62k
26
+    ram0  : org = 0x20000000, len = 16k
27
+    ram1  : org = 0x00000000, len = 0
28
+    ram2  : org = 0x00000000, len = 0
29
+    ram3  : org = 0x00000000, len = 0
30
+    ram4  : org = 0x00000000, len = 0
31
+    ram5  : org = 0x00000000, len = 0
32
+    ram6  : org = 0x00000000, len = 0
33
+    ram7  : org = 0x00000000, len = 0
34
+}
35
+
36
+/* RAM region to be used for Main stack. This stack accommodates the processing
37
+   of all exceptions and interrupts*/
38
+REGION_ALIAS("MAIN_STACK_RAM", ram0);
39
+
40
+/* RAM region to be used for the process stack. This is the stack used by
41
+   the main() function.*/
42
+REGION_ALIAS("PROCESS_STACK_RAM", ram0);
43
+
44
+/* RAM region to be used for data segment.*/
45
+REGION_ALIAS("DATA_RAM", ram0);
46
+
47
+/* RAM region to be used for BSS segment.*/
48
+REGION_ALIAS("BSS_RAM", ram0);
49
+
50
+/* RAM region to be used for the default heap.*/
51
+REGION_ALIAS("HEAP_RAM", ram0);
52
+
53
+INCLUDE rules.ld

Laden…
Abbrechen
Speichern