Dry goods sharing丨How to debug and display Feiling i.MX8MM in uboot

l i.MX8MM display structure

The display of imx8m mini only has 1 MIPI_DS display interface'jie' structure is as follows:

 

 

l   Display parameter adjustment

When we debug and display, we need to initialize LCDif and MIPI_DSI. The driver in uboot has provided a complete driver. We only need to set the environment variable panel. The driver matches the name of the display device in the display device list according to the value of the panel, and selects the current Device display. If the panel value is set to "MIPI7", a display device named "MIPI7" will be found in the display list, and related devices will be initialized according to this device. This device is a 7-inch mipi display that we support by default. You can see the name of the device and detailed display parameters from the picture below.

 

If the user needs to add his own display screen, he only needs to add a set of display parameters according to the manual of the screen, set the panel, and specify to use the added parameters. (Note: This method is only for mipi screens that do not require additional initialization)

But since our uboot is not open source, users cannot modify the source code, so they add a set of display parameters. In response to this situation, we provide a solution. We provide a set of parameters. After the user selects this set of parameters, he can modify the displayed parameters in this set of parameters by modifying environment variables.

The name of this group of display parameters used to display the mipi screen is "MIPI_CUSTOM". As long as the panel is set to "MIPI_CUSTOM", this group of parameters will be selected. The following figure is the default value of this group of parameters.

 

How to modify this set of parameters? By default, this set of parameters cannot be modified. We have done extra work to perform special processing when detecting that the name of the panel used is "MIPI_CUSTOM". If it is detected that the value of the environment variable custom_video_mode is not empty, then parse custom_video_mode To replace the default display parameters with the display parameters contained in it.

 

Determine whether it is a custom parameter

  

 

 

Custom parameters replace default parameters

 

 

l   Actual test

Let's demonstrate how to use it. First, start the  development board , press the space bar in uboot to enter the uboot menu, press 1 to exit the menu and enter the  command mode

Then, we input the command to set the panel value to MIPI_CUSTOM, and set the custom_video_mode value so that refresh, xres, yres, pixclock, left_margin, right_margin, upper_margin, lower_margin, hsync_len, vsync_len and other values ​​are set to the values ​​we want, for example, we have a piece of 800x1280 Screen, set the parameters to refresh=60,xres=800,yres=1280,pixclock=20000,left_margin=32,right_margin=20,upper_margin=8,lower_margin=4,hsync_len=40,vsync_len=1 (Note : The  clock is the time value, the unit is picoseconds, 10 divided by the 12th power is the frequency value)

 

Then you need to enter the following command

Set the panel value to MIPI_CUSTOM

setenv   panel MIPI_CUSTOM

 

Set custom parameters

setenv   custom_video_mode refresh=60,xres=800,yres=1280,pixclock=20000,left_margin=32,right_margin=20,upper_margin=8,lower_margin=4,hsync_len=40,vsync_len=1

 

Save environment variables

saveenv

 

The display parameters take effect after restarting.

 

We can also use this method to quickly test whether our display parameters are accurate, because this test is very fast, only need to set environment variables in uboot, no need to modify the code and burn.

 

l   Batch programming

After our test shows that it is normal, we can also add the  uboot environment variables to burn the environment variables we have tested to the storage medium when the TF card is burned, and the burn and start is what we want. show result.

How to append uboot environment variables:

 

Create a file on the computer, the file name env.ini. Each line of the file is an environment variable, the format is: the name of the environment variable = the value of the environment variable.

 

Add the environment variables we confirmed in the above operation steps to env.ini, each environment variable has one line, add according to the format, such as: add panel =MIPI_CUSTOM in the first line, add custom_video_mode= refresh=60,xres=800, yres=1280,pixclock=20000,left_margin=32,right_margin=20,upper_margin=8,lower_margin=4,hsync_len=40,vsync_len=1

 

Put the modified env.ini into the made TF card (refer to the user manual for the TF card making process), and use the secondary TF card to burn it. After the programming is completed, restart, check whether the environment variable has been added to the storage, and the display is normal.

Guess you like

Origin blog.csdn.net/ningmengzier/article/details/108604267