Skip to content

Commit d35b780

Browse files
committed
update image_def_block
1 parent 882b561 commit d35b780

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

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

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,43 @@ const root = @import("root");
44
const microzig = @import("microzig");
55
const arch = @import("compatibility.zig").arch;
66

7-
pub const image_def_block: Block(extern struct {
7+
pub const image_def_block = if (microzig.config.ram_image and arch == .arm) Block(extern struct {
88
image_def: ImageDef,
99
entry_point: EntryPoint(false),
10-
}) = .{
10+
}){
1111
.items = .{
1212
.image_def = .{
1313
.image_type_flags = .{
1414
.image_type = .exe,
1515
.exe_security = root.microzig_options.hal.image_def_exe_security,
16-
.cpu = std.meta.stringToEnum(ImageDef.ImageTypeFlags.Cpu, @tagName(arch)).?,
16+
.cpu = .arm,
1717
.chip = .RP2350,
1818
.try_before_you_buy = false,
1919
},
2020
},
21+
//We must specify a custom entry point since by default RP2350 expects
22+
//the vector table at the start of the image.
2123
.entry_point = .{
22-
.entry = if (microzig.config.ram_image and arch == .arm)
23-
&microzig.cpu.startup_logic.ram_image_entrypoint
24-
else
25-
&microzig.cpu.startup_logic._start,
24+
.entry = &microzig.cpu.startup_logic.ram_image_entrypoint,
2625
.sp = microzig.config.end_of_stack,
2726
},
2827
},
2928
.link = root.microzig_options.hal.next_metadata_block,
29+
} else Block(extern struct {
30+
image_def: ImageDef,
31+
}){
32+
.items = .{
33+
.image_def = .{
34+
.image_type_flags = .{
35+
.image_type = .exe,
36+
.exe_security = root.microzig_options.hal.image_def_exe_security,
37+
.cpu = std.meta.stringToEnum(ImageDef.ImageTypeFlags.Cpu, @tagName(arch)).?,
38+
.chip = .RP2350,
39+
.try_before_you_buy = false,
40+
},
41+
},
42+
},
43+
.link = root.microzig_options.hal.next_metadata_block,
3044
};
3145

3246
comptime {

0 commit comments

Comments
 (0)