@@ -114,11 +114,10 @@ def read_disk_file(id, fname):
114
114
# Flashing firmware
115
115
# -------------------------------------------------------------
116
116
def run_cmd (cmd ):
117
- # print(cmd)
117
+ #print(cmd)
118
118
r = subprocess .run (cmd , shell = True , stdout = subprocess .PIPE , stderr = subprocess .STDOUT )
119
- title = 'command error'
120
119
if r .returncode != 0 :
121
- # print build output if failed
120
+ title = 'command error'
122
121
if os .getenv ('CI' ):
123
122
print (f"::group::{ title } " )
124
123
print (r .stdout .decode ("utf-8" ))
@@ -156,23 +155,23 @@ def flash_esptool(board, firmware):
156
155
return ret
157
156
158
157
159
- def doublereset_with_rpi_gpio (board ):
158
+ def doublereset_with_rpi_gpio (pin ):
160
159
# Off = 0 = Reset
161
- led = gpiozero .LED (board [ "flasher_reset_pin" ] )
160
+ nrst = gpiozero .LED (pin )
162
161
163
- led .off ()
162
+ nrst .off ()
164
163
time .sleep (0.1 )
165
- led .on ()
164
+ nrst .on ()
166
165
time .sleep (0.1 )
167
- led .off ()
166
+ nrst .off ()
168
167
time .sleep (0.1 )
169
- led .on ()
168
+ nrst .on ()
170
169
171
170
172
171
def flash_bossac (board , firmware ):
173
172
# double reset to enter bootloader
174
173
if platform .machine () == 'aarch64' :
175
- doublereset_with_rpi_gpio (board )
174
+ doublereset_with_rpi_gpio (board [ "flasher_reset_pin" ] )
176
175
177
176
port = get_serial_dev (board ["uid" ], board ["flashser_vendor" ], board ["flasher_product" ], 0 )
178
177
timeout = ENUM_TIMEOUT
@@ -367,7 +366,10 @@ def main():
367
366
test_list .remove (skip )
368
367
369
368
for test in test_list :
370
- fw_name = f'cmake-build/cmake-build-{ name } /device/{ test } /{ test } '
369
+ fw_dir = f'cmake-build/cmake-build-{ name } /device/{ test } '
370
+ if not os .path .exists (fw_dir ):
371
+ fw_dir = f'examples/cmake-build-{ name } /device/{ test } '
372
+ fw_name = f'{ fw_dir } /{ test } '
371
373
print (f' { test } ...' , end = '' )
372
374
373
375
# flash firmware. It may fail randomly, retry a few times
0 commit comments