i.MX 8M Plus Application Notes | FAQ

Users of the FETMX8MP-C SoM have some common problems during use. Below Forlinx will answer the three questions of "replace the logo", "auto-start application" and "display pictures in Qt", based on the OKMX8MP-C development board as an example to explain the idea.


1, LOGO replacement

Solution 1

After the development board is started, replace the image in the path of "run/media/mmcblk2p1" and save it with sync.


*Precautions

MIPI screen, 1024x600 resolution, replace logo-1024x600.bmp.

LVDS screen, 1280x800 resolution, replace logo-1280x800.bmp.

After the replacement is complete, be sure to enter the sync command to save


Solution 2

You can replace the logo image in the source code folder OK8MP-linux-sdk/images path in the development environment.

After the replacement, complete the source code compilation on the command line of the development environment to generate a new ok8mp-linux-fs.sdcard.a*. After merging them, use the newly merged rootfs.sdcard to burn them.


*Precautions

MIPI screen, 1024x600 resolution, replace logo-1024x600.bmp.

LVDS screen, 1280x800 resolution, replace logo-1280x800.bmp.


Common problem:

After the single-step update and replacement of the Logo, the Logo provided by Forlinx itself will flash at startup, and then enter the desktop.

Reason:

The desktop currently set is the logo of Forlinx Company. After the development board is started, the logo is displayed on the desktop. The application desktop is in the form of a web page implemented by Weston, which is opened after the development board is started, so there is a stage where the logo desktop is displayed.

Solutions

Replace "/usr/share/weston/logo-1280x800.png" in the file system with the user's own logo, and the name must be the same.


*Precautions

In Solution 2, the image format used when replacing the Logo in the source code is bmp, and the image format replaced in the file system is png.

The two logos replaced in the above two methods correspond to the MIPI screen and the LVDS screen respectively. Because HDMI itself does not display the Logo during the startup phase, but directly displays the desktop after startup, so there is no method to replace the Logo picture.




2, Start the specified application automatically after booting

At present, the software manual provided by Forlinx has provided the setting method of automatically playing audio when booting, but some customers need to start other applications at boot, so here is a supplement to the self-starting method in the manual:


1. Create a new autorun.sh script in the /etc/ path:

root@OK8MP:~# cd /etc
root@OK8MP:/etc# vi autorun.sh

Write the following in the /etc/autorun.sh script:

#!/bin/bash
. /etc/profile.d/weston.sh
. /etc/profile.d/qt5.sh
sleep 3
/usr/bin/fltest_qt_4g   // Here are the applications and paths that need to be started automatically, taking 4G as an example

After writing and saving, modify the file permissions:

root@OK8MP:/etc# chmod 777 autorun.sh

2. Go to the "/lib/systemd/system/" directory and create a new autorun.service file. The command is as follows:

root@OK8MP:~# cd /lib/systemd/system
root@OK8MP:/lib/systemd/system# vi autorun.service

The content of the file is as follows:

[Unit]
Description=autorun
After=basic.service X.service thermal-zone-init.service
[Service]
ExecStart=/etc/autorun.sh
[Install]
WantedBy=multi-user.target

The description line needs to write the service name, and ExecStart needs to write the absolute path of the executable file.

After saving and exiting, execute the following command on the terminal:

root@OK8MP:~# systemctl -f enable /lib/systemd/system/autorun.service
Created symlink /etc/systemd/system/multi-user.target.wants/autorun.service -> /lib/systemd/system/autorun.service.
root@OK8MP:~# sync

3. Use the following command to close the default desktop:

root@OK8MP:~# systemctl disable matrix.service
Removed /etc/systemd/system/multi-user.target.wants/matrix.service.
root@OK8MP:~# sync

After completing the settings and starting the service according to the previous method, restart the application to automatically start the user's application.


To cancel the auto-start application:

If you want to completely turn off the boot autostart, execute the following command on the terminal:

root@OK8MP:~# systemctl disable /lib/systemd/system/autorun.service
Warning: Can't execute disable on the unit file path. Proceeding with the unit name.
Removed /etc/systemd/system/multi-user.target.wants/autorun.service.

At this point, you can disable the service at boot time. After restarting the development board, this program will no longer run automatically.




3, How to display pictures

Solution 1

Open the picture through the Video Player software in the qml test in the Qt desktop.

Click the three horizontal lines in the upper left corner, select Open image, enter the target path of the image, and click the target image to open it.


*Precautions

The currently tested image formats that can be opened include: jpg, png, and bmp.


Solution 2

Open the ImageViewer application from the command line for viewing.

root@OK8MP:~# cd /usr/share/examples/widgets/widgets/imageviewer
root@OK8MP:/usr/share/examples/widgets/widgets/imageviewer# ./imageviewer

Enter the path where the image to be opened is located in the application, and the target image can be opened.


*Precautions

The currently tested image formats that can be opened include: jpg.




The above are the corresponding solutions to the three display problems that have been asked a lot at present. If you have the same question, you can follow the above steps to see if it is feasible. Follow-up other common problems will also be written in succession related documents to solve.