未加星标

RK3328 based NTP server

字体大小 | |
[系统(linux) 所属分类 系统(linux) | 发布者 店小二04 | 时间 2019 | 作者 红领巾 ] 0人收藏点击收藏

I got a ROC-RK3328-CC SBC because it has true gigabit ethernet, emmc, and USB3. These are all better I/O options than the latest Raspberry Pi 3 B+.

I put a SATA hard drive in a USB3 adapter and connected it. The SBC froze when I tried to create a filesystem on the hard drive, and it had a kernel message of dwmmc_rockchip ff500000.dwmmc: Unexpected interrupt latency . I worked around this by moving IRQ 37 (mmc interrupt) to another cpu core: echo 2 | sudo tee /proc/irq/37/smp_affinity . After moving the interrupt to another core, I didn't have any more problems with USB3. Write speeds with dd were good: 12004098048 bytes (12 GB, 11 GiB) copied, 106.639 s, 113 MB/s . The SBC+USB3 hard drive combined use between 700mA-900mA.

The default ethernet rx coalesce delay is set pretty high , so I lowered it with ethtool -C eth0 rx-usecs 66 .

To get working USB3 mass storage drivers as well as PPS drivers, I recompiled the kernel. The RK3328 vendor kernel is based on 4.4.114. I used the roc-rk3328-cc branch to build my new kernel. I had to use gcc 7, as gcc 8 produces too many code warnings. There were a few code formatting issues in the vendor supplied wireless drivers that gcc 7 complained about that I had to work around.

The default vendor config is pretty minimal, and I added CONFIG_PPS_CLIENT_GPIO=m to get the pps-gpio module.

For a GPS module, I used the Adafruit GPS Hat . This has PPS on physical pin 7, which is GPIO1 PD4 on this SBC (which I had to find on the schematic ). It is mislabeled on the schematic as GPIO1 PD1. Ignore the RK805_32KOUT connection, it's optional for the SBC builders and "NC" (not connected):


RK3328 based NTP server
Header pin 7 connected to label "GPIO1_D1/CLKOUT"
RK3328 based NTP server
Label "GPIO1_D1/CLKOUT" connected to GPIO1_D4, CPU pin V14

Since this platform does not support device tree overlays, I made a simple change to the system device tree to tell the kernel to connect GPIO1 PD4 to the pps-gpio driver:


RK3328 based NTP server
Device Tree Change

After building the new kernel, putting the new kernel and dtb in /boot, and rebooting, everything came back.


RK3328 based NTP server
PPS as IRQ 108

Testing small packet rx rates, the limit seems to be around 29Mbit/s (56kpps with 64 byte packets). This is about the same as the Odroid C2. I tested with iperf3 -u -l 64 -b 29M -t 20 -c firefly.lan


RK3328 based NTP server
56kpps of udp with iperf3

The dropped packets in the first second are probably from the CPU frequency speeding up from idle state.

Transmission of tiny packets is a little bit slower at around 48kpps (~25Mbit)

I setup gpsd and chrony to use the GPS module. The SBC's serial port (/dev/ttyS1) needs to have the hardware flow control disabled before it works correctly, which I do in minicom before starting gpsd.

The short term timing results are around +/-1 us, not the best I've seen:


RK3328 based NTP server
Chrony state

So this SBC would make an acceptable NTP server.

本文系统(linux)相关术语:linux系统 鸟哥的linux私房菜 linux命令大全 linux操作系统

代码区博客精选文章
分页:12
转载请注明
本文标题:RK3328 based NTP server
本站链接:https://www.codesec.net/view/627824.html


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 系统(linux) | 评论(0) | 阅读(116)