[BUG] Running flash.py failed in host-docker 6.0.6 with DriveOrinDevkit

Required Info:

  • Software Version
    DRIVE OS 6.0.6

  • Target OS
    Linux

  • SDK Manager Version
    1.9.2.10884

  • Host Machine Version
    native Ubuntu Linux 20.04 Host installed with DRIVE OS DOCKER Containers

  • board name
    p3710-10-s05

Describe the bug

According to PCIe Hot-Plug not working - #15 by BruceYangNV , in order to flash orin with soc_id, the flash.py in host-docker should be used, rather than sdk-manager.

I think the default image on P3710 didn’t set the correct soc_id by default.
Furthermore, If I remember correctly, the SDK manager doesn’t support option “-s”.

There is an error when running flash.py

To Reproduce

zs@in-sdk-docker:/drive$ sudo -H python3 ./flash.py /dev/ttyACM0 p3710-10-s05
Traceback (most recent call last):
  File "./flash.py", line 19, in <module>
    from preflash import PreflashCheck
  File "/drive/drive_flashing/preflash.py", line 22, in <module>
    isSafety = "-safety" if os.environ["DRIVEOS_VARIANT"].endswith("safety") else ""
  File "/usr/lib/python3.8/os.py", line 675, in __getitem__
    raise KeyError(key) from None
KeyError: 'DRIVEOS_VARIANT'

Additional context

echo $DRIVEOS_VARIANT
linux

board_name is got using

cd /drive/drive-foundation/tools/flashtools
sudo -H python3 ./bootburn/bootburn.py --find_board_name -x /dev/ttyACM1

try to use python in terminal won’t reproduce the bug.

zs@in-sdk-docker:/drive$ python3
Python 3.8.10 (default, May 26 2023, 14:05:08) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> isSafety = "-safety" if os.environ["DRIVEOS_VARIANT"].endswith("safety") else ""
>>> 

try to delete *.pyc doesn’t work.

zs@in-sdk-docker:/drive$ sudo find . -name \*.pyc -delete
zs@in-sdk-docker:/drive$ sudo -H python3 ./flash.py /dev/ttyACM1 p3710-10-s05
Traceback (most recent call last):
  File "./flash.py", line 19, in <module>
    from preflash import PreflashCheck
  File "/drive/drive_flashing/preflash.py", line 22, in <module>
    isSafety = "-safety" if os.environ["DRIVEOS_VARIANT"].endswith("safety") else ""
  File "/usr/lib/python3.8/os.py", line 675, in __getitem__
    raise KeyError(key) from None
KeyError: 'DRIVEOS_VARIANT'

sudo -E -H python3 ./flash.py /dev/ttyACM0 p3710 solves the issue.

Thank you for letting us know. Set Up DRIVE OS Linux with NVIDIA GPU Cloud (NGC) | NVIDIA Docs is the related document.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.