Skip to content

Commit

Permalink
fix: fpgasudpate set estimated time to timeout
Browse files Browse the repository at this point in the history
 Example: fpgasudpate  estimated time 0.04 seconds and timeout 1 seconds, progress bar shows 2000%

 sudo fpgasupdate /root/users/varsha/test_fpga_utils/cmc_collaterals/sr/sr_rkh.bin 38:00.1
 *** Programming a Root Entry Hash or Key Cancellation cannot be undone! Continue? [yes/No]> yes
 [2024-01-18 23:16:58.70] [WARNING ] Update starting. Please do not interrupt.
 [2024-01-18 23:16:58.70] [INFO    ] updating from file /root/users/varsha/test_fpga_utils/cmc_collaterals/sr/sr_rkh.bin with size 1152
 [2024-01-18 23:16:58.70] [INFO    ] waiting for idle
 [2024-01-18 23:16:58.70] [INFO    ] preparing image file
 [2024-01-18 23:17:07.72] [INFO    ] writing image file
 (100%) [████████████████████] [1152/1152 bytes][Elapsed Time: 0:00:00.00]
 [2024-01-18 23:17:07.72] [INFO    ] programming image file
 (2491%) [██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████][Elapsed Time: 0:00:01.00]
 [2024-01-18 23:17:08.72] [ERROR   ] programming:hw-error
 [2024-01-18 23:17:08.72] [INFO    ] Total time: 0:00:10.02

 fix: set estimated time to timeout if estimated time below 1 second (progress time set to 100%)

 sudo ./fpgasupdate.py  /root/users/varsha/test_fpga_utils/cmc_collaterals/sr/sr_rkh.bin 38:00.1
 *** Programming a Root Entry Hash or Key Cancellation cannot be undone! Continue? [yes/No]> yes
 [2024-01-18 23:17:49.68] [WARNING ] Update starting. Please do not interrupt.
 [2024-01-18 23:17:49.68] [INFO    ] updating from file /root/users/varsha/test_fpga_utils/cmc_collaterals/sr/sr_rkh.bin with size 1152
 [2024-01-18 23:17:49.68] [INFO    ] waiting for idle
 [2024-01-18 23:17:49.68] [INFO    ] preparing image file
 [2024-01-18 23:17:58.69] [INFO    ] writing image file
 (100%) [████████████████████] [1152/1152 bytes][Elapsed Time: 0:00:00.00]
 [2024-01-18 23:17:58.70] [INFO    ] programming image file
 (100%) [████████████████████][Elapsed Time: 0:00:01.00]
 [2024-01-18 23:17:59.70] [ERROR   ] programming:hw-error
 [2024-01-18 23:17:59.70] [INFO    ] Total time: 0:00:10.02

Signed-off-by: anandaravuri <[email protected]>
  • Loading branch information
anandaravuri committed Jan 18, 2024
1 parent 9ba83ec commit e1cc136
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/opae.admin/opae/admin/tools/fpgasupdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,9 @@ def update_fw_sysfs(infile, pac):

retries = 0
max_retries = 60 * 60 * 3
if estimated_time < timeout:
estimated_time = timeout

with progress(time=estimated_time, **progress_cfg) as prg:
while status.value in ('writing', 'programming', 'transferring'):
time.sleep(timeout)
Expand Down

0 comments on commit e1cc136

Please sign in to comment.