小智X3开发板淘宝购买链接: https://item.taobao.com/item.htm?id=607207528669
以下是在小智发给我的X3 SDK基础上改改完成的。
固件下载: smallwit_x3_tfcard_20200703010725.tgz
1. 支持板载AP6212 WIFI 热点, 热点名whycan, 密码: whycan.cn
2. 支持USB鼠标
3. 支持Python + PyQt5, 可以脚本编程Qt5
4. ...
以下由 @哇酷网小二 2020-07-05 添加:
----------------------------------------
小智X3开发板原理图下载: https://whycan.cn/t_4840.html
smallwit小智X3开发板-TF_SPIFLASH_EMMC_USB.pdf
离线
显示效果:
代码参考: https://whycan.cn/t_3400.html#p48415
#!/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_() )
离线
4.3寸 480x272 固件: smallwit_x3_tfcard_20200705071700.tgz
1. 支持电阻触摸屏
2. 支持Python3 + PyQt5
3. 支持AP6212 WIFI 热点
离线
5.0寸 800x480 电阻屏固件: smallwit_x3_tfcard_20200815015629.tgz
1. 支持u-boot开机画面
2. 支持USB HOST & OTG, 支持两个USB口同时插入U盘
离线
大佬,pyqt占多少内存?
占用 26M 左右物理内存
# cat /proc/219/cmdline
/usr/bin/python/app/test_pyqt5.py-platformlinuxfb#
#
# cat /proc/219/status |grep VmRSS
VmRSS: 26164 kB
#
#
# cat /proc/219/status
Name: test_pyqt5.py
Umask: 0022
State: R (running)
Tgid: 219
Ngid: 0
Pid: 219
PPid: 216
TracerPid: 0
Uid: 0 0 0 0
Gid: 0 0 0 0
FDSize: 32
Groups:
NStgid: 219
NSpid: 219
NSpgid: 98
NSsid: 98
VmPeak: 58944 kB
VmSize: 57740 kB
VmLck: 0 kB
VmPin: 0 kB
VmHWM: 26164 kB
VmRSS: 26164 kB
RssAnon: 6996 kB
RssFile: 19168 kB
RssShmem: 0 kB
VmData: 15732 kB
VmStk: 132 kB
VmExe: 4 kB
VmLib: 23948 kB
VmPTE: 54 kB
VmSwap: 0 kB
CoreDumping: 0
Threads: 2
SigQ: 0/794
SigPnd: 0000000000000000
ShdPnd: 0000000000000000
SigBlk: 0000000000000000
SigIgn: 0000000001001004
SigCgt: 00000001800a4002
CapInh: 0000000000000000
CapPrm: 0000003fffffffff
CapEff: 0000003fffffffff
CapBnd: 0000003fffffffff
CapAmb: 0000000000000000
NoNewPrivs: 0
Speculation_Store_Bypass: unknown
Cpus_allowed: f
Cpus_allowed_list: 0-3
voluntary_ctxt_switches: 386096
nonvoluntary_ctxt_switches: 2564
http://hutaow.com/blog/2014/08/28/display-process-memory-in-linux/
离线
电脑通过mobaxterm 连接 X3开发板ssh 服务器 --dropbear
热点名: whycan
密码: whycan.cn
小智X3开发板, 支持开机画面的5' 800x480 TF卡 固件
本站下载: smallwit_x3_tfcard_20200820183914.tgz
最近编辑记录 路漫漫 (2020-08-21 09:53:41)
离线
X3 MX25L256 SPI Flash 5寸 800*480 电阻屏固件: x3_flash_32m.7z
烧录方法: 制作楼上的TF卡固件, 并从TF卡启动, 把解压缩后的 x3_flash_32m 拷贝到U盘, 然后插入X3开发板,
等U盘挂载成功后, 执行命令:
flashcp /mnt/media/sda1/x3_flash_32m.bin /dev/mtd0 -v
根据U盘配置不同, 有可能不是 sda1, 可能是sda2/3/4 ...
离线
=> usb reset
resetting USB...
Bus usb@1c19000: Allwinner mUSB OTG (Host)
Bus usb@1c1a000: USB EHCI 1.00
Bus usb@1c1a400: USB OHCI 1.0
scanning bus usb@1c19000 for devices... 1 USB Device(s) found
scanning bus usb@1c1a000 for devices... 2 USB Device(s) found
scanning bus usb@1c1a400 for devices... 1 USB Device(s) found
scanning usb for storage devices... 2 Storage Device(s) found
=>
=> fatls usb 0:1
4307664 zImage
25006 sun8i-x3-smallwit-demo.dtb
394 boot.scr
322 boot_demo_50inch_800x480.cmd
splash/
537797 u-boot-sunxi-with-spl-tfcard.bin
System Volume Information/
6 file(s), 2 dir(s)
=>
=> fatls usb 1:1
4429288 zImage
25474 sun8i-x3-smallwit-demo.dtb
482 boot.scr
410 boot_demo_50inch_800x480.cmd
splash/
547036 u-boot-sunxi-with-spl-tfcard.bin
5 file(s), 1 dir(s)
=>
=>
支持USB HOST & OTG 的小智X3 u-boot 固件, 支持同时插两个U盘: u-boot-sunxi-with-spl_x3_smallwit_20200826.7z
离线
脚本 /app/update_spiflash.py
#!/usr/bin/python
#https://stackoverflow.com/questions/51828943/pyqt5-and-subprocess-popen
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 127.0.0.1")
w.run("flashcp /mnt/media/mmcblk0p1/update_spi_nor_flash/x3_flash_32m.bin /dev/mtd0 -v")
sys.exit(app.exec_())
开机自动执行mx25l256 spi nor flash烧写: /app/update_spiflash.py -platform linuxfb
5寸800x480 TF固件下载: smallwit_x3_tfcard_20200826164952.tgz
离线
https://variwiki.com/index.php?title=U-Boot_features
通过u-boot的ums命令,把小智X3开发板eMMC模拟成电脑U盘,然后利用win32diskimager烧录固件。
eMMC固件本站下载: smallwit_x3_emmc_image_20200827113720.tgz
tf版本u-boot本站下载: u-boot-sunxi-with-spl-smallwit-x3-burn-emmc.7z (从TF卡启动, 按回车进入命令行之后,输入命令 ums 0 mmc 1 电脑出现U盘即可烧录)
仅限有eMMC 的X3开发板可以用, 连我都没有, 我是在小智的X3卡片电脑测试的。
离线