Skip to content

Commit 0fff315

Browse files
committed
put the entry point at the start of ram unconditionally
1 parent 5cdd6dd commit 0fff315

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

port/raspberrypi/rp2xxx/src/hal.zig

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,14 @@ comptime {
4949
pub const HAL_Options = switch (compatibility.chip) {
5050
.RP2040 => struct {},
5151
.RP2350 => struct {
52-
image_def_exe_security: bootmeta.ImageDef.ImageTypeFlags.ExeSecurity = .secure,
53-
54-
/// Next metadata block to link after image_def. **Last block in the
55-
/// chain must link back to the first one** (to
56-
/// `bootmeta.image_def_block`).
57-
next_metadata_block: ?*const anyopaque = null,
52+
bootmeta: struct {
53+
image_def_exe_security: bootmeta.ImageDef.ImageTypeFlags.ExeSecurity = .secure,
54+
55+
/// Next metadata block to link after image_def. **Last block in the
56+
/// chain must link back to the first one** (to
57+
/// `bootmeta.image_def_block`).
58+
next_block: ?*const anyopaque = null,
59+
} = .{},
5860
},
5961
};
6062

port/raspberrypi/rp2xxx/src/hal/bootmeta.zig

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub const image_def_block = if (microzig.config.ram_image and arch == .arm) Bloc
1212
.image_def = .{
1313
.image_type_flags = .{
1414
.image_type = .exe,
15-
.exe_security = root.microzig_options.hal.image_def_exe_security,
15+
.exe_security = root.microzig_options.hal.bootmeta.image_def_exe_security,
1616
.cpu = .arm,
1717
.chip = .RP2350,
1818
.try_before_you_buy = false,
@@ -21,26 +21,26 @@ pub const image_def_block = if (microzig.config.ram_image and arch == .arm) Bloc
2121
// We must specify a custom entry point since by default RP2350 expects
2222
// the vector table at the start of the image.
2323
.entry_point = .{
24-
.entry = &microzig.cpu.startup_logic.ram_image_entrypoint,
24+
.entry = @ptrFromInt(0x2000_0001), // start of ram
2525
.sp = microzig.config.end_of_stack,
2626
},
2727
},
28-
.link = root.microzig_options.hal.next_metadata_block,
28+
.link = root.microzig_options.hal.bootmeta.next_block,
2929
} else Block(extern struct {
3030
image_def: ImageDef,
3131
}){
3232
.items = .{
3333
.image_def = .{
3434
.image_type_flags = .{
3535
.image_type = .exe,
36-
.exe_security = root.microzig_options.hal.image_def_exe_security,
36+
.exe_security = root.microzig_options.hal.bootmeta.image_def_exe_security,
3737
.cpu = std.meta.stringToEnum(ImageDef.ImageTypeFlags.Cpu, @tagName(arch)).?,
3838
.chip = .RP2350,
3939
.try_before_you_buy = false,
4040
},
4141
},
4242
},
43-
.link = root.microzig_options.hal.next_metadata_block,
43+
.link = root.microzig_options.hal.bootmeta.next_block,
4444
};
4545

4646
comptime {
@@ -123,3 +123,4 @@ pub fn EntryPoint(with_stack_limit: bool) type {
123123
};
124124
}
125125
}
126+

0 commit comments

Comments
 (0)