Click here to Skip to main content
15,893,644 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a 2.2" TFT-LCD and an ARM-based board(nanopi-m1) with Ubuntu-server-16.04 on it. I have a framebuffer driver named NOTRO(https://github.com/notro/fbtft) that uses fbtft support on kernel and makes my display work by this commands:

sudo modprobe fbtft_device custom name=fb_ili9341 gpios=reset:1,dc:201,led:6 speed=16000000 rotate=90 bgr=1


With above command my LCD turns on and I have a blank black screen. Then I must run this command to have my x-manager screen:

FRAMEBUFFER=/dev/fb8 startx


But now, I like to change my Linux settings to do these commands automatically at startup. but I don't know how?

I must say I have installed these packages too:

xorg, xserver-xorg-video-fbdev, openbox


What I have tried:

I did convert my /boot.script.bin to custom.fex file with this content:
GNU nano 2.5.3              File: custom.fex                                  

[product]
version = "100"
machine = "FriendlyARM NanoPi M1"

[platform]
debug_mode = 1
eraseflag = 1
next_work = 2

[target]
boot_clock = 1008
storage_type = -1

[key_detect_en]
keyen_flag = 0

[fel_key]
fel_key_max = 7
fel_key_min = 2


Then I must change what I want to boot here and convert it to .bin file again.
Also I found this tutorial for that but I am afraid of changing it wrong!

 script.bin/fex file

The settings in the [disp_init] section of the script.bin/fex file define the display output enabled at boot.

An example configuration for HDMI:

[disp_init]
disp_init_enable = 1
disp_mode = 0
screen0_output_type = 3
screen0_output_mode = 4
fb0_framebuffer_num = 2
fb0_format = 10
fb0_pixel_sequence = 0
fb0_scaler_mode_enable = 0

    disp_mode selects single-screen output or different dual screen modes. Generally this is 0, which means use screen0 with fb0 (one screen).
    screen0_output_type = 3 means HDMI output.
    screen0_output_mode selects the video/monitor mode to use (resolution and refresh rate). See the table in the Fex guide.
    fb0_framebuffer_num selects the number of buffers for fb0, generally you need 2 or more for video acceleration or Mali (3D), 3 is better.
    fb0_format and fb0_pixel_sequence determine the pixel format in the framebuffer. The above example (values of 10 and 0) selects the most common variant of 32bpp truecolor (ARGB).
    fb0_scaler_mode_enable selects whether the scaler should be enabled. Enabling it does not really scale pixels, it configures the scaler to scale pixels 1-to-1 which can fix screen refresh-related problems at 1080p resolution. See the section below. 

Similar parameter are defined for screen1 (which is usually disabled in practice). 
Posted
Updated 1-Nov-17 1:51am
v3

1 solution

See the section Make it permanent at Home · notro/fbtft Wiki · GitHub[^].

You have to load the module automatically using a modprobe configuration file instead of manually using the modeprobe command.

To tell Xorg to use the device put the FRAMEBUFFER= command into some script that is executed at startup. Alternatively create an Xorg configuration file (see Framebuffer use · notro/fbtft Wiki · GitHub[^]).

I don't know the nanopi and the Ubuntu build for it. With a Raspberry Pi you can also use a device tree file for your display making it the default display at startup (boot messages are shown on the SPI display). You may check if the nanopi supports this too. Then there is no need to load the module.
 
Share this answer
 
Comments
Member 13376650 31-Oct-17 5:29am    
I use armbian 5.30
Jochen Arndt 31-Oct-17 5:39am    
You might check if that supports device trees. In any case it should work by loading the module automatically and tell the Xorg server which framebuffer to use as described.
Member 13376650 31-Oct-17 7:09am    
I did it and made two "fbtft.conf " files where the tutorial said, but unfortunately after reboot, I have only a white(gray) screen and can not even connect to my board by SSH
Jochen Arndt 31-Oct-17 7:12am    
You have to set the same parameters as in the manual modprobe command.
Member 13376650 31-Oct-17 7:20am    
I exactly copied it!
I don't know why SSH access fails noW! it's so strange

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900