@@ -114,11 +114,10 @@ def read_disk_file(id, fname):
114114# Flashing firmware
115115# -------------------------------------------------------------
116116def run_cmd (cmd ):
117- # print(cmd)
117+ #print(cmd)
118118 r = subprocess .run (cmd , shell = True , stdout = subprocess .PIPE , stderr = subprocess .STDOUT )
119- title = 'command error'
120119 if r .returncode != 0 :
121- # print build output if failed
120+ title = 'command error'
122121 if os .getenv ('CI' ):
123122 print (f"::group::{ title } " )
124123 print (r .stdout .decode ("utf-8" ))
@@ -156,23 +155,23 @@ def flash_esptool(board, firmware):
156155 return ret
157156
158157
159- def doublereset_with_rpi_gpio (board ):
158+ def doublereset_with_rpi_gpio (pin ):
160159 # Off = 0 = Reset
161- led = gpiozero .LED (board [ "flasher_reset_pin" ] )
160+ nrst = gpiozero .LED (pin )
162161
163- led .off ()
162+ nrst .off ()
164163 time .sleep (0.1 )
165- led .on ()
164+ nrst .on ()
166165 time .sleep (0.1 )
167- led .off ()
166+ nrst .off ()
168167 time .sleep (0.1 )
169- led .on ()
168+ nrst .on ()
170169
171170
172171def flash_bossac (board , firmware ):
173172 # double reset to enter bootloader
174173 if platform .machine () == 'aarch64' :
175- doublereset_with_rpi_gpio (board )
174+ doublereset_with_rpi_gpio (board [ "flasher_reset_pin" ] )
176175
177176 port = get_serial_dev (board ["uid" ], board ["flashser_vendor" ], board ["flasher_product" ], 0 )
178177 timeout = ENUM_TIMEOUT
@@ -367,7 +366,10 @@ def main():
367366 test_list .remove (skip )
368367
369368 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 } '
371373 print (f' { test } ...' , end = '' )
372374
373375 # flash firmware. It may fail randomly, retry a few times
0 commit comments