Solutions to Common Problems Under iMX6Q Linux
1. Automatic login on iMX6Q platform
There is an automatic login soft connection login in the bin directory under the root directory of the iMX6 platform, and the login verification is implemented by the etc/rc.d/rc_mxc.S script.
To achieve automatic login, you can pass parameters to the link to log in to the root account directly.
Modify rc_mxc.S to make its content as follows:
/bin/login -f root // Pass the parameters of root login directly
if grep -sq ttymxc0 /proc/cmdline; then
/sbin/getty -L ttymxc0 115200 vt100
elif grep -sq ttymxc1 /proc/cmdline; then
/sbin/getty -L ttymxc1 115200 vt100
elif grep -sq ttymxc2 /proc/cmdline; then
/sbin/getty -L ttymxc2 115200 vt100
elif grep -sq ttymxc3 /proc/cmdline; then
/sbin/getty -L ttymxc3 115200 vt100
In this way, you can log in to the root account directly without verification after booting
2. How to load the Qt application you made on the main interface of the iMX6Q series development board
1. Modify in the file system, modify the opt/qt4.8.5/demos/embedded/fluidlauncher/config.xml file (for example, take the program of adding led as an example):
After opening the file, add in the next line of <example filename="../../../apps/backlight" name="backlight test" image="screenshots/apps/backlight.png"/>
<example filename="../../../apps/led" name="LED test" image="screenshots/apps/led.png"/>
Remember to save after adding
2. Add the led.png picture to opt/qt4.8.5/demos/embedded/fluidlauncher/screenshots/apps for the main interface to identify the led program.
3. Add the executable file led compiled by yourself in opt/qt4.8.5/apps, and give the executable file the executable permission with the chmod command.
4.After the above addition is completed, use sync to save, restart the development board and open the main interface at this time, and you can see the led executable program you added.
3. The method of i.MX6Q development board linux with qt system to start qt running program automatically.
The modified file path and file name: /etc/rc.d/apps.sh
Modify lines 3 and 4 of the following script to the storage path of your own application and the name of your own application.
4. Remove the title bar of the Qt program on the i.MX6Q development board
Using the Qt interface program generated by Qt Creator, the default interface is with a title bar (menu bar). How to remove this title bar?
It can be easily achieved using the following statement:
ui (new Ui::Widget)
this->setWindowFlags(Qt::FramelessWindowHint);// Remove the title
Add the red statement above to the corresponding location of the source file in the created project.
5. Adjustment of label size in i.MX6 Qt program
Label is a device we often use in Qt programming. How to adjust its size? Here I introduce two methods.
1. Manually adjust directly in the .ui file or adjust in the attribute column on the lower right side.
2. Modify in the header file of the ui file.
The ui file is generally not visible, how to make it visible? Click the filter view icon above the project file list and remove the item "Hide generated files", then you can see the hidden header files.
You can find the function setGeometry() to set the label graphics in the header file. Geometry is the meaning of geometric graphics. The parameter of this function is a rectangle, which defines its starting position (the coordinates of the upper left corner) and the length and width label->setGeometry (QRect(100,100,150,50)), which defines a 150*50 interface starting from the position (100,100) on the screen.
6. iMX6 Qt programming output debugging information on the console
When doing Qt programming, we want to monitor the running status of the program on the console, and debug the program, which can be achieved by printing information on the console.
Here we are using the QDebug() function. This function can output information on the console as follows:
#include <QDebug> First include the header file of the function
qDebug()<<"hi"<<endl; endl Play the role of line break
7. i.MX6Q development board ftp service connection new user permission problem solution method
Create your own user on the development board, use your own user name to use the ftp function
1, adduser abc add user abc
2. The passwd abc command sets the user abc password
3. adduser -g root abc will add the new user to the root user, otherwise the ifconfig command will not work
4.cat /etc/shadow check the abc password and copy the abc password
5. vi /etc/passwd copy the password directly to the passwd file
So you can use ftp to access user abc
The OKMX6Q-S2 development board is rich in resources, with a 5M pixel digital camera onboard, a standard dual 8-bit LVDS interface and HDMI-1.4 interface, which can give full play to the powerful multimedia performance; SDXC standard SD card interface, SATA hard disk interface storage capacity is easy Upgrade to TB level; common industrial interfaces such as RS232, CAN, RS-485 are available. The OKMX6Q-S2 development board has passed CE and FCC dual certification.