Skip to content

Commit 6f04bde

Browse files
committed
Added comments to silabs_executable
1 parent 32d49e6 commit 6f04bde

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

third_party/silabs/silabs_executable.gni

+17-6
Original file line numberDiff line numberDiff line change
@@ -47,25 +47,32 @@ template("generate_rps_file") {
4747
}
4848

4949
template("silabs_executable") {
50+
# output_dir is optional and will default to root_out_dir
5051
if (!defined(invoker.output_dir)) {
5152
invoker.output_dir = root_out_dir
5253
}
54+
55+
# output_name is optional and will default to "$target_name.bin"
5356
if (!defined(invoker.output_name)) {
5457
invoker.output_name = target_name + ".bin"
5558
}
59+
5660
output_base_name = get_path_info(invoker.output_name, "name")
5761
objcopy_image_name = output_base_name + ".s37"
5862
objcopy_image_format = "srec"
5963
objcopy = "arm-none-eabi-objcopy"
6064

65+
if (use_rps_extension) {
66+
flashing_image_name = output_base_name + ".rps"
67+
}
68+
69+
# flashable_executable calls a generator script to do the following:
70+
# Create a flash.py script with the name of the binary hardcoded in it.
6171
# Copy flashing dependencies to the output directory so that the output
6272
# is collectively self-contained; this allows flashing to work reliably
6373
# even if the build and flashing steps take place on different machines
6474
# or in different containers.
65-
66-
if (use_rps_extension) {
67-
flashing_image_name = output_base_name + ".rps"
68-
}
75+
# Create *.flashbundle.txt with a list of all files needed for flashing
6976

7077
flashing_script_generator =
7178
"${chip_root}/scripts/flashing/gen_flashing_script.py"
@@ -94,14 +101,15 @@ template("silabs_executable") {
94101
_platform_firmware_utils,
95102
_firmware_utils,
96103
]
104+
flashbundle_name = "" # Stop flashable_executable from making flashbundle.
97105

106+
# Target to generate the s37 file, flashing script, and flashbundle.
98107
flash_target_name = target_name + ".flash_executable"
99-
flashbundle_name = "" # Stop flashable_executable from making flashbundle.
100108
flashable_executable(flash_target_name) {
101109
forward_variables_from(invoker, "*")
102110
}
103111

104-
# Add a target which generates the hex file in addition to s37.
112+
# Target to generate the hex file.
105113
executable_target = "$flash_target_name.executable"
106114
hex_image_name = output_base_name + ".hex"
107115
hex_target_name = target_name + ".hex"
@@ -112,6 +120,7 @@ template("silabs_executable") {
112120
deps = [ ":$executable_target" ]
113121
}
114122

123+
# Target to generate the rps file.
115124
if (use_rps_extension) {
116125
rps_target_name = target_name + ".rps"
117126
generate_rps_file(rps_target_name) {
@@ -123,6 +132,8 @@ template("silabs_executable") {
123132
]
124133
}
125134
}
135+
136+
# Main target that deps the targets defined above.
126137
group(target_name) {
127138
deps = [
128139
":$flash_target_name",

0 commit comments

Comments
 (0)