Skip to content
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

UPDI Iinitialization failed on attiny1604 #1049

Open
charbelB7 opened this issue Jan 12, 2024 · 4 comments
Open

UPDI Iinitialization failed on attiny1604 #1049

charbelB7 opened this issue Jan 12, 2024 · 4 comments
Labels
question/tech support Request for help or technical support, not an issue with the core

Comments

@charbelB7
Copy link

charbelB7 commented Jan 12, 2024

I'm using an attiny1604 devboard from soldered.com (https://soldered.com/product/dasduino-lite/) and i tried to program it with serial updi but as said in the title i get the following error message :
Traceback (most recent call last):
File "C:\Users\delta\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.10/tools/prog.py", line 286, in <module> main() File "C:\Users\delta\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.10/tools/prog.py", line 128, in main return_code = pymcuprog_basic(args, fuses_dict) File "C:\Users\delta\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.10/tools/prog.py", line 201, in pymcuprog_basic args_start) File "C:\Users\delta\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.10\tools\libs\pymcuprog\pymcuprog_main.py", line 545, in _start_session backend.start_session(sessionconfig) File "C:\Users\delta\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.10\tools\libs\pymcuprog\backend.py", line 362, in start_session sessionconfig.interface_speed) File "C:\Users\delta\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.10\tools\libs\pymcuprog\programmer.py", line 83, in setup_device options=self.options) File "C:\Users\delta\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.10\tools\libs\pymcuprog\nvm.py", line 42, in get_nvm_access_provider accessprovider = NvmAccessProviderSerial(transport, device_info, baud=frequency, options=options) File "C:\Users\delta\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.10\tools\libs\pymcuprog\nvmserialupdi.py", line 54, in __init__ self.avr = UpdiApplication(port, baud, self.dut) File "C:\Users\delta\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.10\tools\libs\pymcuprog\serialupdi\application.py", line 79, in __init__ datalink.init_datalink() File "C:\Users\delta\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.10\tools\libs\pymcuprog\serialupdi\link.py", line 44, in init_datalink raise PymcuprogError("UPDI initialisation failed") pymcuprog.pymcuprog_errors.PymcuprogError: UPDI initialisation failed Failed programming: uploading error: exit status 1
I am using the following CH340 adapter : https://www.seeedstudio.com/USB-To-Uart-5V-3V3-p-1832.html Which has no internal resistor for TX.
the circuit i am doing is the following :

image
with a schottky diode and a 470 ohm resistor in serial with the UPDI pin. My arduino IDE version is 2.2.1 I am programming it with 230400 bauds and and even tried to reconfigure the serial port's uart settings as using even parity bits and 2 stop bits but to no success. Any idea on how to fix this?

@charbelB7
Copy link
Author

charbelB7 commented Mar 13, 2024

could you please answer this problem, its been two months and still doesn't work @SpenceKonde

@hmeijdam
Copy link

hmeijdam commented Mar 13, 2024

Are you sure this is a board without a bootloader that has disabled UPDI and turned it into a Reset pin? I see your board has already a CH340G and USB connector
And the RESET pin is shared with UPDI and has a whole circiutry connected to it, that may interfere with UPDI programming.

image

You need to have a fresh Attiny1604 without additional components soldered to the UPDI pin, to make this work. I don't think that is what you have.

Dasduino lite schematic.pdf

@SpenceKonde
Copy link
Owner

For UPDI to work with that board you need to

  1. Ensure that JP1 (autoreset) is not connected
  2. Ensure that you connect the wires in the correct order. The pin order there is bad; it violates basic principles of applied murphology* and sets a trap for customers. The correct order is to have Gnd in the middle, so that even if you get the connector backwards, you're swapping Vcc and UPDI, which is unlikely to cause hardware damage. That board puts UPDI in the middle, so that if you get the connector backwards, Vcc and Gnd are reversed. This is invariably fatal to the chip, and often lets out smoke.

That whole board appears to have made a large number of poor design decisions.

But that updi header, jeez. I guess that's one way to ensure repeat business!

* Applied Murphology: Consideration of murphy's law and it's ramifications as an integral part of the design process. If anything can go wrong, it will; Over a large enough sample everything that can go wrong will, most many times. Therefor consideration should always be given to "How likely is it for this thing to go wrong? Plugging a connector in backwards when it's not polarized is very easy, and so if its often connected or disconnected, you assume it will be connected backwards routinely for indefinite lengths of time. In this case we would consider that there are three pin orderings (each of which can be reversed):

  • Vcc, UPDI, Gnd (what they did - plugged in backwards, will burn out chip in seconds from reverse polarity.)
  • Updi, Vcc, Gnd (also bad - The Vcc and Gnd rail of target would be at Vcc (which is fine except that...) UPDI is connected to Gnd. Since both Gnd and Vcc on the target are approximately Vcc, that would mean that the external voltage applied to an I/O pin was less than Gnd from the chip's perspective, so that UPDI pin would be aced if it was wired like that
  • Vcc, Gnd, UPDI (good - chip will sometimes power on depending on load, but will never be damaged...

@SpenceKonde SpenceKonde added the question/tech support Request for help or technical support, not an issue with the core label Mar 30, 2024
@fritzlb
Copy link
Contributor

fritzlb commented Apr 21, 2024

From the picture of your serial adapter it seems like that thing has got LEDs for RX/TX. As per documentation, in case the RX LED just shorts the RX line over a resistor to VCC, that won’t work with UPDI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question/tech support Request for help or technical support, not an issue with the core
Projects
None yet
Development

No branches or pull requests

4 participants