往期1: 感谢@晕哥邀请和测试,发布一个widora tiny200 480x272 5寸电阻屏TF卡固件, 开机跑 emwin,账号root,无密码
往期2: 分享一个 5寸的 800x480 的 f1c100s 固件, 感谢 @xm1994
调试串口UART0 (PB8/PB9)
第一次玩V3s, 拼拼凑凑搞了几天,终于弄出一个能烧录的完整版本了, 感谢论坛里面各种高手大神。
我的flash是 MX25L256, 理论上 台湾华邦W25Q256, 北京兆易GD25Q256 都可以烧录运行。
打包需要的文件: v3s_pack_files_2019121809.tgz
烧录文件: v3s_flash_32m_20101218.tgz
flash分区规划:
u-boot 0 - 0x4FFFF (320KiB)
boot logo background 0x50000 - 0x9FFFF (320KiB)
boot logo xxxxxxxxx 0xA0000 - 0xEFFFF (320KiB)
dtb 0xF0000 - 0xFFFFF ( 64KiB)
zImage 0x100000 - 0x5FFFFF ( 5MiB)
rootfs 0x600000 - 0x1FFFFF ( 26MiB = 32MiB - 6MiB)
烧录整个flash:
sunxi-fel.exe -p spiflash-write 0 v3s_flash_32m.bin
独立烧录:
sunxi-fel.exe -p spiflash-write 0 u-boot-sunxi-with-spl.bin
sunxi-fel.exe -p spiflash-write 0x50000 whycan.bmp.gz
sunxi-fel.exe -p spiflash-write 0xF0000 sun8i-v3s-licheepi-zero-dock.dtb
sunxi-fel.exe -p spiflash-write 0x100000 zImage
sunxi-fel.exe -p spiflash-write 0x600000 jffs2.bin
离线
运行效果。
离线
留位置
离线
好用好用,一如既往地给力!
离线
带adb服务器的固件: v3s_flash_32m_2019121822_adbd.tgz
插入usb, 直接用adb可以shell/pull/push
ps: 昨天晚上传了很久都没传上来, 今天早上秒传了。
离线
开机运行emwin demo 的固件: v3s_flash_32m_20191219_adbd_emwin.tgz
可以直接用 adb shell 进入命令行.
记得荔枝派的 NS2009的中断脚(IRQ)与 PB2 短路才行哦.
然后运行触摸校正,测试,emwin演示程序:
TSLIB_TSEVENTTYPE=INPUT TSLIB_TSDEVICE=/dev/input/event1 TSLIB_CALIBFILE=/etc/pointercal TSLIB_CONFFILE=/etc/ts.conf TSLIB_PLUGINDIR=/usr/lib/ts TSLIB_FBDEVICE=/dev/fb0 TSLIB_CONSOLEDEVICE=none ts_calibrate
TSLIB_TSEVENTTYPE=INPUT TSLIB_TSDEVICE=/dev/input/event1 TSLIB_CALIBFILE=/etc/pointercal TSLIB_CONFFILE=/etc/ts.conf TSLIB_PLUGINDIR=/usr/lib/ts TSLIB_FBDEVICE=/dev/fb0 TSLIB_CONSOLEDEVICE=none ts_test
TSLIB_CALIBFILE=/etc/pointercal TSLIB_CONFFILE=/etc/ts.conf TSLIB_TSDEVICE=/dev/input/event1 /usr/bin/GUIDemo
离线
真是神奇了, 把 PB2 与 NS2009 IRQ短路之后, 电阻触摸屏可以用,
TSLIB_TSDEVICE=/dev/input/event1 TSLIB_CALIBFILE=/etc/pointercal TSLIB_CONFFILE=/etc/ts.conf /usr/bin/ts_calibrate
TSLIB_TSDEVICE=/dev/input/event1 TSLIB_CALIBFILE=/etc/pointercal TSLIB_CONFFILE=/etc/ts.conf /usr/bin/ts_test
TSLIB_TSDEVICE=/dev/input/event1 TSLIB_CALIBFILE=/etc/pointercal TSLIB_CONFFILE=/etc/ts.conf /usr/bin/GUIDemo
这几个ts_calibrate/ts_test/GUIDemo 触摸都很正常,
但是里面自带的 modbusmaster 却触摸不正常,
我用这个命令:
TSLIB_PLUGINDIR=/usr/lib/ts TSLIB_CONFFILE=/etc/ts.conf TSLIB_CALIBFILE=/etc/pointercal TSLIB_TSDEVICE=/dev/input/event1 QT_DEBUG_PLUGINS=1 QT_QPA_FONTDIR=/usr/share/fonts/liberation modbusmaster -platform linuxfb
这是什么原因呢?
离线
跑个 vnc 服务器试一试呗, 触摸后面再调.
离线
跑个 vnc 服务器试一试呗, 触摸后面再调.
感谢提醒, 这就去测试 vnc
ifconfig eth0 192.168.1.33
QT_QPA_FONTDIR=/usr/share/fonts/liberation modbusmaster -platform vnc
搞定, vnc进去鼠标键盘都正常了, 先这样用着吧.
离线
Thanks for sharing I'll test on lichee pi board.
离线
我的V3S 下了几个32M的都不能运行,试试这个
离线
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
device 0 offset 0x100000, size 0x10000
SF: 65536 bytes @ 0x100000 Read: OK
device 0 offset 0x110000, size 0x400000
SF: 4194304 bytes @ 0x110000 Read: OK
ERROR: Did not find a cmdline Flattened Device Tree
Could not find a valid device tree
楼主,每次都是设备树出问题,能帮忙指导下吗?谢谢!
离线
u-boot从你的 spi flash 读出的设备树二进制文件不能正常解析。
离线
可能是什么原因,导致设备树二进制文件不能解析呢?
u-boot从你的 spi flash 读出的设备树二进制文件不能正常解析。
离线
可能是什么原因,导致设备树二进制文件不能解析呢?
u-boot 里面有校验的命令 crc32/md5, 可以指定内存开始地址和长度, 算出校验码,
你和电脑算出来的dtb文件校验码对比, 看是否一致,如果一致,
说明你的u-boot从spi flash加载dtb到dram没有问题。
可能是别的问题, 编译dtb出错了???
离线
谢谢分享,试试看呢
离线
本站下载TF卡固件: V3s_tfcard_20200618160530.tgz
此固件支持:
0. 开机画面
1. RTL8723BS WIFI热点, SSID名: whycan, 密码whycan.cn
2. 可以接AIR724 4G上网, 手机连接whycan热点,那么手机可以连接互联网。
3. 支持Qtdemo, 演示程序地址: output/build/qt5base-5.12.4/examples/widgets/dialogs/classwizard/classwizard.pro
固件文件分析(抽取文件)可以用 @哇酷小二 这个方法: https://whycan.cn/t_4401.html#p42622
连接wifi热点可以转发到4G网口上网的指令:
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
离线
楼上的固件忘记使能adbd server: https://whycan.cn/t_2794.html#p22759
运行以下代码即可:
#! /bin/sh
modprobe g_ffs idVendor=0x18d1 idProduct=0x4e42 iSerialNumber="buildroot"
mkdir -p /dev/usb-ffs/adb
mount -t functionfs adb /dev/usb-ffs/adb -o uid=2000,gid=2000
adbd &
离线
#!/usr/bin/python
# https://pythonprogramminglanguage.com/pyqt5-hello-world/
import sys
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtWidgets import QMainWindow, QLabel, QGridLayout, QWidget, QPushButton
from PyQt5.QtCore import QSize
class HelloWindow(QMainWindow):
def __init__(self):
QMainWindow.__init__(self)
self.setMinimumSize(QSize(640, 480))
self.setWindowTitle("Hello world - pythonprogramminglanguage.com")
centralWidget = QWidget(self)
self.setCentralWidget(centralWidget)
gridLayout = QGridLayout(self)
centralWidget.setLayout(gridLayout)
label1 = QLabel("WhyCan.cn Python3 + PyQt5 演示程序");
gridLayout.addWidget(label1, 2, 0)
button1 = QPushButton("按我1")
button1.setStyleSheet("border: 1px solid black; background: white;width: 50px; height: 80px;");
gridLayout.addWidget(button1, 0, 0)
button2 = QPushButton("按我2")
button2.setStyleSheet("border: 1px solid black; background: white;width: 50px; height: 80px;");
gridLayout.addWidget(button2, 0, 1)
button3 = QPushButton("按我3")
button3.setStyleSheet("border: 1px solid black; background: white;width: 50px; height: 80px;");
gridLayout.addWidget(button3, 1, 0)
button4 = QPushButton("按我4")
button4.setStyleSheet("border: 1px solid black; background: white;width: 50px; height: 80px;");
gridLayout.addWidget(button4, 1, 1)
if __name__ == "__main__":
app = QtWidgets.QApplication(sys.argv)
mainWin = HelloWindow()
mainWin.show()
sys.exit( app.exec_() )
本站下载: V3s_tfcard_20200627115401.tgz
1. ADB ok
2. Python3 + PyQt5 OK, 开机运行PyQt5 QWidgets Demo app
3. RTL8723BS WIFI 热点 OK, ssid: whycan, password: whycan.cn
4. AIR720/AIR724 4G模块驱动 OK
5. SSH服务器OK, 连WIFI热点上去之后,V3s IP地址是 192.168.10.1
6. 插上网线可以作WIFI路由器:
#从上级路由器获取IP/网关等配置信息
udhcpc -i eth0#开启IP转发
echo 1 > /proc/sys/net/ipv4/ip_forward#eth0是以太网口, eth1是4G
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
目前还有一个问题未解决, 如何检测网线插入, 然后自动执行 udhcpc -i eth0
离线
感谢 @路漫漫 你的分享, 关于有线网线检测可以试一试这个:
http://blog.sina.com.cn/s/blog_1a39e3c4a0102z23x.html
var=$(cat /sys/class/net/eth0/carrier)
var1="0"
SLEEPTIME=1
while :;do
var=$(cat /sys/class/net/eth0/carrier)
if [ "$var" == "1" ];then
if [ "$var" != "$var1" ];then
touch /tmp/netok
echo "network change ok "
busybox udhcpc -s /etc/init.d/udhcpc.script &
fi
var1=$var
elif [ "$var" == "0" ];then
var=$(cat /sys/class/net/wlan0/carrier)
if [ "$var" == "1" ];then
if [ "$var" != "$var1" ];then
echo "wifi change ok "
touch /tmp/netok
busybox udhcpc -s /etc/init.d/udhcpc.script &
fi
elif [ "$var" == "0" ];then
if [ -f "/tmp/netok" ]; then
echo "eth and wifi all NG "
rm -rf /tmp/netok
fi
fi
var1=$var
fi
#echo "At `date +'%F %T'` "
sleep $SLEEPTIME
done
离线
@哇酷小二 感谢小二, 参考上面的脚本已经搞定.
现在插上网线, 自动获取IP地址, 手机/电脑 连V3s的手机热点上网, 可以当路由器用.
离线
感谢 @路漫漫 你的分享, 关于有线网线检测可以试一试这个:
http://blog.sina.com.cn/s/blog_1a39e3c4a0102z23x.html
这个不错,
刚刚查了一下, 这个文件指示网卡状态改变次数: /sys/class/net/eth0/carrier_changes
这个文件指示当前状态: /sys/class/net/eth0/carrier
离线
@哇酷小二 感谢小二, 参考上面的脚本已经搞定.
现在插上网线, 自动获取IP地址, 手机/电脑 连V3s的手机热点上网, 可以当路由器用.
/etc/wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant
ap_scan=1
network={
# key_mgmt=NONE
ssid="whycan"
psk="whycan.cn"
}
用这个固件, WIFI连接路由器热点,然后就可以通过ETH0上网了:
#连接WIFI路由器:
wpa_supplicant -iwlan0 -c /etc/wpa_supplicant.conf -B
#设置eth0地址:
ifconfig eth0 192.168.10.1
#eth0装上dhcp服务器:
dnsmasq -i eth0 --dhcp-range=192.168.10.100,192.168.10.109,2h
#设置路由:
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
离线
添加 ESP8089 支持:
本站下载: V3s_tfcard_20200630103649.tgz
配置文件: /etc/init.d/S39wifi
#!/bin/sh
modprobe r8723bs
sleep 0
modprobe esp8089.ko config=crystal_26M_en=1
sleep 2
ifconfig wlan0 192.168.10.1 netmask 255.255.255.0 up
dnsmasq -i wlan0 --dhcp-range=192.168.10.100,192.168.10.109,2h
hostapd /etc/hostapd.conf &
#wpa_supplicant -iwlan0 -c /etc/wpa_supplicant.conf -B
现在:
既支持RTL8723BS, 也支持ESP8089
既支持AP模式,也支持STA模式
离线
V3s ENC28j60 网卡驱动成功, SPI接口连ENC28J60, PB5接ENC28J60 INT口:
&spi0 {
status ="okay";
eth1: enc28j60@0{
compatible = "microchip,enc28j60";
reg = <0x0>; /* CE0 */
interrupt-parent = <&pio>;
interrupts = <1 5 IRQ_TYPE_EDGE_FALLING>; /* (PB5) */
gpios = <&pio 1 5 GPIO_ACTIVE_HIGH>;
spi-max-frequency = <12000000>;
status = "okay";
};
#if 0
mx25l25635e:mx25l25635e@0 {
compatible = "jedec,spi-nor";
reg = <0x0>;
spi-max-frequency = <50000000>;
#address-cells = <1>;
#size-cells = <1>;
};
#endif
};
固件本站下载: V3s_tfcard_20200702151252.tgz
离线
把荔枝派V3s开发板做 WIFI 路由器, 稳定工作一个星期了. 固件就是我楼上发的, WIFI模块可以用RTL8723, 也可以用ESP8089
离线
感谢晕哥的奉献
离线
准备用V3S做个样机,就是不知道后面这个芯片会不会停产
离线
哈哈, 这个也可以... --- WIFI模块可以用RTL8723, 也可以用ESP8089
离线
感谢楼主分享宝贵教程,
说句实在话,PyQt5 真香: https://stackoverflow.com/questions/51828943/pyqt5-and-subprocess-popen
可以直接用串口登录X3就可以编程了,无需再烧录:
import sys
from PyQt5 import QtCore, QtGui, QtWidgets
class Console(QtWidgets.QWidget):
errorSignal = QtCore.pyqtSignal(str)
outputSignal = QtCore.pyqtSignal(str)
def __init__(self):
super().__init__()
self.editor = QtWidgets.QPlainTextEdit(self)
self.editor.setReadOnly(True)
self.font = QtGui.QFont()
# self.font.setFamily(editor["editorFont"])
self.font.setPointSize(12)
self.layout = QtWidgets.QVBoxLayout()
self.layout.addWidget(self.editor, 1)
self.setLayout(self.layout)
self.output = None
self.error = None
self.editor.setFont(self.font)
self.process = QtCore.QProcess()
self.process.readyReadStandardError.connect(self.onReadyReadStandardError)
self.process.readyReadStandardOutput.connect(self.onReadyReadStandardOutput)
def onReadyReadStandardError(self):
error = self.process.readAllStandardError().data().decode()
self.editor.appendPlainText(error)
self.errorSignal.emit(error)
def onReadyReadStandardOutput(self):
result = self.process.readAllStandardOutput().data().decode()
self.editor.appendPlainText(result)
self.outputSignal.emit(result)
def run(self, command):
"""Executes a system command."""
# clear previous text
self.editor.clear()
self.process.start(command)
if __name__ == '__main__':
app = QtWidgets.QApplication(sys.argv)
w = Console()
w.show()
w.errorSignal.connect(lambda error: print(error))
w.outputSignal.connect(lambda output: print(output))
w.run("ping 8.8.8.8 -c 100")
sys.exit(app.exec_())
这是一个随意调用外部命令,输出日志随意显示到Qt5的例程.
离线
大神你的uboot编译配置文件和linux内核配置文件能共享一下吗?/proc/config.gz文件不存在,谢谢!
V3s ENC28j60 网卡驱动成功, SPI接口连ENC28J60, PB5接ENC28J60 INT口:
&spi0 { status ="okay"; eth1: enc28j60@0{ compatible = "microchip,enc28j60"; reg = <0x0>; /* CE0 */ interrupt-parent = <&pio>; interrupts = <1 5 IRQ_TYPE_EDGE_FALLING>; /* (PB5) */ gpios = <&pio 1 5 GPIO_ACTIVE_HIGH>; spi-max-frequency = <12000000>; status = "okay"; }; #if 0 mx25l25635e:mx25l25635e@0 { compatible = "jedec,spi-nor"; reg = <0x0>; spi-max-frequency = <50000000>; #address-cells = <1>; #size-cells = <1>; }; #endif };
https://whycan.cn/files/members/1842/QQ图片20200702160214.jpg
固件本站下载: V3s_tfcard_20200702151252.tgz
离线
哇塞,强大
离线
感谢 @路漫漫 你的分享, 关于有线网线检测可以试一试这个:
http://blog.sina.com.cn/s/blog_1a39e3c4a0102z23x.htmlvar=$(cat /sys/class/net/eth0/carrier) var1="0" SLEEPTIME=1 while :;do var=$(cat /sys/class/net/eth0/carrier) if [ "$var" == "1" ];then if [ "$var" != "$var1" ];then touch /tmp/netok echo "network change ok " busybox udhcpc -s /etc/init.d/udhcpc.script & fi var1=$var elif [ "$var" == "0" ];then var=$(cat /sys/class/net/wlan0/carrier) if [ "$var" == "1" ];then if [ "$var" != "$var1" ];then echo "wifi change ok " touch /tmp/netok busybox udhcpc -s /etc/init.d/udhcpc.script & fi elif [ "$var" == "0" ];then if [ -f "/tmp/netok" ]; then echo "eth and wifi all NG " rm -rf /tmp/netok fi fi var1=$var fi #echo "At `date +'%F %T'` " sleep $SLEEPTIME done
这个脚本不错, 学习!
离线
开机运行emwin demo 的固件: v3s_flash_32m_20191219_adbd_emwin.tgz
可以直接用 adb shell 进入命令行.
求大佬指教,V3s不是Arm9怎么运行的emwin?
离线
V3s ENC28j60 网卡驱动成功, SPI接口连ENC28J60, PB5接ENC28J60 INT口:
&spi0 { status ="okay"; eth1: enc28j60@0{ compatible = "microchip,enc28j60"; reg = <0x0>; /* CE0 */ interrupt-parent = <&pio>; interrupts = <1 5 IRQ_TYPE_EDGE_FALLING>; /* (PB5) */ gpios = <&pio 1 5 GPIO_ACTIVE_HIGH>; spi-max-frequency = <12000000>; status = "okay"; }; #if 0 mx25l25635e:mx25l25635e@0 { compatible = "jedec,spi-nor"; reg = <0x0>; spi-max-frequency = <50000000>; #address-cells = <1>; #size-cells = <1>; }; #endif };
https://whycan.cn/files/members/1842/QQ图片20200702160214.jpg
固件本站下载: V3s_tfcard_20200702151252.tgz
测试了一下, 真可以做WIFI路由器用 ^_^
只是没有web设置界面而已 :(
离线
楼主用了你最新的固件,弹出如下内容,是什么原因
U-Boot SPL 2017.01-rc2-00074-g8c6d57b224-dirty (Jun 09 2020 - 10:50:04)
DRAM: 0 MiB
### ERROR ### Please RESET the board ###
离线
有没有哪位大佬有16M Nor Flash的固件?分享一个呗
离线
离线
请问报错
prefetch abort
pc : [<b070fa0c>] lr : [<4100024c>]
sp : b0b34d58 ip : 410006e4 fp : e0400001
r10: 00000000 r9 : 410fc075 r8 : 42dfa000
r7 : 00000000 r6 : 6f70f940 r5 : 410000c0 r4 : 40008000
r3 : 00000010 r2 : 000f0000 r1 : 4100c075 r0 : b070fa08
Flags: nZCv IRQs off FIQs off Mode SVC_32
Resetting CPU ...
是怎么回事
离线
@turbo
检查CPU/DDR电源,适当降频
离线
你好,我按照荔枝派官方教材移植flash启动版本,修改了u-boot和内核,也修改了sun8i.h文件的启动参数和环境命令,设备树也添加了spi falsh节点,启动的时候卡在内核启动部分,能帮忙看下原因吗?
U-Boot 2017.01-rc2 (Sep 21 2024 - 13:55:52 +0800) Allwinner Technology
CPU: Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM: 64 MiB
MMC: SUNXI SD/MMC: 0
SF: Detected mx25l25635f with page size 256 Bytes, erase size 64 KiB, total 32 MiB
*** Warning - bad CRC, using default environment
Setting up a 800x480 lcd console (overscan 0x0)
dotclock: 33000kHz = 33000kHz: (1 * 3MHz * 66) / 6
In: serial@01c28000
Out: serial@01c28000
Err: serial@01c28000
Net: No ethernet found.
starting USB...
No controllers found
Hit any key to stop autoboot: 0
SF: Detected mx25l25635f with page size 256 Bytes, erase size 64 KiB, total 32 MiB
device 0 offset 0x100000, size 0x10000
SF: 65536 bytes @ 0x100000 Read: OK
device 0 offset 0x110000, size 0x400000
SF: 4194304 bytes @ 0x110000 Read: OK
## Flattened Device Tree blob at 41800000
Booting using the fdt blob at 0x41800000
Loading Device Tree to 42dfa000, end 42dfffc5 ... OK
Starting kernel ...
离线