File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -1229,15 +1229,24 @@ def test_memory_dump(self):
1229
1229
assert "to 'memout.bin'" in output
1230
1230
os .remove ("memout.bin" )
1231
1231
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" )
1234
1243
assert "Wrote 0xabad1dea" in output
1235
1244
assert "mask 0x0000ffff" in output
1236
- assert "to 0x400c0000 " in output
1245
+ assert f "to { test_address :#x } " in output
1237
1246
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
1241
1250
1242
1251
1243
1252
class TestKeepImageSettings (EsptoolTestCase ):
You can’t perform that action at this time.
0 commit comments