mraardvark / pyupdi

Python UPDI driver for programming "new" tinyAVR and megaAVR devices
MIT License
212 stars 73 forks source link

Use entry_point instead of scripts for automatic Windows exe via pip #64

Closed mon closed 4 years ago

mon commented 4 years ago

Using scripts in setup.py means you have to run pyupdi (on linux only) via pyupdi.py. This doesn't work on Windows at all since .py files cannot be executed directly. Using entry_points will install on Linux to pyupdi and on Windows to pyupdi.exe, accessible as long as the Python Scripts folder is on the path.

mraardvark commented 4 years ago

Fair enough 👍 I am (clearly) not really maintaining this code very actively. Part of the reason for this is that the pyupdi "backend" is now embedded in pymcuprog which is on PyPi. It is still missing full UPDI device support, which I am hoping will be pushed soon. Any interest in testing pymcuprog for your use-case?

mon commented 4 years ago

Ooh, interesting! I was drawn to pyupdi because the usecase is extremely simple and integrated into my toolchain nicely, without worrying about expensive programmers. Plus, you even have a wiring diagram in the README.

pymcuprog's documentation didn't really explain things well, so I initially ignored it. It definitely seems like it's missing a lot of ease of use at the moment. Tried two commandlines pymcuprog -v -t updi -d tiny404 -u COM14 write -f main.hex pymcuprog -v -t uart -d tiny404 -u COM14 write -f main.hex

Type updi didn't even try and connect via serial, and tiny404 showed a missing part - probably need to provide a packs folder. Easier for me to go back to making PRs for pyupdi for the time being :)

mraardvark commented 4 years ago

Sure, go ahead and try to keep pyupdi alive. pymcuprog is primarily for using the cmsis-dap tools (eg: nedbg) but the pyupdi " backend" fits in under -t uart -u COMx. Devices are supported natively, so we need to add more manually for now (PICs use installed packs)

out of interest, just try: pymcuprog -v -t uart -d tiny1607 -u COM14 ping

mon commented 4 years ago

Ooh, that's done the trick. Apart from an ID mismatch which I expected to happen (got 1E9226 need 1E9423) it pinged without issue, so the backend definitely works! I'll keep checking in and migrate when there's some more device support.

mraardvark commented 4 years ago

Nice, thanks :) Since its pip installed you technically would have to hack your site-packages to add devices manually, but sooner or later we will get more out...