/etc/profile环境设置
============================================
# cat /etc/profile
export PATH="/bin:/sbin:/usr/bin:/usr/sbin"
if [ "$PS1" ]; then
if [ "`id -u`" -eq 0 ]; then
export PS1='# '
else
export PS1='$ '
fi
fi
export EDITOR='/bin/vi'
# Source configuration files from /etc/profile.d
for i in /etc/profile.d/*.sh ; do
if [ -r "$i" ]; then
. $i
fi
done
unset i
export PATH=$PATH:/usr/lib
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_TSDEVICE=/dev/input/event0
export TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_PLUGINDIR=/usr/lib/ts
export TSLIB_CALIBFILE=/etc/pointercal
export LD_PRELOAD=/usr/lib/libts.so
export QT_QPA_FB_TSLIB=1
export QT_QPA_EGLFS_TSLIB=1
export QT_QPA_GENERIC_PLUGINS=tslib:/dev/input/event0
export QT_QPA_FONTDIR=/usr/lib/fonts
export QT_QPA_PLATFORM=linuxfb:tty=/dev/fb0
export QT_QPA_PLATFORM_PLUGIN_PATH=/usr/lib/qt/plugins
============================================
log信息
============================================
# ts_calibrate
xres = 800, yres = 480
Took 10 samples...
Top left : X = 64 Y = 65
Took 10 samples...
Top right : X = 984 Y = 55
Took 10 samples...
Bot right : X = 975 Y = 548
Took 17 samples...
Bot left : X = 52 Y = 559
Took 16 samples...
Center : X = 526 Y = 311
-0.183105 0.759773 0.016088
-1.450867 0.008753 0.770148
Calibration constants: -12000 49792 1054 -95084 573 50472 65536
# ./qt_test
No such plugin for spec "tslib:/dev/input/event0"
============================================
tslib感觉是正常可用,Qt显示和运行都正常,就是pushbutton点击后没反应
=====================================================================================
CMakeLists.txt 链接Ubuntu下qt5的库
set(CMAKE_C_COMPILER /usr/bin/gcc)
set(CMAKE_CXX_COMPILER /usr/bin/g++)
set(DQT_QMAKE_EXECUTABL /usr/bin/qmake)
set(Qt5Core_DIR /home/xiaoguoguo/Qt5.6.3/5.6.3/gcc_64/lib/cmake/Qt5Core)
find_package(Qt5Core REQUIRED)
target_link_libraries(${PROJECT_NAME} Qt::5Core)
能生成出来Makefile,make之后成功编译。
=====================================================================================
=====================================================================================
CMakeLists.txt 链接buildroot下qt5的库
set(CMAKE_C_COMPILER /home/xiaoguoguo/arm926t/buildroot-2017.11/output/host/bin/arm-926t-linux-gnueabi-gcc)
set(CMAKE_CXX_COMPILER /home/xiaoguoguo/arm926t/buildroot-2017.11/output/host/bin/arm-926t-linux-gnueabi-g++)
set(DQT_QMAKE_EXECUTABL /home/xiaoguoguo/arm926t/buildroot-2017.11/output/host/bin/qmake)
set(Qt5Core_DIR /home/xiaoguoguo/arm926t/buildroot-2017.11/output/build/qt5base-5.9.2/lib/cmake/Qt5Core/)
find_package(Qt5Core REQUIRED)
target_link_libraries(${PROJECT_NAME} Qt5Core)
Makefile生成失败,提示内容如下
CMake Error at /home/xiaoguoguo/arm926t/buildroot-2017.11/output/build/qt5base-5.9.2/lib/cmake/Qt5Core/Qt5CoreConfig.cmake:27 (message):
The imported target "Qt5::Core" references the file
"/home/xiaoguoguo/arm926t/buildroot-2017.11/output/build/qt5base-5.9.2/include/qt5/"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
"/home/xiaoguoguo/arm926t/buildroot-2017.11/output/build/qt5base-5.9.2/lib/cmake/Qt5Core/Qt5CoreConfig.cmake"
but not all the files it references.
Call Stack (most recent call first):
/home/xiaoguoguo/arm926t/buildroot-2017.11/output/build/qt5base-5.9.2/lib/cmake/Qt5Core/Qt5CoreConfig.cmake:63 (_qt5_Core_check_file_exists)
CMakeLists.txt:12 (find_package)
-- Configuring incomplete, errors occurred!
=====================================================================================
Qt5CoreConfig.cmake:27 (message):
The imported target "Qt5::Core" references the file
根据这个错误提示找到Qt5CoreConfig.cmake:27
25 macro(_qt5_Core_check_file_exists file)
26 if(NOT EXISTS "${file}" )
27 message(FATAL_ERROR "The imported target \"Qt5::Core\" references the file
28 \"${file}\"
然后百度一下第27行,大多数是说该文件的
14 get_filename_component(_qt5Core_install_prefix "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)
这一句有问题。
Qt5CoreConfig.cmake从编译完buildroot就没有更改过,该怎么更正呢?
启动信息如下,这算是异常吗?制作完根文件系统第一次启动就这样了。
==================================================================
Starting mysql...done.
Welcome to Buildroot
buildroot login: 050101 00:47:01 mysqld_safe Logging to '/var/mysql/buildroot.err'.
050101 00:47:01 mysqld_safe Starting mysqld daemon with databases from /var/mysql
Welcome to Buildroot
buildroot login:
==================================================================
路过的大佬帮忙看看是什么问题,日志如下
===================================================================
Freeing unused kernel memory: 128K
devpts: called with bogus options
Starting logging: OK
Initializing random number generator... done.
Welcome to Buildroot
buildroot login: root
# netstat
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
netstat: /proc/net/tcp6: No such file or directory
netstat: /proc/net/udp6: No such file or directory
netstat: /proc/net/raw6: No such file or directory
Active UNIX domain sockets (w/o servers)
Proto RefCnt Flags Type State I-Node Path
unix 3 [ ] DGRAM 1401 /dev/log
unix 2 [ ] DGRAM 1405
===================================================================
如题
屏幕是480*272的电阻屏,刷屏为红色,但只有一大半是红色,直接用Qt的弄ui界面设置480*272运行却没问题。
参考了网上的文章,以下是我修改后的代码,不知道是何处出了问题?
-----------------------------------------------------------------------------------------------------------------
#include <QCoreApplication>
#include <QDebug>
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
int main(int argc, char *argv[])
{
argc = argc;
argv = argv;
qint32 fd;
quint32 *mmaped = NULL;
fd = open("/dev/fb0",O_RDWR);
if(fd < 0 )
{
qDebug()<<"open fb0 fail";
return 1;
}
/* 将文件映射至进程的地址空间 */
mmaped = (quint32 *)mmap(NULL,480*272*4,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0);
close(fd);
if(mmaped == ((quint32 *)-1))
{
qDebug()<<"mmap fail";
return 1;
}
for(quint32 i=0;i<480*272;i++)
{
mmaped[i] = 0x00ff0000;
}
msync(mmaped,480*272*4,MS_SYNC);
return 0;
}
-----------------------------------------------------------------------------------------------------------------
小果果 说:可以,谢谢大佬!!
再问问那个printf和printk优先级的问题,只想要执行到什么就立刻输出,能看得出执行的顺序,该怎么设置?printf() 后执行 fflush(stdout) 可以立即输出.
这个链接说 printk("hello world\n"); 像这样加换行符可以立即输出:
https://stackoverflow.com/questions/24469938/printk-print-order-ambiguity
好的,我研究研究
试一试这个:
关闭时间戳信息(Disable dmesg timestamp)
echo N > /sys/module/printk/parameters/time打开时间戳信息(Enable dmesg timestamp)
echo Y > /sys/module/printk/parameters/time
可以,谢谢大佬!!
再问问那个printf和printk优先级的问题,只想要执行到什么就立刻输出,能看得出执行的顺序,该怎么设置?
# ./led_app /dev/led
[ 122.840492]
[ 122.840492] led_dev_open...
hello...
./[ 122.845143]
[ 122.845143] led_dev_read...
led_app start...[ 122.850921]
[ 122.850921] led_dev_write...
read ret:0...
[ 122.858364]
[ 122.858364] led_dev_release...
write ret:0...
------------------------------------------------------------
rt,最近在学驱动开发,写了个简单的模型,发现使用printk会打印出时间戳,不想打印怎么去掉,发现printf和printk输出好像优先级和预期的不一样。
启动haveged打印的信息
-------------------------------------------------------------------------------------------------------------
# cat /proc/sys/kernel/random/entropy_avail
24
# haveged
haveged: can not open UNIX socket
haveged: can not initialize command socket: Function not implemented
haveged: haveged starting up
# cat /proc/sys/kernel/random/entropy_avail
32
-------------------------------------------------------------------------------------------------------------
启动rngd打印的信息
-------------------------------------------------------------------------------------------------------------
# cat /proc/sys/kernel/random/entropy_avail
4
# rngd -r /dev/urandom -o /dev/random
Initalizing available sources
Initalizing entropy source hwrng
libgcrypt not available. Disabling AES in JITTER source
Enabling JITTER rng support
Initalizing entropy source jitter
# cat /proc/sys/kernel/random/entropy_avail
4035
-------------------------------------------------------------------------------------------------------------
开机自启动的rngd比如系统手动启动慢很多很多。。。
启动信息如下
-------------------------------------------------------------------------------------------------------------------------------
[ 1.063658] ALSA device list:
[ 1.066647] #0: Loopback 1
[ 1.084493] random: fast init done
[ 1.090863] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[ 1.099108] VFS: Mounted root (ext4 filesystem) on device 179:2.
[ 1.114530] devtmpfs: mounted
[ 1.120799] Freeing unused kernel memory: 1024K
[ 1.125469] Run /sbin/init as init process
[ 1.222574] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
Starting syslogd: OK
Starting klogd: OK
Running sysctl: OK
Initializing random number generator: OK
Saving random seed: [ 1.438545] random: dd: uninitialized urandom read (512 bytes read)
OK
Starting haveged: haveged: can not open UNIX socket
haveged: can not initialize command socket: Function not implemented
haveged: haveged starting up
OK
Starting rngd:
Initalizing available sources
Failed to init entropy source hwrng
libgcrypt not available. Disabling AES in JITTER source
Enabl[ 42.186122] random: crng init done
ing JITTER rng support
Initalizing entropy source jitter
OK
Welcome to Buildroot
buildroot login:
-------------------------------------------------------------------------------------------------------------------------------
一开始是看到 random: crng init done 觉得奇怪,后来经群里大佬知道buildroot选择安装了haveged ,感觉haveged 启动不正常,
然后看一下随机数熵是100多,感觉haveged没起到作用,然后又安装了rng-tool,rng-tool启动时会卡死10秒才能进入系统,又查看
一下随机数熵是4000多,想问下rng-tool启动时卡死10多秒算不算正常,这时间好长。。。。。
请问出现编译没有安装C++编译器,怎么解决呢,buildroot已经使能C++了
make clean一把再重新make
CC = /home/linux/ALLWINNER_F1C100S/buildroot-2017.08/output/host/bin/arm-none-linux-gnueabi-gcc
CCFLAGS = `/home/linux/ALLWINNER_F1C100S/buildroot-2017.08/output/host/arm-buildroot-linux-gnueabi/sysroot/usr/bin/sdl-config --cflags` -O3 -pipe
LDFLAGS = `/home/linux/ALLWINNER_F1C100S/buildroot-2017.08/output/host/arm-buildroot-linux-gnueabi/sysroot/usr/bin/sdl-config --libs`
echo "buildroot" > /home/xiaoguoguo/buildroot-2017.08/output/target/etc/hostname
/bin/sed -i -e '$a \127.0.1.1\tbuildroot' -e '/^127.0.1.1/d' /home/xiaoguoguo/buildroot-2017.08/output/target/etc/hosts
mkdir -p /home/xiaoguoguo/buildroot-2017.08/output/target/etc
echo "Welcome to Buildroot" > /home/xiaoguoguo/buildroot-2017.08/output/target/etc/issue
/bin/sed -i -e s,^root:[^:]*:,root::, /home/xiaoguoguo/buildroot-2017.08/output/target/etc/shadow
rm -f /home/xiaoguoguo/buildroot-2017.08/output/build/locales.nopurge
for i in C en_US locale-archive; do echo $i >> /home/xiaoguoguo/buildroot-2017.08/output/build/locales.nopurge; done
for dir in ; do for langdir in $dir/*; do if [ -e "${langdir}" ]; then grep -qx "${langdir##*/}" /home/xiaoguoguo/buildroot-2017.08/output/build/locales.nopurge || rm -rf $langdir; fi done; done
if [ -d /home/xiaoguoguo/buildroot-2017.08/output/target/usr/share/X11/locale ]; then for lang in C en_US; do if [ -f /home/xiaoguoguo/buildroot-2017.08/output/target/usr/share/X11/locale/$lang/XLC_LOCALE ]; then echo "$lang/XLC_LOCALE: $lang"; fi done > /home/xiaoguoguo/buildroot-2017.08/output/target/usr/share/X11/locale/locale.dir; fi
rm -rf /home/xiaoguoguo/buildroot-2017.08/output/target/usr/include /home/xiaoguoguo/buildroot-2017.08/output/target/usr/share/aclocal \
/home/xiaoguoguo/buildroot-2017.08/output/target/usr/lib/pkgconfig /home/xiaoguoguo/buildroot-2017.08/output/target/usr/share/pkgconfig \
/home/xiaoguoguo/buildroot-2017.08/output/target/usr/lib/cmake /home/xiaoguoguo/buildroot-2017.08/output/target/usr/share/cmake
find /home/xiaoguoguo/buildroot-2017.08/output/target/usr/{lib,share}/ -name '*.cmake' -print0 | xargs -0 rm -f
find /home/xiaoguoguo/buildroot-2017.08/output/target/lib/ /home/xiaoguoguo/buildroot-2017.08/output/target/usr/lib/ /home/xiaoguoguo/buildroot-2017.08/output/target/usr/libexec/ \
\( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
find: `/home/xiaoguoguo/buildroot-2017.08/output/target/usr/libexec/': 没有那个文件或目录
rm -rf /home/xiaoguoguo/buildroot-2017.08/output/target/usr/share/gdb
rm -rf /home/xiaoguoguo/buildroot-2017.08/output/target/usr/share/bash-completion
rm -rf /home/xiaoguoguo/buildroot-2017.08/output/target/usr/share/zsh
rm -rf /home/xiaoguoguo/buildroot-2017.08/output/target/usr/man /home/xiaoguoguo/buildroot-2017.08/output/target/usr/share/man
rm -rf /home/xiaoguoguo/buildroot-2017.08/output/target/usr/info /home/xiaoguoguo/buildroot-2017.08/output/target/usr/share/info
rm -rf /home/xiaoguoguo/buildroot-2017.08/output/target/usr/doc /home/xiaoguoguo/buildroot-2017.08/output/target/usr/share/doc
rm -rf /home/xiaoguoguo/buildroot-2017.08/output/target/usr/share/gtk-doc
rmdir /home/xiaoguoguo/buildroot-2017.08/output/target/usr/share 2>/dev/null || true
find /home/xiaoguoguo/buildroot-2017.08/output/target -type f \( -perm /111 -o -name '*.so*' \) -not \( -name 'libpthread*.so*' -o -name 'ld-*.so*' -o -name '*.ko' \) -print0 | xargs -0 /home/xiaoguoguo/buildroot-2017.08/output/host/bin/arm-buildroot-linux-uclibcgnueabi-strip --remove-section=.comment --remove-section=.note 2>/dev/null || true
find /home/xiaoguoguo/buildroot-2017.08/output/target/lib/ -type f -name 'libpthread*.so*' | \
xargs -r /home/xiaoguoguo/buildroot-2017.08/output/host/bin/arm-buildroot-linux-uclibcgnueabi-strip --remove-section=.comment --remove-section=.note --strip-debug
find /home/xiaoguoguo/buildroot-2017.08/output/target/lib/ -type f -name 'ld-*.so*' | \
xargs -r /home/xiaoguoguo/buildroot-2017.08/output/host/bin/arm-buildroot-linux-uclibcgnueabi-strip --remove-section=.comment --remove-section=.note --strip-debug
test -f /home/xiaoguoguo/buildroot-2017.08/output/target/etc/ld.so.conf && \
{ echo "ERROR: we shouldn't have a /etc/ld.so.conf file"; exit 1; } || true
test -d /home/xiaoguoguo/buildroot-2017.08/output/target/etc/ld.so.conf.d && \
{ echo "ERROR: we shouldn't have a /etc/ld.so.conf.d directory"; exit 1; } || true
mkdir -p /home/xiaoguoguo/buildroot-2017.08/output/target/etc
( \
echo "NAME=Buildroot"; \
echo "VERSION=2017.08"; \
echo "ID=buildroot"; \
echo "VERSION_ID=2017.08"; \
echo "PRETTY_NAME=\"Buildroot 2017.08\"" \
) > /home/xiaoguoguo/buildroot-2017.08/output/target/etc/os-release
-----------------------------------------------------------------------------------------------------------------------------------
find: `/home/xiaoguoguo/buildroot-2017.08/output/target/usr/libexec/': 没有那个文件或目录
{ echo "ERROR: we shouldn't have a /etc/ld.so.conf file"; exit 1; } || true
{ echo "ERROR: we shouldn't have a /etc/ld.so.conf.d directory"; exit 1; } || true
每次编译都会出现,奇怪的是也不影响生成和使用。。。。。
按照荔枝派nano即食的教程
git clone https://github.com/uestczyh222/tina-spl.git
pushd tina-spl
make
得到 .bin文件
烧录进RAM,然后启动
sudo sunxi-fel -p write 0x00000000 tina-spl.bin
sudo sunxi-fel exec 0x00000000
现在有个问题,加了 spiflash-write 烧写入spiflash,复位后运行不了,是烧写地址错了吗?