How to make 7" LCD Screen working on the A13Micro with Debian or Custom distrib?

Started by Nico, January 25, 2013, 08:32:45 PM

Previous topic - Next topic


Hi Everyone,

I managed to compile my own uboot and my own kernel for the A13 Micro. Using a13_olinuxino_micro config file for uboot and a13om_defconfig for linux-sunxi on
With that I am using the debian RootFS as described on the wiki for building it's own sd card.
I used the script.bin of the lcd folder I found inside the Debian prebuilt image for the A13 Micro found on the olimex wiki.

If I boot without the LCD screen plugged, it works fine and I get until my root login in Debian.
If I boot with the LCD screen plugged, startup hangs and reboot after that:
[    0.380000] sunxi-uart.1: ttyS0 at MMIO 0x1c28400 (irq = 2) is a U6_16550A
<6>console [ttyS0] enabled
[    0.400000] console [ttyS0] enabled
[uart]: serial probe 1, membase   (null) irq 2 mapbase 0x01c28400
[    0.400000] [uart]: serial probe 1, membase   (null) irq 2 mapbase 0x01c28400
<6>brd: module loaded
[    0.410000] brd: module loaded
<6>loop: module loaded
[    0.420000] loop: module loaded
<6>usbcore: registered new interface driver ub
[    0.420000] usbcore: registered new interface driver ub
nand driver is disabled
[    0.430000] nand driver is disabled
<6>sun4i gpio driver init
[    0.440000] sun4i gpio driver init

(and it automaticaly reboot)

U-Boot SPL 2012.10-04276-gf2bdd4e (Jan 25 2013 - 15:06:01)

If I unplug the LCD screen, the step after sun4i gpio driver init is the SPI driver init (maybe there is a link ?).

Also I was having a quite close problem using the A13 micro prebuild debian image.

Did I miss step to make the LCD screen working ? Any idea on why this is happening and how I could use the LCD screen ?

Thanks a lot!
See U around.


LCD takes *lot* of power, please measure with voltmeter your power supply voltages with and without LCD attached to locate the problem


I have the 5v 1a dc supply sold on the Olimex website, it should be sufficient for the LCD 7inch, isn't it ?
So as you told me, I measured the current while booting, and with the LCD plugged it's between 4.95V and 5.0V and it's about the same (never going until 5.0V ) with out the LCD. It seems normal, no ?

I just tried again with the Debian image for A13 and the problem is exactly the same. I also tried using a VGA screen, and the framebuffer works well.
The A13 Micro prebuilt debian Image should Work for the LCD Screen without any change (except the script.bin I guess), no ?

Thanks for the help !


Hi Everyone,
I just found out why it didn't work.
In the debian prebuilt image for A13 micro SUN4I_GPIO_UGLY is set as built-in, like in the heopmajhe github. It has to be set as a module in order to avoid the crash I was experimenting.
Maybe you should update the wiki and mention that ?

With this modification, it works pretty fine.



Well, actually I don't really know about that, I just know that it works like that for me.
Maybe the sun_4i_gpio driver is loaded too early if built-in, and not if module, does this would make sense ?



The GPIO is confugured using the .fex (compiled to .bin) file on the boot partition. If the GPIO configuration claims some pins the LCD driver needs, the LCD driver would fail. Using the GPIO driver as module would start the LCD driver first and so it would be able to claim all the needed resources.

This is a wild guess, but certainly worth checking.


Thanks!  At least possible.  Next would need to check the poster's fex (or bin) against what the LCD wants.


Interesting. Well the .fex I used is the one from the Prebuild Debian Image: here is the lcd part:

lcd_used = 1
lcd_x = 800
lcd_y = 480
lcd_dclk_freq = 33
lcd_pwm_not_used = 0
lcd_pwm_ch = 0
lcd_pwm_freq = 10000
lcd_pwm_pol = 0
lcd_if = 0
lcd_hbp = 46
lcd_ht = 1055
lcd_vbp = 23
lcd_vt = 1050
lcd_hv_if = 0
lcd_hv_smode = 0
lcd_hv_s888_if = 0
lcd_hv_syuv_if = 0
lcd_hv_vspw = 1
lcd_hv_hspw = 30
lcd_lvds_ch = 0
lcd_lvds_mode = 0
lcd_lvds_bitwidth = 0
lcd_lvds_io_cross = 0
lcd_cpu_if = 0
lcd_frm = 1
lcd_io_cfg0 = 268435456
lcd_gamma_correction_en = 0
lcd_gamma_tbl_0 = 0x0
lcd_gamma_tbl_1 = 0x10101
lcd_gamma_tbl_255 = 0xffffff
lcd_bl_en_used = 1
lcd_bl_en = port:power1<1><0><default><1>
lcd_power_used = 1
lcd_power = port:power0<1><0><default><1>
lcd_pwm_used = 1
lcd_gpio_0 = ""
lcd_gpio_1 = ""
lcd_gpio_2 = ""
lcd_gpio_3 = ""
lcdd0 = port:PD00<2><0><default><default>
lcdd1 = port:PD01<2><0><default><default>
lcdd2 = port:PD02<2><0><default><default>
lcdd3 = port:PD03<2><0><default><default>
lcdd4 = port:PD04<2><0><default><default>
lcdd5 = port:PD05<2><0><default><default>
lcdd6 = port:PD06<2><0><default><default>
lcdd7 = port:PD07<2><0><default><default>
lcdd8 = port:PD08<2><0><default><default>
lcdd9 = port:PD09<2><0><default><default>
lcdd10 = port:PD10<2><0><default><default>
lcdd11 = port:PD11<2><0><default><default>
lcdd12 = port:PD12<2><0><default><default>
lcdd13 = port:PD13<2><0><default><default>
lcdd14 = port:PD14<2><0><default><default>
lcdd15 = port:PD15<2><0><default><default>
lcdd16 = port:PD16<2><0><default><default>
lcdd17 = port:PD17<2><0><default><default>
lcdd18 = port:PD18<2><0><default><default>
lcdd19 = port:PD19<2><0><default><default>
lcdd20 = port:PD20<2><0><default><default>
lcdd21 = port:PD21<2><0><default><default>
lcdd22 = port:PD22<2><0><default><default>
lcdd23 = port:PD23<2><0><default><default>
lcdclk = port:PD24<2><0><default><default>
lcdde = port:PD25<2><0><default><default>
lcdhsync = port:PD26<2><0><default><default>
lcdvsync = port:PD27<2><0><default><default>



Then you're probably left with hunting through that and the GPIO config you were attempting until you find the conflict(s).



Here is the GPIO part of the .fex file:

gpio_used = 1
gpio_num = 15
gpio_pin_1 = port:PB03<1><default><default><default>
gpio_pin_2 = port:PB04<1><default><default><default>
gpio_pin_3 = port:PB10<1><default><default><1>
gpio_pin_4 = port:PE04<0><default><default><default>
gpio_pin_5 = port:PE05<0><default><default><default>
gpio_pin_6 = port:PE06<0><default><default><default>
gpio_pin_7 = port:PE07<0><default><default><default>
gpio_pin_8 = port:PE08<1><default><default><default>
gpio_pin_9 = port:PE09<1><default><default><default>
gpio_pin_10 = port:PE10<1><default><default><default>
gpio_pin_11 = port:PE11<1><default><default><default>
gpio_pin_12 = port:PG09<1><default><default><default>
gpio_pin_13 = port:PG10<1><default><default><default>
gpio_pin_14 = port:PG11<1><default><default><default>
gpio_pin_15 = port:PB02<1><default><default><0>