test(esp32p4): Fix memory tests for ECO5 revision

* Use different address to read/write register
This commit is contained in:
Jaroslav Safka
2025-09-03 13:45:06 +02:00
parent 6c10050fd3
commit 8f21f43e6d

View File

@@ -1229,15 +1229,24 @@ class TestMemoryOperations(EsptoolTestCase):
assert "to 'memout.bin'" in output
os.remove("memout.bin")
def test_memory_write(self):
output = self.run_esptool("write-mem 0x400C0000 0xabad1dea 0x0000ffff")
@pytest.fixture
def test_address(self):
"""
Return a RAM address suitable for memory read/write tests.
ESP32-P4 has different RAM ranges. Address 0x4FF90000 is just
inside the range and unused.
"""
return 0x4FF90000 if arg_chip == "esp32p4" else 0x400C0000
def test_memory_write(self, test_address):
output = self.run_esptool(f"write-mem {test_address:#X} 0xabad1dea 0x0000ffff")
assert "Wrote 0xabad1dea" in output
assert "mask 0x0000ffff" in output
assert "to 0x400c0000" in output
assert f"to {test_address:#x}" in output
def test_memory_read(self):
output = self.run_esptool("read-mem 0x400C0000")
assert "0x400c0000 =" in output
def test_memory_read(self, test_address):
output = self.run_esptool(f"read-mem {test_address:#X}")
assert f"{test_address:#x} =" in output
class TestKeepImageSettings(EsptoolTestCase):