forked from Flipper-XFW/Xtreme-Firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
firmwareopts.scons
63 lines (58 loc) · 1.26 KB
/
firmwareopts.scons
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
Import("ENV")
if ENV["DEBUG"]:
ENV.Append(
CPPDEFINES=[
"FURI_DEBUG",
"NDEBUG",
],
CCFLAGS=[
"-Og",
],
)
elif ENV["COMPACT"]:
ENV.Append(
CPPDEFINES=[
"FURI_NDEBUG",
"NDEBUG",
],
CCFLAGS=[
"-Os",
],
)
else:
ENV.Append(
CPPDEFINES=[
"FURI_NDEBUG",
"NDEBUG",
],
CCFLAGS=[
"-Og",
],
)
ENV.AppendUnique(
LINKFLAGS=[
"-specs=nano.specs",
"-specs=nosys.specs",
"-Wl,--gc-sections",
"-Wl,--undefined=uxTopUsedPriority",
"-Wl,--wrap,_malloc_r",
"-Wl,--wrap,_free_r",
"-Wl,--wrap,_calloc_r",
"-Wl,--wrap,_realloc_r",
"-n",
"-Xlinker",
"-Map=${TARGET}.map",
"-T${LINKER_SCRIPT_PATH}",
],
)
if ENV["FIRMWARE_BUILD_CFG"] == "updater":
ENV.Append(
IMAGE_BASE_ADDRESS="0x20000000",
LINKER_SCRIPT_PATH=ENV["TARGET_CFG"].linker_script_ram,
)
else:
ENV.Append(
IMAGE_BASE_ADDRESS="0x8000000",
LINKER_SCRIPT_PATH=ENV["TARGET_CFG"].linker_script_flash,
APP_LINKER_SCRIPT_PATH=ENV["TARGET_CFG"].linker_script_app,
)