Skip to content

Commit 1ba88ff

Browse files
authored
Merge pull request #2715 from hathach/more-hil-pi5
hil flash itsybitsy m4 with picoprobe
2 parents 7ff5202 + 5edc845 commit 1ba88ff

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

test/hil/hil_test.py

+13-11
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,10 @@ def read_disk_file(id, fname):
114114
# Flashing firmware
115115
# -------------------------------------------------------------
116116
def 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

172171
def 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

test/hil/rpi.json

+3-5
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@
1717
{
1818
"name": "itsybitsy_m4",
1919
"uid": "D784B28C5338533335202020FF044726",
20-
"flasher": "bossac",
21-
"flashser_vendor": "Adafruit Industries",
22-
"flasher_product": "ItsyBitsy M4 Express",
23-
"flasher_reset_pin": "2",
24-
"flasher_args": "--offset 0x4000"
20+
"flasher": "openocd",
21+
"flasher_sn": "E6614C311B597D32",
22+
"flasher_args": "-f interface/cmsis-dap.cfg -f target/atsame5x.cfg -c \"adapter speed 5000\""
2523
},
2624
{
2725
"name": "espressif_s3_devkitm",

0 commit comments

Comments
 (0)