-
Notifications
You must be signed in to change notification settings - Fork 141
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
attiny 412 programming: UPDI initialization failed. #545
Comments
Is that diode a schotky? If not, a 4.7k resistor will work better - I could
never make it work with a silicon diode. Most ch340 adapters have a
resistor in series with the TX pin so if yours does, try without the 470
ohm resistor (which is not in any way required for serial UPDI - all we
need is at least 470-1k total between the two, and I keep starting to think
I need to lower the value of the series resistor for general use.
…____________
Spence Konde
Azzy’S Electronics
New products! Check them out at tindie.com/stores/DrAzzy
GitHub: github.com/SpenceKonde
ATTinyCore: Arduino support for almost every ATTiny microcontroller
Contact: ***@***.***
On Tue, Nov 9, 2021, 03:05 phil-barrett ***@***.***> wrote:
Arduino 1.8.15, Win 10, megaTinyCore 2.4.2 installed via board manager.
Programmer Selected: SerialUPDI with serial 4.7K or diode 230400 baud
Programmer is CH340, first version. 470 ohm resistor on UPDI pin. diode
between TX and RX. I don't know how to verify my serial programmer works
correctly. I verified that the diode orientation is correct. It does pass
the "loopback" test without the diode.
Target board is my own design. Works with Atmel ICE.
Error trace back from Arduino: (sorry for the crappy formatting, Arduino
IDE kinda sucks.)
cmd /C
"C:\Users\philba\AppData\Local\Arduino15\packages\DxCore\tools\avr-gcc\7.3.0-atmel3.6.1-azduino4b/bin/avr-nm"
--numeric-sort --line-numbers --demangle --print-size --format=s
"C:\Users\philba\AppData\Local\Temp\arduino_build_642728/Blink.ino.elf" >
"C:\Users\philba\AppData\Local\Temp\arduino_build_642728/Blink.ino.map"
"C:\Users\philba\AppData\Local\Arduino15\packages\DxCore\tools\avr-gcc\7.3.0-atmel3.6.1-azduino4b/bin/avr-size"
-A "C:\Users\philba\AppData\Local\Temp\arduino_build_642728/Blink.ino.elf"
Sketch uses 632 bytes (15%) of program storage space. Maximum is 4096
bytes.
Global variables use 10 bytes (3%) of dynamic memory, leaving 246 bytes
for local variables. Maximum is 256 bytes.
C:\Users\philba\AppData\Local\Arduino15\packages\megaTinyCore\tools\python3\3.7.2-post1/python3
-u
C:\Users\philba\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.4.2/tools/prog.py
-t uart -u COM5 -b 230400 -d attiny412 --fuses 2:0x02 6:0x04 8:0x00
-fC:\Users\philba\AppData\Local\Temp\arduino_build_642728/Blink.ino.hex -a
write
SerialUPDI
UPDI programming for Arduino using a serial adapter
Based on pymcuprog, with significant modifications
By Quentin Bolsee and Spence Konde
Version 1.2.0 - June 2021
Using serial port COM5 at 230400 baud.
Target: attiny412
Set fuses: ['2:0x02', '6:0x04', '8:0x00']
Action: write
File: C:\Users\philba\AppData\Local\Temp\arduino_build_642728/Blink.ino.hex
Traceback (most recent call last):
File
"C:\Users\philba\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.4.2/tools/prog.py",
line 282, in
main()
File
"C:\Users\philba\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.4.2/tools/prog.py",
line 131, in main
return_code = pymcuprog_basic(args, fuses_dict)
File
"C:\Users\philba\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.4.2/tools/prog.py",
line 198, in pymcuprog_basic
args_start)
File
"C:\Users\philba\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.4.2\tools\libs\pymcuprog\pymcuprog_main.py",
line 544, in _start_session
backend.start_session(sessionconfig)
File
"C:\Users\philba\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.4.2\tools\libs\pymcuprog\backend.py",
line 362, in start_session
sessionconfig.interface_speed)
File
"C:\Users\philba\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.4.2\tools\libs\pymcuprog\programmer.py",
line 83, in setup_device
options=self.options)
File
"C:\Users\philba\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.4.2\tools\libs\pymcuprog\nvm.py",
line 42, in get_nvm_access_provider
accessprovider = NvmAccessProviderSerial(transport, device_info,
baud=frequency)
File
"C:\Users\philba\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.4.2\tools\libs\pymcuprog\nvmserialupdi.py",
line 53, in *init*
self.avr = UpdiApplication(port, baud, self.dut)
File
"C:\Users\philba\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.4.2\tools\libs\pymcuprog\serialupdi\application.py",
line 79, in *init*
datalink.init_datalink()
File
"C:\Users\philba\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.4.2\tools\libs\pymcuprog\serialupdi\link.py",
line 44, in init_datalink
raise PymcuprogError("UPDI initialisation failed")
pymcuprog.pymcuprog_errors.PymcuprogError: UPDI initialisation failed
pymcuprog.pymcuprog_errors.PymcuprogError: UPDI initialisation failed
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#545>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABTXEW26GOPTTXBWDUMHGVTULDI53ANCNFSM5HUTYJNA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
It was a 1N4148 like the UPDI docs call out. But, that isn't a schottky by the way. It's just a fast switching silicon diode. I do have some real schottky diodes I could use. But, it sounds like the 4.7K resistors works so I'll go with that. Put it between RX and TX on the serial adapter, right? Yeah, my CH340 adapter has a 1.5K R on TX Thanks for getting back to me. I know you've got lots on your plate and appreciate your attention. |
ARGHHHHH which document still has the wrong partnumber? I thought I went
through and fixed that everywhere when I realized I'd screwed up on the
part number....
…On Tue, Nov 9, 2021 at 5:06 PM phil-barrett ***@***.***> wrote:
It was a 1N4148 like the UPDI docs call out. But, that isn't a schottky by
the way. It's just a fast switching silicon diode. I do have some real
schottky diodes I could use. But, it sounds like the 4.7K resistors works
so I'll go with that. Put it between RX and TX on the serial adapter, right?
Thanks for getting back to me. I know you've got lots on your plate and
appreciate your attention.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#545 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABTXEW2Z32S2LVCAOSQ7OY3ULGLMVANCNFSM5HUTYJNA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
--
____________
Spence Konde
Azzy’S Electronics
New products! Check them out at tindie.com/stores/DrAzzy
GitHub: github.com/SpenceKonde
ATTinyCore <https://github.com/SpenceKonde/ATTinyCore>: Arduino support for
all pre-2016 tinyAVR with >2k flash!
megaTinyCore <https://github.com/SpenceKonde/megaTinyCore>: Arduino support
for all post-2016 tinyAVR parts!
DxCore <https://github.com/SpenceKonde/DxCore>: Arduino support for the AVR
Dx-series parts, the latest and greatest from Microchip!
Contact: ***@***.***
|
It's here. Tell you what, once I get it working with the resistor, I will try out a schottky diode and let you know. |
Thanks - fixed.
If you have a 'scope, it is much easier to debug - generally the cause of programming problems is that the balance of "pulling line high" and "pulling line low" is wrong and either the serial adapter isn't able to pull the updi line low enough for the target to recognize a low, or the target isn't able to pull it low enough for the adapter to recognize a high - both of which are very easy to see on a scope, and in successful communication you see the line going to a different voltage as the "low" depending on which side it comes from.
With the 4.7k resistor, it *barely* works with a 470 ohm, series resistor which is why I use and recommend the schottky diode. (the series resistor is needed for the simplest jtag2updi programmer from nano, because a lot of those get built with no series resistor of their own and that really shouldn't be connected directly because it's possible in theory for the two to be out of sync and fight over the line.
Just like every other programming issue, the errors you get back are practically useless. All it can see is "Huh, I didn't get the response I expected", just like the STK500 sync error for bootloader uploads. There's no information there, because all it's getting is what character the serial adapter sees. We could do a better job with the debugging messages, as there is one piece of information we do get - we can tell if we're seeing the character we sent... but the code is a bit of a dumpster fire (it's derived from pymcuprog it's agonizing to work with and when I talked about the verbosity of the verbose mode (that's why there isn't a verbose mode available for it - the *actual* verbose mode drowns you in spurious output) the guy who was the python expert on the project still hadn't accepted that we are't going to be able to merge in changes from pymcuprog anyway
|
Attiny3226 support requires 2.4.3 (github) avrdude.conf for uploads through
avrdude. Uploads using the recommended upload tool, serialupdi, should be
fine
There are two major changes that are half implemented in the core itself
totally unrelated to that so it is awkward for me to do a release and I
have a ton a documents that refer to 2.4.3 as being the first release with
new features, so I would need to find all those and correct them if I built
a new branch with the features rolled back to 2.4.2 state and that whole
process sucks when one text file is missing 3 entries and we're deep into
dev of next versiob because the ide doesn't let you put . I think
serialupdi should w
…____________
Spence Konde
Azzy’S Electronics
New products! Check them out at tindie.com/stores/DrAzzy
GitHub: github.com/SpenceKonde
ATTinyCore: Arduino support for almost every ATTiny microcontroller
Contact: ***@***.***
On Wed, Nov 17, 2021, 14:22 SanFable ***@***.***> wrote:
Hello,
I have similar problem using new Attiny3226 using working arduino nano
setup as a jtag2updi (I have bracket and on other attiny it works).
avrdude: AVR Part "attiny3226" not found.
Valid parts are:
uc3a0512 = AT32UC3A0512
c128 = AT90CAN128
c32 = AT90CAN32
c64 = AT90CAN64
pwm2 = AT90PWM2
pwm216 = AT90PWM216
...
Any solution?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#545 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABTXEW5XER26EW2BOJLL4S3UMP6G3ANCNFSM5HUTYJNA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
worth noting that 2.5.0 (formerly 2.4.3) is coming out VERY soon. |
No comments from OP in over a week. Closing under assumption that this is resolved. |
Well I have tried using an smd switching diode and a the resistor of 1k and my CH340 adapter to program my first ATTiny424, and it worked without a hitch, I tried twice and worked like a charm.
Now today a month later I tried literally same Hardware, same sketch, and same config, and it is not working anymore. Really confused. I have recorded a video which is on youtube which shows that the configs look similar too.
Here is the video https://www.youtube.com/shorts/w51bsm1D_dc full error stack trace:
|
drop the resistor back to 220 ohms or so and it should work on a CH340, I use those all the time without issue, |
Okay realised, my CH340 had Tx and Rx in reverse. |
Arduino 1.8.15, Win 10, megaTinyCore 2.4.2 installed via board manager. Windows board manager shows the USB port for the programmer.
Programmer Selected: SerialUPDI with serial 4.7K or diode 230400 baud
Programmer is CH340, first version. 470 ohm resistor on UPDI pin. diode between TX and RX. I don't know how to verify my serial programmer works correctly. I verified that the diode orientation is correct. It does pass the "loopback" test without the diode. If it's a bug in my programmer, not sure how to figure it out. Any help greatly appreciated.
Target board is my own design. Works with Atmel ICE.
Error trace back from Arduino: (sorry for the crappy formatting, Arduino IDE kinda sucks.)
The text was updated successfully, but these errors were encountered: