42
42
os .getenv ("AUDIO_KIT_SERIAL_NUMBERS_JSON" ))
43
43
TARGET_BOARD_NRF5340_AUDIO_DK_APP_NAME = "nrf5340_audio_dk/nrf5340/cpuapp"
44
44
45
- TARGET_CORE_APP_FOLDER = NRF5340_AUDIO_FOLDER
46
- TARGET_DEV_HEADSET_FOLDER = NRF5340_AUDIO_FOLDER / "build/dev_headset"
47
- TARGET_DEV_GATEWAY_FOLDER = NRF5340_AUDIO_FOLDER / "build/dev_gateway"
45
+ TARGET_AUDIO_FOLDER = NRF5340_AUDIO_FOLDER
48
46
49
47
UNICAST_SERVER_OVERLAY = NRF5340_AUDIO_FOLDER / "unicast_server/overlay-unicast_server.conf"
50
48
UNICAST_CLIENT_OVERLAY = NRF5340_AUDIO_FOLDER / "unicast_client/overlay-unicast_client.conf"
@@ -90,35 +88,24 @@ def __print_dev_conf(device_list):
90
88
print (table )
91
89
92
90
93
- def __build_cmd_get (cores : Core , device : AudioDevice , build : BuildType ,
91
+ def __build_cmd_get (core : Core , device : AudioDevice , build : BuildType ,
94
92
pristine , options ):
95
93
96
- build_cmd = (f"west build { TARGET_CORE_APP_FOLDER } "
94
+ build_cmd = (f"west build { TARGET_AUDIO_FOLDER } "
97
95
f"-b { TARGET_BOARD_NRF5340_AUDIO_DK_APP_NAME } "
98
96
f"--sysbuild" )
99
- if Core .app in cores and Core .net in cores :
100
- # No changes to build command, build both cores
101
- pass
102
- elif Core .app in cores :
97
+
98
+ if core == Core .app :
103
99
build_cmd += " --domain nrf5340_audio"
104
- elif Core .net in cores :
100
+ elif core == Core .net :
105
101
build_cmd += " --domain ipc_radio"
106
102
else :
107
103
raise Exception ("Invalid core!" )
108
104
109
- if device == AudioDevice .headset :
110
- dest_folder = TARGET_DEV_HEADSET_FOLDER
111
- elif device == AudioDevice .gateway :
112
- dest_folder = TARGET_DEV_GATEWAY_FOLDER
113
- else :
114
- raise Exception ("Invalid device!" )
115
-
116
105
if build == BuildType .debug :
117
106
release_flag = ""
118
- dest_folder /= TARGET_DEBUG_FOLDER
119
107
elif build == BuildType .release :
120
108
release_flag = " -DFILE_SUFFIX=release"
121
- dest_folder /= TARGET_RELEASE_FOLDER
122
109
else :
123
110
raise Exception ("Invalid build type!" )
124
111
@@ -152,7 +139,9 @@ def __build_cmd_get(cores: Core, device: AudioDevice, build: BuildType,
152
139
if os .name == 'nt' :
153
140
release_flag = release_flag .replace ('\\ ' , '/' )
154
141
if pristine :
155
- build_cmd += " -p"
142
+ build_cmd += " --pristine=auto"
143
+
144
+ dest_folder = TARGET_AUDIO_FOLDER / "build" / options .transport / device / core / build
156
145
157
146
return build_cmd , dest_folder , device_flag , release_flag , overlay_flag
158
147
@@ -199,12 +188,11 @@ def __find_snr():
199
188
def __populate_hex_paths (dev , options ):
200
189
"""Poplulate hex paths where relevant"""
201
190
202
- _ , temp_dest_folder , _ , _ , _ = __build_cmd_get (
203
- Core .app , dev .nrf5340_audio_dk_dev , options .build , options .pristine , options
204
- )
191
+ _ , temp_dest_folder , _ , _ , _ = __build_cmd_get (Core .app , dev .nrf5340_audio_dk_dev , options .build , options .pristine , options )
192
+ dev .hex_path_app = temp_dest_folder / "nrf5340_audio/zephyr/zephyr.hex"
205
193
206
- dev . hex_path_app = temp_dest_folder / "merged.hex"
207
- dev .hex_path_net = temp_dest_folder / "merged_CPUNET .hex"
194
+ _ , temp_dest_folder , _ , _ , _ = __build_cmd_get ( Core . net , dev . nrf5340_audio_dk_dev , options . build , options . pristine , options )
195
+ dev .hex_path_net = temp_dest_folder / "ipc_radio/zephyr/zephyr .hex"
208
196
209
197
210
198
def __finish (device_list ):
@@ -248,7 +236,10 @@ def __main():
248
236
help = "Select which cores to include in build" ,
249
237
)
250
238
parser .add_argument (
251
- "--pristine" , default = False , action = "store_true" , help = "Will build cleanly"
239
+ "--pristine" ,
240
+ default = False ,
241
+ action = "store_true" ,
242
+ help = "Will build cleanly"
252
243
)
253
244
parser .add_argument (
254
245
"-b" ,
@@ -315,7 +306,7 @@ def __main():
315
306
parser .add_argument (
316
307
"-t" ,
317
308
"--transport" ,
318
- required = True ,
309
+ required = True ,
319
310
choices = [i .name for i in Transport ],
320
311
default = Transport .unicast .name ,
321
312
help = "Select the transport type" ,
@@ -384,23 +375,25 @@ def __main():
384
375
build_configs = []
385
376
386
377
if AudioDevice .headset in devices :
387
- build_configs .append (
388
- BuildConf (
389
- core = cores ,
390
- device = AudioDevice .headset ,
391
- pristine = options .pristine ,
392
- build = options .build ,
378
+ for c in cores :
379
+ build_configs .append (
380
+ BuildConf (
381
+ core = c ,
382
+ device = AudioDevice .headset ,
383
+ pristine = options .pristine ,
384
+ build = options .build ,
385
+ )
393
386
)
394
- )
395
387
if AudioDevice .gateway in devices :
396
- build_configs .append (
397
- BuildConf (
398
- core = cores ,
399
- device = AudioDevice .gateway ,
400
- pristine = options .pristine ,
401
- build = options .build ,
402
- )
403
- )
388
+ for c in cores :
389
+ build_configs .append (
390
+ BuildConf (
391
+ core = c ,
392
+ device = AudioDevice .gateway ,
393
+ pristine = options .pristine ,
394
+ build = options .build ,
395
+ )
396
+ )
404
397
405
398
for build_cfg in build_configs :
406
399
__build_module (build_cfg , options )
@@ -412,6 +405,7 @@ def __main():
412
405
for dev in device_list :
413
406
if dev .snr_connected :
414
407
__populate_hex_paths (dev , options )
408
+
415
409
program_threads_run (device_list , sequential = options .sequential_prog )
416
410
417
411
# Program step finished
0 commit comments