AVR416 UPDI sniffer

Go To Last Post
10 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hallo,

Here is something for the code experts. I sniffed the updi wire on the Xplained board while 

giving some AVR studio commands.

 

Unfortunately the commands and the responses are mixed, since there is only 1 wire to sniff.

 

I have taken the baud rate to be 100kbaud, since that is what AVR studio insists on. 

And that looked right on the scope.

 

Jan

 

Attachment(s): 

Last Edited: Wed. Aug 22, 2018 - 11:34 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Right, back to the drawing board.

I managed to split 1 byte stream of but there are considerable buffer overruns. 

With no indication from Linux / fdti.

 

Pity.

j.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here's a python implementation of programming over UPDI: https://github.com/mraardvark/pyupdi

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

 

The postings on this site are my own and do not represent Microchip’s positions, strategies, or opinions.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Every UPDI command starts with 0x55, and I don't see any in your data...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I was curious, so I did a little sniffing of my own, using my xplained mini with tiny817.

Turns out that even though AS7 says 100kHz, the actual frequency is about 122kHz. You have to look at the waveform for the telltale synch (0x55) byte, which is a square wave.

Use it to calibrate the exact baud rate.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have the aardvark program, I am after the debugging stuff.

 

> Every UPDI command starts with 0x55, and I don't see any in your data...

 

I am well am well aware of it. I am puzzled about that as well. It should have shown up in 

the very first byte after the break '0' '0'. And I can hardly think that I missed it, unless ftdi has its

own logic about overruns, which the linux driver does not deal with.

 

I split the command off by connecting a line receiver over the 1 k resistor (and do some biasing

with 2 resistors)

The first bytes are identical.

 

I never have these issues with the Dwire programmer, so I thought I could get away with murder

I suppose. 

 

The other stink is that the UPDI connection only wants to know 100kBaud.

That cost me some research to achieve in Linux as well.

 

In any case some major rethink is needed on the basis of this experiment.

Probably going to rig up an STM32 board programmed on the bare metal.

 

I am studying your pic. thanks

 

j.

 

Last Edited: Thu. Aug 23, 2018 - 01:44 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You are using a serial to USB adapter to read the UPDI? You should really get a logic analyzer for a project like this...

The pic above is a partial capture of when you read the device signature.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I know, I know. But then I have friends.

 

Could you give me a reasonably exact baudrate, since the atmega has a crystal of 16Mhz, so that at least will be constant.

 

j.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ah, I got it :

122_361 Baud. Thanks.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

 0 : ( 16#0#  16#0# ) 
INFO : decoder, sync detected

 

 

So the baudrate is right! Thanks again.

 

j.