• Resolved

Linux/AM4378: LCD backlight control

Mastermind 7405 points

Replies: 20

Views: 410

Part Number: AM4378

Tool/software: Linux

we are writing a program where we would like to have complete control of the backlight but it would appear that we do not.

linux SDK ti-processor-sdk-linux-am437x-evm-04.03.00.05

am4378 EVM

in the program, for right now weston is disabled at the start of the program via: 

system("systemctl stop weston");

when the program is active and disabling the backlight off control in our code, if we don't touch anything for a while the backlight still turns off

is this a result of us not entirely disabling weston from start up or is something else controlling the backlight? if so how can i disable it so we are the only master?

  • In reply to Krunal Bhargav34:

    our application uses Altia instead of QT to run the display/GUI and to do that it needs weston to be disabled. 

    i would much prefer to control the backlight via ioctls but i am very new to linux and since i didn't see any "backlight" in the /dev/ directory i did not think i could control the backlight that way. i see fb, fb0, and fd in the /dev/ directory. am i to assume one of the fb's is the backlight?

  • In reply to Krunal Bhargav34:

    i also added the line to mmc.h and i did not get "consoleblank=0" anywhere in my boot up messages (yes i rebuilt u-boot and added it to my SDCard) and when i do the command:

    cat /sys/module/kernel/parameters/consoleblank

    i still get 600

  • In reply to cobsonchael:

    Hello,

    Yes, fb0 is the framebuffer console you are interested in. In Linux, after the LCD turns off, the following command will turn it on: echo 0 > /sys/class/graphics/fb0/blank. Here is a reference document.

    Also, in the previous post, I had you run the command "saveenv" and the environment variables got stored in mmc. In order to reflect the change we just made, please run "env default -f -a;saveenv" in the Uboot prompt.   

    Regards,
    Krunal

  • In reply to Krunal Bhargav34:

    so while i wait for our IT team to unblock that website i'll ask - the blanking will be completely under my control if i write 0 to fb0/blank?

    the route i was taking was avoiding having to enter in anything at u-boot. i was following this advice:


    Another alternative is to navigate to the file <u-boot_dir>/include/environment/ti/mmc.h and modify the default variables as follows:

    "args_mmc=run finduuid;setenv bootargs console=${console} " \
        "${optargs} " \
    +   "consoleblank=0 " \
        "root=PARTUUID=${uuid} rw " \
        "rootfstype=${mmcrootfstype}\0" \






    i did that and i did not get consoleblank=0 in my boot message
  • In reply to cobsonchael:

    Hello,

    As I previously mentioned, we ran the "saveenv" command and it saves the default environment variables in the eMMC. Every reboot, Uboot will load the environment variables from the eMMC. In order to update the variables, please run the command "env default -f -a" and "saveenv" in Uboot.  

    Next, please run the command "printenv" and you should see the updated variable "args_mmc=run finduuid;setenv bootargs console=${console} ${optargs} consoleblank=0 root=PARTUUID=${uuid} rw rootfstype=${mmcrootfstype}"

    Regards,
    Krunal

  • In reply to Krunal Bhargav34:

    that might be fine for my development board but i am looking for a solution that we can run in a manufacturing environment. having a person interrupt u-boot to run a command on every single board manufactured is not a good solution. 

    is there a file i can directly edit that will add this command to the kernel command line so we don't have to enter anything into a console? we already have a bunch of u-boot files we had to change anyway for our custom board so changing one more file shouldn't make a difference. 

  • In reply to cobsonchael:

    Hello,

    I just wanted to clarify that the solution I provided above does not require a person to stop at Uboot prompt. On any board (production or development), the changes you make in the mmc.h file will be reflected in Uboot. However, if you run the command "saveenv", your environment variables at that instance will be stored in the eMMC. Upon every reboot, the variables will be loaded from the eMMC.

    In order to remove the contents from the eMMC, I usually run the following commands:

    => mmc list
    OMAP SD/MMC: 0 (SD)
    OMAP SD/MMC: 1 (eMMC)
    => mmc rescan
    => mmc dev 1
    switch to partitions #0, OK
    mmc1(part 0) is current device
    => mmc erase 0 0x400
    
    MMC erase: dev # 1, block # 0, count 1024 ... 1024 blocks erased: OK
    

    Regards,
    Krunal

     

  • In reply to Krunal Bhargav34:

    so the change to mmc.h is supposed to do exactly what i want, right? no additional commands? 

    as i posted on september 5th

    i also added the line to mmc.h and i did not get "consoleblank=0" anywhere in my boot up messages (yes i rebuilt u-boot and added it to my SDCard in the boot partition) and when i do the command:

    cat /sys/module/kernel/parameters/consoleblank

    i still get 600

  • In reply to cobsonchael:

    Hello,

    Yes, that is correct and no additional commands are needed.However, your current test board has old environment variables stored in the eMMC. In order to reflect the changes, either run the command "env default -f -a; saveenv" (inside Uboot) or erase the contents of the eMMC.

    Regards,
    Krunal

  • In reply to Krunal Bhargav34:

    removing the environment file worked. i didn't realize that the .env file makes the system not look into the defaults at all. thanks for helping.