页次: 1
有没有做过RV1103高速串口的呀
我打算用串口接收数据,10字节/包,16000包/s
接收到的数据随机丢包,一丢就是几百1千多字节
有没有碰到过的大神
serinfo.flags |= ASYNC_LOW_LATENCY;
// 串口初始化
int setup_serial(const char *dev)
{
int fd = open(dev, O_RDWR | O_NOCTTY | O_NONBLOCK);
if (fd < 0)
{
write_log("ERROR: Cannot open serial %s: %s", dev, strerror(errno));
exit(1);
}
struct termios tty = {0};
tcgetattr(fd, &tty);
cfmakeraw(&tty);
cfsetspeed(&tty, 2000000);
tty.c_cc[VMIN] = 0; // 设置最小读取字节数为0
tty.c_cc[VTIME] = 0; // 设置读取超时时间为0
tty.c_cflag |= (CLOCAL | CREAD | CS8);
struct serial_struct serial;
int ret = ioctl(fd, TIOCGSERIAL, &serial);
serial.xmit_fifo_size = 1024 * 1024; // 1M
// 设置串口低延迟模式
serial.flags |= ASYNC_LOW_LATENCY;
ret = ioctl(fd, TIOCSSERIAL, &serial);
if (tcsetattr(fd, TCSANOW, &tty) != 0)
{
write_log("ERROR: tcsetattr failed: %s", strerror(errno));
close(fd);
exit(1);
}
return fd;
}
// 串口初始化
int setup_serial(const char *dev)
{
int fd = open(dev, O_RDWR | O_NOCTTY | O_NONBLOCK);
if (fd < 0)
{
write_log("ERROR: Cannot open serial %s: %s", dev, strerror(errno));
exit(1);
}
struct termios tty = {0};
tcgetattr(fd, &tty);
cfmakeraw(&tty);
cfsetspeed(&tty, 2000000);
tty.c_cc[VMIN] = 0; // 设置最小读取字节数为0
tty.c_cc[VTIME] = 0; // 设置读取超时时间为0
tty.c_cflag |= (CLOCAL | CREAD | CS8);
struct serial_struct serial;
int ret = ioctl(fd, TIOCGSERIAL, &serial);
serial.xmit_fifo_size = 1024 * 1024; // 1M
// 设置串口低延迟模式
serial.flags |= ASYNC_LOW_LATENCY;
ret = ioctl(fd, TIOCSSERIAL, &serial);
if (tcsetattr(fd, TCSANOW, &tty) != 0)
{
write_log("ERROR: tcsetattr failed: %s", strerror(errno));
close(fd);
exit(1);
}
return fd;
}
请问下
做overlayfs的时候加载的时候提示
[ 1.532950] random: crng init done
[ 1.968507] overlayfs: upper fs does not support tmpfile.
[ 1.974024] overlayfs: upper fs does not support xattr, falling back to index=off and metacopy=off.
Starting syslogd: OK
Starting klogd: OK
Running sysctl: OK
read-only file system detected...done
Starting nginx...
Starting redis: OK
ssh-keygen: generating new host keys: RSA Could not save your public key in /etc/ssh/ssh_host_rsa_key.WUUwzuCq4Z: Read-only file system
ssh-keygen: generating new host keys: DSA Could not save your public key in /etc/ssh/ssh_host_dsa_key.gzfYBUwEuO: Read-only file system
ssh-keygen: generating new host keys: ECDSA Could not save your public key in /etc/ssh/ssh_host_ecdsa_key.NhHCDssYbw: Read-only file system
ssh-keygen: generating new host keys: ED25519 Could not save your public key in /etc/ssh/ssh_host_ed25519_key.3gaphbfyLB: Read-only file system
Starting sshd: Unable to load host key: /overlay/ssh/ssh_host_rsa_key
Unable to load host key: /overlay/ssh/ssh_host_ecdsa_key
Unable to load host key: /overlay/ssh/ssh_host_ed25519_key
sshd: no hostkeys available -- exiting.
OK
mount指令我加到/etc/inittab中了
# Startup the system
::sysinit:/bin/mount -t proc proc /proc
::sysinit:/bin/mount -o remount,rw /
::sysinit:/bin/mkdir -p /dev/pts /dev/shm
::sysinit:/bin/mount -a
::sysinit:/sbin/swapon -a
null::sysinit:/bin/ln -sf /proc/self/fd /dev/fd
null::sysinit:/bin/ln -sf /proc/self/fd/0 /dev/stdin
null::sysinit:/bin/ln -sf /proc/self/fd/1 /dev/stdout
null::sysinit:/bin/ln -sf /proc/self/fd/2 /dev/stderr
::sysinit:/bin/hostname -F /etc/hostname
::sysinit:mount -n -t jffs2 /dev/mtdblock4 /overlay
::sysinit:mount -n -t overlay overlayfs:/overlay -o lowerdir=/,upperdir=/overlay/upperdir,workdir=/overlay/workdir /merged/
#::sysinit:pivot_root /merged /merged/rom
# now run any rc scripts
::sysinit:/etc/init.d/rcS
ssh报错readonly问下有什么解决方法么
页次: 1