@@ -38,30 +38,23 @@ fn auto_layout() {
38
38
// Create a valid linker file with the specified flash and ram locations.
39
39
//
40
40
// ```
41
- // MEMORY {
42
- // FLASH (X) : ORIGIN = $LINKER_FLASH, LENGTH = 0x000D0000
43
- // RAM (W) : ORIGIN = $LINKER_RAM, LENGTH = 46K
44
- // }
45
41
// TBF_HEADER_SIZE = 0x60;
42
+ //
43
+ // FLASH_START = 0x00040000;
44
+ // FLASH_LENGTH = 0x00040000;
45
+ //
46
+ // RAM_START = 0x20008000;
47
+ // RAM_LENGTH = 62K;
48
+ //
46
49
// INCLUDE libtock_layout.ld
47
50
// ```
48
51
let out_platform_path: PathBuf = [ out_dir, "layout.ld" ] . iter ( ) . collect ( ) ;
49
52
let mut file = File :: create ( out_platform_path) . expect ( "Could not create linker file" ) ;
50
- write ! ( file, "MEMORY {{\n " ) . expect ( "Could not write linker file" ) ;
51
- write ! (
52
- file,
53
- " FLASH (X) : ORIGIN = {}, LENGTH = 0x000D0000\n " ,
54
- linker_flash
55
- )
56
- . expect ( "Could not write linker file" ) ;
57
- write ! (
58
- file,
59
- " RAM (X) : ORIGIN = {}, LENGTH = 46k\n " ,
60
- linker_ram
61
- )
62
- . expect ( "Could not write linker file" ) ;
63
- write ! ( file, "}}\n " ) . expect ( "Could not write linker file" ) ;
64
53
write ! ( file, "TBF_HEADER_SIZE = 0x60;\n " ) . expect ( "Could not write linker file" ) ;
54
+ write ! ( file, "FLASH_START = {};\n " , linker_flash) . expect ( "Could not write linker file" ) ;
55
+ write ! ( file, "FLASH_LENGTH = 0x000D0000;\n " , ) . expect ( "Could not write linker file" ) ;
56
+ write ! ( file, "RAM_START = {};\n " , linker_ram) . expect ( "Could not write linker file" ) ;
57
+ write ! ( file, "RAM_LENGTH = 46K;\n " , ) . expect ( "Could not write linker file" ) ;
65
58
write ! ( file, "INCLUDE libtock_layout.ld\n " ) . expect ( "Could not write linker file" ) ;
66
59
67
60
// Copy the generic layout file into OUT_DIR.
0 commit comments