Spyro-Soft / scargo

Python-based package manager based on RUST cargo idea.
MIT License
48 stars 10 forks source link

`[flash]` Add port name option #52

Closed icesar-spyro closed 1 year ago

icesar-spyro commented 1 year ago

scargo flash --port <port name e.g. /dev/ttyUSB0>

jze-spyro commented 1 year ago

I've started doing it, but I can't change the status, because I don't have write access yet

jze-spyro commented 1 year ago

It seems that it should also work for stm32, but our current setup can't be extended with this option, and I don't feel competent to change the setup.

fkuatspyro commented 1 year ago

Partially done (esp only) with version 1.0.7.

aaksenczuk commented 1 year ago

Proposed change the port should be added in the following way to work with esptool: esptool.py --chip esp32 --port=/dev/ttyUSB0 write_flash --flash_mode dio --flash_freq 80m --flash_size 4MB 0x1000 bootloader/bootloader.bin 0x10000 esp32-ihub-scargo.bin 0x8000 partition_table/partition-table.bin 0xd000 ota_data_initial.bin
esptool.py v3.3.2 Serial port /dev/ttyUSB0 Connecting....... Chip is ESP32-D0WD-V3 (revision 3)

Example of the problem: aak@da3c6982b4db:/workspace$ scargo flash --fs --port /dev/ttyUSB0 usage: ESP-IDF Partitions Tool [-h] [--quiet] [--esptool-args ESPTOOL_ARGS [ESPTOOL_ARGS ...]] [--esptool-write-args ESPTOOL_WRITE_ARGS [ESPTOOL_WRITE_ARGS ...]] [--esptool-read-args ESPTOOL_READ_ARGS [ESPTOOL_READ_ARGS ...]] [--esptool-erase-args ESPTOOL_ERASE_ARGS [ESPTOOL_ERASE_ARGS ...]] [--port PORT] [--baud BAUD] [--partition-table-offset PARTITION_TABLE_OFFSET] [--partition-table-file PARTITION_TABLE_FILE] {read_partition,write_partition,erase_partition,get_partition_info} ... ESP-IDF Partitions Tool: error: unrecognized arguments: --port=/dev/ttyUSB0 scargo ERROR: ['parttool.py', 'write_partition', '--partition-name=spiffs', '--input=/workspace/build/spiffs.bin', '--port=/dev/ttyUSB0'] fail

jze-spyro commented 1 year ago

@aaksenczuk This should be a new issue. This issue remains open, because we haven't added the port option for stm32. Since now you're making this about a fix for esp, are you going to close it when this issue is fixed?

By the way, from the error message it seems the problem is related to parttool.py rather than esptool.py (maybe both).

aaksenczuk commented 1 year ago

@aaksenczuk This should be a new issue. This issue remains open, because we haven't added the port option for stm32. Since now you're making this about a fix for esp, are you going to close it when this issue is fixed?

By the way, from the error message it seems the problem is related to parttool.py rather than esptool.py (maybe both).

Actually present PR(#229) is covering albo the stm32 port management: (Update port command to work with stm32 and esp32: stm32: stlinkv2 command line: ./st-flash [--debug] [--reset] [--serial ] [--format ] [--flash=] {read|write} stlinkv2 command line: ./st-flash [--debug] [--serial ] erase)

if this is not a problem I will keep it as single task managing the port

rap-spyro commented 1 year ago

Fixed in #229