Skip to content

Commit 650aa87

Browse files
author
Johannes Draaijer
committed
Add memory.x for f107
1 parent 8bac2aa commit 650aa87

File tree

3 files changed

+9
-26
lines changed

3 files changed

+9
-26
lines changed

.cargo/config

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
1-
[target.thumbv7em-none-eabihf]
1+
[target.'cfg(all(target_arch = "arm", target_os = "none"))']
22
runner = 'probe-run'
33
rustflags = [
44
"-C", "link-arg=-Tlink.x",
55
"-C", "link-arg=-Tdefmt.x",
66
]
77

8-
[target.thumbv7m-none-eabi]
9-
runner = 'probe-run'
10-
rustflags = [
11-
"-C", "link-arg=-Tlink.x",
12-
"-C", "link-arg=-Tdefmt.x"
13-
]
148

159
[build]
1610
# Pick ONE of these compilation targets
1711
# target = "thumbv6m-none-eabi" # Cortex-M0 and Cortex-M0+
18-
# target = "thumbv7m-none-eabi" # Cortex-M3
12+
target = "thumbv7m-none-eabi" # Cortex-M3
1913
# target = "thumbv7em-none-eabi" # Cortex-M4 and Cortex-M7 (no FPU)
20-
target = "thumbv7em-none-eabihf" # Cortex-M4F and Cortex-M7F (with FPU)
14+
# target = "thumbv7em-none-eabihf" # Cortex-M4F and Cortex-M7F (with FPU)

build.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
fn main() {
2+
#[cfg(feature = "stm32f1xx-hal")]
3+
println!("cargo:rustc-link-search=memory.x")
4+
}

memory.x

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,5 @@
1-
/* STM32F429 */
21
MEMORY
32
{
4-
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 2048K
5-
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 112K
6-
RAM2 (xrw) : ORIGIN = 0x2001C000, LENGTH = 16K
7-
RAM3 (xrw) : ORIGIN = 0x20020000, LENGTH = 64K
8-
CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K
3+
FLASH : ORIGIN = 0x08000000, LENGTH = 128k
4+
RAM : ORIGIN = 0x20000000, LENGTH = 32K
95
}
10-
_stack_start = ORIGIN(RAM) + LENGTH(RAM);
11-
_heap_size = LENGTH(RAM) - 4K;
12-
13-
/* STM32F107 */
14-
/*
15-
MEMORY
16-
{
17-
FLASH : ORIGIN = 0x08000000, LENGTH = 128K
18-
RAM : ORIGIN = 0x20000000, LENGTH = 32K
19-
}
20-
*/

0 commit comments

Comments
 (0)