This repository has been archived by the owner on Feb 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.zig
65 lines (58 loc) · 1.99 KB
/
build.zig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
const std = @import("std");
fn path(comptime suffix: []const u8) std.Build.LazyPath {
return .{
.cwd_relative = comptime ((std.fs.path.dirname(@src().file) orelse ".") ++ suffix),
};
}
pub const chips = struct {
pub const nrf52840 = .{
.preferred_format = .elf,
.chip = .{
.name = "nrf52840",
.url = "https://www.nordicsemi.com/products/nrf52840",
.cpu = .cortex_m4,
.register_definition = .{
.json = path("/src/chips/nrf52840.json"),
},
.memory_regions = &.{
.{ .offset = 0x00000000, .length = 0x100000, .kind = .flash },
.{ .offset = 0x20000000, .length = 0x40000, .kind = .ram },
// EXTFLASH
.{ .offset = 0x12000000, .length = 0x8000000, .kind = .flash },
// CODE_RAM
.{ .offset = 0x800000, .length = 0x40000, .kind = .ram },
},
},
};
pub const nrf52832 = .{
.preferred_format = .elf,
.chip = .{
.name = "nrf52",
.url = "https://www.nordicsemi.com/products/nrf52832",
.cpu = .cortex_m4,
.register_definition = .{
.json = path("/src/chips/nrf52.json"),
},
.memory_regions = &.{
.{ .offset = 0x00000000, .length = 0x80000, .kind = .flash },
.{ .offset = 0x20000000, .length = 0x10000, .kind = .ram },
},
},
};
};
pub const boards = struct {
pub const nordic = struct {
pub const nRF52840_Dongle = .{
.preferred_format = .elf,
.chip = chips.nrf52840.chip,
.board = .{
.name = "nRF52840 Dongle",
.url = "https://www.nordicsemi.com/Products/Development-hardware/nrf52840-dongle",
.source_file = path("/src/boards/nrf52840-dongle.zig"),
},
};
};
};
pub fn build(b: *std.build.Builder) void {
_ = b;
}