You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi.
Installed the latest version today and noticed something I hadn't seen before. Maybe not due to an update but perhaps a change in where the default pack comes from on my setup.
sys:1: ResourceWarning: unclosed file <_io.BufferedReader name='C:\\WorkingDir\\tm_fct_calibration\\.venv\\Lib\\site-packages\\pyocd\\debug\\svd\\svd_data.zip'>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
Looking into it when a board is created as part of a session and the memory map is created a zip stream seems to be made here:
class SVDFile(object):
@classmethod
def from_builtin(cls, svd_name):
try:
zip_ref = importlib_resources.files("pyocd").joinpath(BUILTIN_SVD_DATA_PATH)
zip_stream = zip_ref.open('rb')
zip = zipfile.ZipFile(zip_stream, 'r')
return SVDFile(zip.open(svd_name))
except (KeyError, FileNotFoundError, zipfile.BadZipFile) as err:
from ...core.session import Session
LOG.warning("unable to open builtin SVD file: %s", err, exc_info=Session.get_current().log_tracebacks)
return None
But it is not clear to me where this reference is closed so maybe that is what generates the warning. I can see the session is closed when my application exits. My usage is:
with ConnectHelper.session_with_chosen_probe(blocking=False) as session:
board = session.board
target = board.target
flash = target.memory_map.get_boot_memory()
# Load firmware into device.
FileProgrammer(session).program(filename)
# Flash a single phrase without erasing to set the serial number
flasher = Flash(target, flash.algo)
flasher.region = flash
flasher.init(operation=Flash.Operation.PROGRAM)
flasher.program_phrase(address=0x10001080, bytes=[serial_lsb, serial_msb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff])
# Reset, run.
target.reset_and_halt()
target.resume()
Thanks
Ed
The text was updated successfully, but these errors were encountered:
Hi.
Installed the latest version today and noticed something I hadn't seen before. Maybe not due to an update but perhaps a change in where the default pack comes from on my setup.
Looking into it when a board is created as part of a session and the memory map is created a zip stream seems to be made here:
But it is not clear to me where this reference is closed so maybe that is what generates the warning. I can see the session is closed when my application exits. My usage is:
Thanks
Ed
The text was updated successfully, but these errors were encountered: