Serial Communication from the Yocto

Discuss use it and firmware update

Serial Communication from the Yocto

Postby helectromagneticus » Sep 24th, '17, 07:03

Hello everyone,

How are you firmware development folks getting information from the ATmega1284 on the Yocto to your development computers? Looking at the Yocto board, there's no easy way to attach wires to either of the two serial ports on the MCU. However, looking over the source code, one can see a few "Serial.println();" calls that suggest serial communications. Any thoughts here?

Or, is there a way to get information from the Yocto to a PC over the SPI interface? Perhaps that Yocto MCU could act a SPI master to an Arduino Uno? It looks like this gentleman here got such a system working with a Pro Mini, and he links to a solution with an Uno by Nick Gammon. What do you folks think?
User avatar
helectromagneticus
 
Posts: 71
Joined: Oct 26th, '16, 02:55

Re: Serial Communication from the Yocto

Postby antto » Sep 24th, '17, 10:44

yup, that's one of the discouraging aspects of the yocto cpu
the fact that the PCB is black also doesn't help much
there is a 10pin (5x2) header near the cpu, which smells like avr ISP connector, but it's not labelled, so who knows

other than that, you could check the available USARTs on the chip, and try to see if those pins go onto traces somewhere on the PCB (that would be easiest if you have a schematic and/or board layout files to look at)
if you find an USART module with both TX and RX pins not used (and not connected to anything on the PCB) then i can think of a little dirty hack:
use a an extra 40-pin IC socket, plug the CPU onto it, bend the pins where the RX+TX are on that socket sideways and solder wires to them, then plug that whole thing into the socket on the PCB
you'd also need to connect another wire to a ground point (preferably taken from somewhere in the digital section of the circuit)
now, you have three wires TX RX GND, you can use a USART<->RS232 converter box, or a USART<->USB converter box
don't connect the USART directly to a RS232 port on a computer because RS232 is not 5V

if you actually only need to print out debug information - you only need the TX pin (and GND), but having both TX and RX available on the same USART module is a better option, because then that can be used for a serial bootloader (because MIDI is damn slow)
User avatar
antto
 
Posts: 61
Joined: Apr 20th, '16, 17:43
Location: 127.0.0.1

Re: Serial Communication from the Yocto

Postby helectromagneticus » Sep 25th, '17, 06:10

I've figured it out with a good guess and a multimeter. The pair of pins next to the SPI header are the serial RX/TX lines. You can get serial out from the ATmega1284 on the Yocto that way.

Using an Arduino Uno to read serial from the Yocto:
Image
  • Make the connections described in the image above (if you don't want to program the Yocto over SPI, you still need the GND connection from the SPI header)
  • Connect GND to RST on the Uno (note that you must break this connection if you want to program the Yocto over SPI!)
  • Use the "Serial Monitor" under the "Tools" section of the Arduino IDE
  • Set the baud rate to 115200

Things to watch out for:
  • The TX line can't be connected during programming over SPI, avrdude will spit out a "not in sync" error.
User avatar
helectromagneticus
 
Posts: 71
Joined: Oct 26th, '16, 02:55

Re: Serial Communication from the Yocto

Postby jvq » Sep 25th, '17, 08:04

Neat!

I've been doing my debugging in a very crude way, by lighting up LED's. Using the serial port must be much nicer.
jvq
 
Posts: 78
Joined: Aug 17th, '16, 21:36

Re: Serial Communication from the Yocto

Postby helectromagneticus » Sep 30th, '17, 20:50

jvq wrote:Neat!

I've been doing my debugging in a very crude way, by lighting up LED's. Using the serial port must be much nicer.


Thanks!
User avatar
helectromagneticus
 
Posts: 71
Joined: Oct 26th, '16, 02:55

Re: Serial Communication from the Yocto

Postby rv0 » Dec 15th, '18, 23:18

I've been trying this to get serial text out from the Yocto

RX TX connection as described in above image.
Also Yocto GND to Arduino RST
Using a cheap UNO clone

When I open serial monitor some characters I print are corrupt. Space prints as 8, 0 as <, A as a, ... It's semi random, sometimes some characters get corrupt, sometimes they don't.. Baud rate is correct. Very confusing for debugging of course.

I first blamed my Uno clone, tried another type of clone and the problem is the same. Then blamed the Yocto, took another one (from same batch though), same issue. Then blamed my Mac, so tried a raspberry pi with the Arduino IDE and the same problem occurs.

Not sure where to go from here.. I could try to get my hands on a real arduino uno.. Or maybe make something to connect the yocto straight to the raspberry pi.

Anyone got any clues?


EDIT: :roll: why is it always right after I ask for help online that I figure it out :roll:
The problem is I didn't connect GND of the Yocto to GND of the Arduino. Fixed now, time to debug 8-)
User avatar
rv0
 
Posts: 156
Joined: Feb 11th, '14, 09:09


Return to Yocto v1.0 Software

Who is online

Users browsing this forum: No registered users and 1 guest