-
Notifications
You must be signed in to change notification settings - Fork 138
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 jtag2updi -xrtsdtr extended parameter #1425
Conversation
src/jtagmkII.c
Outdated
@@ -1215,6 +1219,11 @@ static int jtagmkII_initialize(const PROGRAMMER *pgm, const AVRPART *p) { | |||
int ok; | |||
const char *ifname; | |||
|
|||
if (PDATA(pgm)->rts_mode != RTS_MODE_DEFAULT) { | |||
pmsg_warning("forcing serial DTR/RTS handshake lines %s\n", |
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.
Isn't this a running commentary pmsg_info()
rather than a warning?
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.
I ended up using pmsg_warning
because that's what the SerialUPDI programmer does. But it would make sense to use pmsg_info
instead for both the jtag2updi and serialupdi programmer
src/doc/avrdude.texi
Outdated
@item serialupdi | ||
|
||
The serialupdi programmer type accepts the following extended parameter: | ||
The jtag2updi and serialupdi programmer types accepts the following extended parameters: |
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.
types accept (not accepts)
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.
Thanks! It's these things that always get me
Looks good though cannot test functionality. I suspect there are going to be a number of conflicts with the previous PR #1324, which is an unfortunate coincidence, but lets cross that bridge when we come to it. I normally merge in batches but within batches in historic order (first PR gets merged first). |
I assume you mean PR #1424? Merge that first, and I'll rebase upon that, no worries |
@mcuee do you have a chance to test this PR with your hardware as well? You can use a multimeter or an oscilloscope and measure directly on the RTS or DTR line. It should stay high or low during the entire programming session (terminal mode as well), depending on the user-provided |
It seems to me I do not have the right hardware to carry out the test. Just one question about your setup of jtag2updi and target for this PR.
Official Uno Rev 3: Typical CH340x based clone |
You're absolutely correct. In order to utilize this functionality, one would have to design a dedicated jtag2updi programmer and construct it similar to the way the SerialUPDI programmer is constructed. Even though I'm not planning to sell a jtag2updi programmer that has this feature, it could be useful for future programmers. For instance, the Nano Every could have been using this feature to switch between UART and UPDI mode instead of the pesky 1200bps touch hack. If you want to check if this works on your UNO, trace down the other side of the auto-reset capacitor (which is connected to the DTR or RTS pin) and see how it behaves. |
I will test this next Monday when I have the access to the equipment. |
OK, so will leave this PR unmerged when I merge the other PRs, probably this (European) evening |
Somehow I do not get the desire results on my Arduino Uno clone. It could be due the pin-out is different. I will see if I can test with another Arduino Uno clone.
|
So I get another Arduino Clone which follows the official design (using ATmeag16U2 as the USB to Serial chip). And the results are the same as above. Then I see why my testing is not good, the design is using CTS plus capacitor for the reset pin. not DTR or RTS. The RTS pin is not exposed so I can not probe it. In the end, I do not have the right HW to carry out the test. |
Anyway this PR needs to be updated to resolve the conflicts. After that, maybe this PR can be merged if the test results from @MCUdude is positive and the review from @stefanrueger is positive. |
Merge conflict resolved 👍 |
Looks good: ready to be merged. Also probably the last merge of code before v7.2 apart from fixes arising from tests. |
This PR lets the user control the RTS/DTR line on the UART line when using the jtag2updi programmer. This may be useful for controlling external hardware, such as switching between UPDI programming and UART mode. See #1408 for details