Conversation
cf48f91 to
dad2d59
Compare
|
please use imperative mood in commit message ("add" instead of "adding") |
JIRA: CI-249
dad2d59 to
7cdfd6c
Compare
Unit Test Results7 156 tests - 98 6 454 ✅ - 89 36m 53s ⏱️ - 1m 20s For more details on these failures, see this check. Results for commit 7cdfd6c. ± Comparison against base commit 609cb06. This pull request removes 99 and adds 1 tests. Note that renamed tests count towards both. |
| return builder.get_harness() | ||
|
|
||
|
|
||
| class MimasSparcV8EvkTarget(GR716Target): |
There was a problem hiding this comment.
So, if I understand correctly, the target is not Sparcv8Leon3, but GR716, which is based on the Sparcv8Leon3 architecture. So, shouldn't it be the other way around, something like GR716-mimas-EvkTarget(SparcV8Target)
| while True: | ||
| inChar = self.dut.read() | ||
| inChar += inChar | ||
|
|
||
| if "Bootloader" in inChar: | ||
| with open(f"{boot_dir}/{image}", "rb") as fd: | ||
| filebuff = fd.read() | ||
| time.sleep(1) | ||
| self.dut.serial.write(filebuff) | ||
|
|
||
| try: | ||
| self.dut.expect_exact("(psh)%", timeout=80) | ||
| fd.close() | ||
| break | ||
|
|
||
| except pexpect.TIMEOUT as e: | ||
| fd.close() | ||
| raise FlashError( | ||
| msg=str(e), | ||
| output=e.stdout.decode("ascii") if e.stdout else None, | ||
| ) from e |
There was a problem hiding this comment.
We can simplify this by knowing that dut is a wrapper around pexpect. For example, by expecting the appearance of the Bootloader instead of catching each character.
Example of simplified code that should work:
with open(f"{boot_dir}/{image}", "rb") as fd:
try:
self.dut.expect_exact("Bootloader", timeout=60)
time.sleep(1)
self.dut.serial.write(fd.read())
self.dut.expect_exact("(psh)%", timeout=80)
except pexpect.TIMEOUT as e:
raise FlashError(
msg="Timeout waiting for boatloader prompt or psh prompt.",
output=e.stdout.decode("ascii") if e.stdout else None,
) from eRemember also that when you use a context manager in Python, it automatically handles the closing of resources opened within it, so you don't need to manually close them with fd.close()
JIRA: CI-249
Description
Motivation and Context
Types of changes
How Has This Been Tested?
Checklist:
Special treatment
requirements: add library to detect & reset USB devices #333
(It also needs to update docker images in order to run GH Actions)
add DMA configuration for
gr716-mimasphoenix-rtos-project#1018sparcv8leon3: add DMA support to uart driver phoenix-rtos-devices#469