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 @@ -1170,15 +1170,24 @@ def test_memory_dump(self):
11701170 assert "Read 128 bytes" in output
11711171 os .remove ("memout.bin" )
11721172
1173- def test_memory_write (self ):
1174- output = self .run_esptool ("write_mem 0x400C0000 0xabad1dea 0x0000ffff" )
1173+ @pytest .fixture
1174+ def test_address (self ):
1175+ """
1176+ Return a RAM address suitable for memory read/write tests.
1177+ ESP32-P4 has different RAM ranges. Address 0x4FF90000 is just
1178+ inside the range and unused.
1179+ """
1180+ return 0x4FF90000 if arg_chip == "esp32p4" else 0x400C0000
1181+
1182+ def test_memory_write (self , test_address ):
1183+ output = self .run_esptool (f"write_mem { test_address :#X} 0xabad1dea 0x0000ffff" )
11751184 assert "Wrote abad1dea" in output
11761185 assert "mask 0000ffff" in output
1177- assert "to 400c0000 " in output
1186+ assert f "to { test_address :x } " in output
11781187
1179- def test_memory_read (self ):
1180- output = self .run_esptool ("read_mem 0x400C0000 " )
1181- assert "0x400c0000 =" in output
1188+ def test_memory_read (self , test_address ):
1189+ output = self .run_esptool (f "read_mem { test_address :#X } " )
1190+ assert f" { test_address :#x } =" in output
11821191
11831192
11841193class TestKeepImageSettings (EsptoolTestCase ):
You can’t perform that action at this time.
0 commit comments