-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for programming from intel hex files #37
Conversation
e1f206f
to
19f786f
Compare
This looks like a very nice feature, and will make the script more useful! Let me play around with it a little bit (and pull the 26xx support first), and we'll try to get it in there. |
ce369a1
to
8c143c9
Compare
This is rebased and ready for consideration |
|
||
If you want to be able to program your device from an intel hex file, you will also need to install the following: | ||
|
||
* IntelHex: https://pypi.python.org/pypi/IntelHex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add 'pip install intelhex' here? One less link to visit for the programmer that's less familiar with python.
Sorry for the delay on these. This PR seems to work great! Tested with 2.7 and 3.4. I made some small comments inline. One thing I noticed: when you don't have the extra libs installed and you're trying to upload a hex file, it'll treat the file as a normal bin. If the file has the correct length it gets uploaded (but doesn't work of course), if not, you get an error about the size not being a multiple of 4. This behavior is to be expected, but there's never a hint to what is going wrong and how you can fix it (without activating verbose mode or looking at the readme). Would it make sense to check the filename extension for Any ideas? This is not a big issue btw, I'm willing to pull as-is. |
a06e3de
to
9dcedc3
Compare
@JelmerT thanks for the feedback. I've rebased this on top of current master and implemented a new logic:
I think the verb is always "program" in En-GB! |
Hmm hang on, this is buggy. Do not merge |
Supports file type auto-detection (.bin vs .hex)
9dcedc3
to
8b651c1
Compare
There we go, ready for consideration now! |
Works like a charm! This is very good stuff, thanks @g-oikonomou ! |
Add support for programming from intel hex files
This will need rebased, but feel free to have a look at the feature. It is implemented in the last 4 commits of this pull.
Requires
IntelHex
andpython-magic
in site-packages.With those packages available, we auto-detect the firmware type.
If those packages are not available, support for .hex will be disabled gracefully and the script will still work the way it does
notfor bin files.