mirror of
https://github.com/lora-aprs/LoRa_APRS_iGate.git
synced 2026-02-03 06:14:48 +01:00
split config write
This commit is contained in:
parent
f2b3be1fdd
commit
1a40bc8a94
|
|
@ -35,17 +35,18 @@ class EspDut:
|
|||
self.serial = None
|
||||
self.flash = EspFlash(self.port)
|
||||
|
||||
def writeFlash(self, bin_dir, fs_path=None):
|
||||
def writeFlash(self, bin_dir):
|
||||
self.flash.erase()
|
||||
if fs_path:
|
||||
fs_bin = "spiffs.bin"
|
||||
self.flash.make_spiffs(fs_path, fs_bin)
|
||||
self.flash.write("2686976", fs_bin)
|
||||
self.flash.write("0x1000", f"{bin_dir}/bootloader_dio_40m.bin")
|
||||
self.flash.write("0x8000", f"{bin_dir}/partitions.bin")
|
||||
self.flash.write("0xe000", f"{bin_dir}/boot_app0.bin")
|
||||
self.flash.write("0x10000", f"{bin_dir}/firmware.bin")
|
||||
|
||||
def writeConfig(self, fs_path):
|
||||
fs_bin = "spiffs.bin"
|
||||
self.flash.make_spiffs(fs_path, fs_bin)
|
||||
self.flash.write("0x290000", fs_bin)
|
||||
|
||||
def openPort(self):
|
||||
self.serial = serial.Serial(self.port, 115200, timeout=0)
|
||||
|
||||
|
|
|
|||
1
testlib/testconfig/testconfig.json
Normal file
1
testlib/testconfig/testconfig.json
Normal file
|
|
@ -0,0 +1 @@
|
|||
[]
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
from testlib.esp_dut import ESP
|
||||
from testlib.aprs_con import APRSIS
|
||||
|
||||
|
||||
def test_basic_port(ESP):
|
||||
|
|
@ -13,6 +14,14 @@ def test_flash(ESP):
|
|||
ESP.flash.verify("0x8000", f"{bin_dir}/partitions.bin")
|
||||
ESP.flash.verify("0xe000", f"{bin_dir}/boot_app0.bin")
|
||||
ESP.flash.verify("0x10000", f"{bin_dir}/firmware.bin")
|
||||
|
||||
|
||||
def test_flash_config(ESP):
|
||||
config_dir = "testconfig"
|
||||
ESP.writeConfig(config_dir)
|
||||
|
||||
|
||||
def test_erase(ESP):
|
||||
ESP.flash.erase()
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue