mirror of
https://github.com/hathach/tinyusb.git
synced 2025-02-23 00:40:12 +00:00
Merge pull request #2715 from hathach/more-hil-pi5
hil flash itsybitsy m4 with picoprobe
This commit is contained in:
commit
1ba88ff3ac
@ -114,11 +114,10 @@ def read_disk_file(id, fname):
|
|||||||
# Flashing firmware
|
# Flashing firmware
|
||||||
# -------------------------------------------------------------
|
# -------------------------------------------------------------
|
||||||
def run_cmd(cmd):
|
def run_cmd(cmd):
|
||||||
# print(cmd)
|
#print(cmd)
|
||||||
r = subprocess.run(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
r = subprocess.run(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
title = 'command error'
|
|
||||||
if r.returncode != 0:
|
if r.returncode != 0:
|
||||||
# print build output if failed
|
title = 'command error'
|
||||||
if os.getenv('CI'):
|
if os.getenv('CI'):
|
||||||
print(f"::group::{title}")
|
print(f"::group::{title}")
|
||||||
print(r.stdout.decode("utf-8"))
|
print(r.stdout.decode("utf-8"))
|
||||||
@ -156,23 +155,23 @@ def flash_esptool(board, firmware):
|
|||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
||||||
def doublereset_with_rpi_gpio(board):
|
def doublereset_with_rpi_gpio(pin):
|
||||||
# Off = 0 = Reset
|
# Off = 0 = Reset
|
||||||
led = gpiozero.LED(board["flasher_reset_pin"])
|
nrst = gpiozero.LED(pin)
|
||||||
|
|
||||||
led.off()
|
nrst.off()
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
led.on()
|
nrst.on()
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
led.off()
|
nrst.off()
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
led.on()
|
nrst.on()
|
||||||
|
|
||||||
|
|
||||||
def flash_bossac(board, firmware):
|
def flash_bossac(board, firmware):
|
||||||
# double reset to enter bootloader
|
# double reset to enter bootloader
|
||||||
if platform.machine() == 'aarch64':
|
if platform.machine() == 'aarch64':
|
||||||
doublereset_with_rpi_gpio(board)
|
doublereset_with_rpi_gpio(board["flasher_reset_pin"])
|
||||||
|
|
||||||
port = get_serial_dev(board["uid"], board["flashser_vendor"], board["flasher_product"], 0)
|
port = get_serial_dev(board["uid"], board["flashser_vendor"], board["flasher_product"], 0)
|
||||||
timeout = ENUM_TIMEOUT
|
timeout = ENUM_TIMEOUT
|
||||||
@ -367,7 +366,10 @@ def main():
|
|||||||
test_list.remove(skip)
|
test_list.remove(skip)
|
||||||
|
|
||||||
for test in test_list:
|
for test in test_list:
|
||||||
fw_name = f'cmake-build/cmake-build-{name}/device/{test}/{test}'
|
fw_dir = f'cmake-build/cmake-build-{name}/device/{test}'
|
||||||
|
if not os.path.exists(fw_dir):
|
||||||
|
fw_dir = f'examples/cmake-build-{name}/device/{test}'
|
||||||
|
fw_name = f'{fw_dir}/{test}'
|
||||||
print(f' {test} ...', end='')
|
print(f' {test} ...', end='')
|
||||||
|
|
||||||
# flash firmware. It may fail randomly, retry a few times
|
# flash firmware. It may fail randomly, retry a few times
|
||||||
|
@ -17,11 +17,9 @@
|
|||||||
{
|
{
|
||||||
"name": "itsybitsy_m4",
|
"name": "itsybitsy_m4",
|
||||||
"uid": "D784B28C5338533335202020FF044726",
|
"uid": "D784B28C5338533335202020FF044726",
|
||||||
"flasher": "bossac",
|
"flasher": "openocd",
|
||||||
"flashser_vendor": "Adafruit Industries",
|
"flasher_sn": "E6614C311B597D32",
|
||||||
"flasher_product": "ItsyBitsy M4 Express",
|
"flasher_args": "-f interface/cmsis-dap.cfg -f target/atsame5x.cfg -c \"adapter speed 5000\""
|
||||||
"flasher_reset_pin": "2",
|
|
||||||
"flasher_args": "--offset 0x4000"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "espressif_s3_devkitm",
|
"name": "espressif_s3_devkitm",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user