espressif / pytest-embedded

A pytest plugin that designed for embedded testing
https://docs.espressif.com/projects/pytest-embedded/en/latest/
MIT License
93 stars 26 forks source link

Revise the Code Flashing Binaries to Target (RDT-576) #235

Closed hfudev closed 9 months ago

hfudev commented 1 year ago

For now we're calling internal esptool functions while flash. Research if we could

  1. get target

    esp: esptool.ESPLoader = esptool.get_default_connected_device(
        ports,
        port=port,
        connect_attempts=3,
        initial_baud=baud,
        chip=esptool_target,
    )
  2. call esptool.main(*args, esp=esp) to use esptool cli functions

Besides, the subprocess call of esptool existing elsewhere could also be replaced by esptool.main