This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM4378: LCD backlight control

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?

  • Hi,

    LCD backlight is controlled by the PWM driver. Look at the end of this section in the SDK documentation:  

  • i'm guessing you didn't read my post. I KNOW it's controlled my the PWM.

    there is a timed idle shutoff happening that i am not in control of. it's a part of the SDK. how do i turn it off?

  • the timeout is 10 minutes 30 seconds from the last button press if that helps you any

  • Hello,

    I am wondering if you could please use PSDK6.0 and let me know if the issue still persists. I have been able to replicate the issue on PSDK4.3 and I am investigating it further.

    Regards,
    Krunal 

  • Hello,

    I apologize for the delayed response but I was able to resolve the LCD issue by adding "consoleblank=0" parameter to the Kernel command line. Based on my discussion with our experts, if nothing else is running (ie Weston), fbdev/fb console are in control and it has a blanking timeout. Setting consoleblank to zero will ensure the LCD does not turn off. 

    Regards,
    Krunal

  • so i've been looking up and down documentation and i cannot find where to change the kernel command line parameters (temporary or otherwise)

    to make this a permanent change do i change it in u-boot in the passing parameters? if so, which file do i change it to? if it works will "cat /sys/module/kernel/parameters/consoleblank" return a 0?

  • Hello,

    If you are booting from the SD card, please stop at the Uboot prompt and run the following command "setenv mmcrootfstype ext4 rootwait consoleblank=0;saveenv". Next, please run the "boot" command and Kernel will start booting. During boot, the Kernel command line print should reflect your change as shown below:

    "[    0.000000] Kernel command line: console=ttyO2,115200n8 root=PARTUUID=38685d3e-02 rw rootfstype=ext4 rootwait consoleblank=0"

    Regards,
    Krunal

  • i am looking for a more permanent, manufacture-able solution than typing in a command at u-boot

  • so is there not a better way to do this than typing it in at u-boot? are we expected to do this to every board we manufacture for our product? is there not a better solution than this?

  • Hello,

    If you are booting from SD card, the boot partition contains images such as MLO+uboot.img. If possible, you could add another file called uEnv.txt and add the following line of code " optargs='consoleblank=0' ". As the board boots, it will read the text file and pass the argument to the kernel. 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" \
    

    Also, I am wondering if you could please share more details about your application. I am just curious why you are planning on disabling Weston and if you are running a FB based application, the blank/unblank could be controlled by the user application using the fbdev ioctls.

    Regards,
    Krunal

  • 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?

  • 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

  • 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

  • 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
  • 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

  • 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. 

  • 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

     

  • 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

  • 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

  • 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.