Skip to content

Commit 8f21f43

Browse files
committed
test(esp32p4): Fix memory tests for ECO5 revision
* Use different address to read/write register
1 parent 6c10050 commit 8f21f43

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

test/test_esptool.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,15 +1229,24 @@ def test_memory_dump(self):
12291229
assert "to 'memout.bin'" in output
12301230
os.remove("memout.bin")
12311231

1232-
def test_memory_write(self):
1233-
output = self.run_esptool("write-mem 0x400C0000 0xabad1dea 0x0000ffff")
1232+
@pytest.fixture
1233+
def test_address(self):
1234+
"""
1235+
Return a RAM address suitable for memory read/write tests.
1236+
ESP32-P4 has different RAM ranges. Address 0x4FF90000 is just
1237+
inside the range and unused.
1238+
"""
1239+
return 0x4FF90000 if arg_chip == "esp32p4" else 0x400C0000
1240+
1241+
def test_memory_write(self, test_address):
1242+
output = self.run_esptool(f"write-mem {test_address:#X} 0xabad1dea 0x0000ffff")
12341243
assert "Wrote 0xabad1dea" in output
12351244
assert "mask 0x0000ffff" in output
1236-
assert "to 0x400c0000" in output
1245+
assert f"to {test_address:#x}" in output
12371246

1238-
def test_memory_read(self):
1239-
output = self.run_esptool("read-mem 0x400C0000")
1240-
assert "0x400c0000 =" in output
1247+
def test_memory_read(self, test_address):
1248+
output = self.run_esptool(f"read-mem {test_address:#X}")
1249+
assert f"{test_address:#x} =" in output
12411250

12421251

12431252
class TestKeepImageSettings(EsptoolTestCase):

0 commit comments

Comments
 (0)