Hello,
I've found what I think is a problem of the DM365 uart 1 driver. I have a DM365 connected to an external device through UART1. When I send a command to the device, it replies back. This part works. What's strange is that I've noticed that its replies triggers another transmission from DM365 that is not in my code. This happens only if the serial port is not closed immediately after sending the data.
This is the source code of the (very simple) serialsend.c code I use. Transmission is checked on a scope connected to TX and RX line.
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int main(int argc, char *argv[])
{
char buf[] = { 0xA0, 0x0E, 0x34, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x36, 0x32, 0xA5 };
int fd;
fd = open("/dev/ttyS1", O_RDWR);
write(fd, buf, sizeof(buf));
sleep(10);
close(fd);
}
If with the same setup I disconnect the RX line, then the DM365 does not receive anything, and it does not send the spurious data. It seems that the transmission is caused by the received data.
Can anyone explain this?
Thanks!