UART0 between Dragonboard 410c and Arduino doesn't work

The Arduino on the Sensors Mezzanine can’t communicate with the Dragonboard.
Here is my test code:

test_com.ino

void setup()
{
Serial.begin(9600);
}

void loop()
{
Serial.println(“Hello world from Arduino on 96B Sensors PCB”);
delay(2000);
}

test_com.py

import serial
import upm
from upm import pyupm_jhd1313m1

ard = serial.Serial(’/dev/tty96B0’, 9600)
lcd = pyupm_jhd1313m1.Jhd1313m1(0, 0x3e, 0x62)

if name == ‘main’:
print(‘Test comm between Arduino and Dragonboard 410c’)
lcd.clear()
lcd.setCursor(0, 0)
lcd.setColor(255, 180, 180)
lcd.write(‘Test comm’)
try:
while True:
ardOut = ard.readline()
print(ardOut)

except KeyboardInterrupt:
    lcd.setColor(0,0,0)
    lcd.clear()
    print("CTRL-C!! Exiting...")

Makefile

include /usr/share/arduino/Arduino.mk
run: upload
python3 test_com.py

I think you mean the MICROCONTROLLER. “Arduino” is a BRAND NAME of breakout boards for certain microcontrollers, and what you have is NOT made by them.

Now, I presume that since you are showing source code, that you were able to successfully compile it and load it onto the microcontroller? If that is the case, and you loaded the firmware from the db410c, then the two devices must actually communicating correctly.

Have you looked over the “getting started” guide?

My suspicion is that there is something not working right with that python script you are playing around with. Might not be setting the RTS line to the correct state to release the microcontroller from reset.

Try;

stty -F /dev/tty96B0 -hupcl
cat /dev/tty96B0

“My suspicion is that there is something not working right with that python script you are playing around with. Might not be setting the RTS line to the correct state to release the microcontroller from reset.”
Probably not, I copied it from the example.

“stty -F /dev/tty96B0 -hupcl”
Can we do the same in the python script?

I bough all this to follow the Coursera’s courses on IoT from San Diego’s university.
Many if not all examples in the “Getting started” required some tweaks in order to get them to work. They are a bit outdated, and I had to search to find the proper GPIO numbers.

Does that mean that you tried what I suggested and it worked?
If yes, then that confirms that your python script is doing something wrong.
If no, then you are getting ahead of yourself by asking about python.

I think this is an important point.

Testing subsystems in isolation makes it easier to figure out what might be going wrong. For example if you are concerned UART0 is not working then pointing a terminal emulator at the serial port would be a good first step to work out where to place blame.

Try something like:

sudo apt install picocom
picocom -b 9600 /dev/tty96B0
# If running as regular user does not work then also try running as root
sudo picocom -b 9600 /dev/tty96B0

Sorry. Ignore this… I didn’t read far enough back. The cat /dev/tty96B0 test proposed by @doitright covers much the the same ground (assuming something has already set the baud rate). You should share the results of that experiment.

It might also be useful to enrich the AVR code so that it toggles an LED as well of issuing messages to the serial port (since they can can trivially see if the AVR is in reset or not based on whether the LED is flashing).

I tried what you suggested, but that didn’t seem to work. I’ll check if the hardware works.

After resorting to heavy artillery (oscilloscope, etc.) and a few probing, it decided to work. So that closes the issue

I didn’t know about picocom, so that’s a plus. Thanks!

I put some code to flash the led in the MCU. It didn’t work.

Finally, I’ve been able to make it work. For the python code, I modified the code to use the hardware protocol. So all the python examples using the MCU communicating with the Dragonboard should use this.

ard = serial.Serial(’/dev/tty96B0’,9600,rtscts = 1)