File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -24,14 +24,18 @@ fn main() {
24
24
let mut f = if env:: var_os ( "CARGO_FEATURE_DEVICE" ) . is_some ( ) {
25
25
let mut f = File :: create ( out. join ( "link.x" ) ) . unwrap ( ) ;
26
26
27
+ f. write_all ( link_x) . unwrap ( ) ;
28
+
29
+ // *IMPORTANT*: The weak aliases (i.e. `PROVIDED`) must come *after* `EXTERN(__INTERRUPTS)`.
30
+ // Otherwise the linker will ignore user defined interrupts and always populate the table
31
+ // with the weak aliases.
27
32
writeln ! (
28
33
f,
29
34
r#"
30
35
/* Provides weak aliases (cf. PROVIDED) for device specific interrupt handlers */
31
36
/* This will usually be provided by a device crate generated using svd2rust (see `device.x`) */
32
37
INCLUDE device.x"#
33
38
) . unwrap ( ) ;
34
- f. write_all ( link_x) . unwrap ( ) ;
35
39
f
36
40
} else {
37
41
let mut f = File :: create ( out. join ( "link.x" ) ) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments