Skip to content

Commit

Permalink
Update flash.py with additional option for ESP activation
Browse files Browse the repository at this point in the history
  • Loading branch information
angelom93 committed Feb 13, 2024
1 parent 27522c7 commit 17ccaaa
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion flash.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@


def help() -> None:
print(f'{sys.argv[0]} [nano | xavier | orin] [nand | v05]')
print(f'{sys.argv[0]} [nano | xavier | orin] [nand | v05] [usb | /dev/<name>] [enable]')
print(f' nano flashing Jetson Nano (default)')
print(f' xavier flashing Jetson Xavier')
print(f' orin flashing Jetson Orin')
print(f' nand Robot Brain has piggyboard with NAND gate (eg. older version)')
print(f' v05 Robot Brain has piggyboard with V0.5 or higher (eg. newer version)')
print(f' usb use /dev/tty.SLAB_USBtoUART as serial device')
print(f' /dev/<name> use /dev/<name> as serial device')
print(f' enable enable the ESP32 microcontroller')


if any(h in sys.argv for h in ['--help', '-help', 'help']):
Expand All @@ -28,6 +29,12 @@ def help() -> None:
device = p
esp = Esp(nand='nand' in sys.argv, xavier='xavier' in sys.argv, orin='orin' in sys.argv, v05='v05' in sys.argv, device=device)

if 'enable' in sys.argv:
with esp.pin_config():
print('Enabling ESP...')
esp.activate()
sys.exit()

with esp.pin_config(), esp.flash_mode():
print('Flashing...')
result = subprocess.run([
Expand Down

0 comments on commit 17ccaaa

Please sign in to comment.