UARTC is not initialized\not accessable

Which Khadas SBC do you use?

VIM3 Pro

Which system do you use? Android, Ubuntu, OOWOW or others?

Ubuntu

Which version of system do you use? Khadas official images, self built images, or others?

official emmc Ubuntu 22 gnome

Please describe your issue below:

I’ve enabled uart3 overlay according to VIM3/3L UART [Khadas Docs]
Just set
fdt_overlays=uart3
at
/boot/dtb/amlogic/kvim3.dtb.overlay.env
Then rebooted, got /dev/ttyS3, but pins 15 and 16 are just always high. I’ve checked it with oscilloscope.

What could be the reason?

I feel like I’m missing something or there is a missing piece in docs. So I had to create another UART issue as I’ve studied all related here, and no one actually contains the solution or even describes similar case.

Post a console log of your issue below:

Welcome to minicom 2.7.1

OPTIONS: I18n 
Compiled on Dec 23 2019, 02:06:26.
Port /dev/ttyUSB0, 21:57:20

Press CTRL-A Z for help on special keys

G12B:BL:6e7c85:2a3b91;FEAT:E0F83180:402000;POC:F;RCY:0;EMMC:0;READ:0;0.
                                                                        bl2_stage_init 0x0b
bl2_stage_init 0x01
bl2_stage_init 0x81
hw id: 0x0000 - pwm id 0x01
bl2_stage_init 0xc1
bl2_stage_init 0x02

....
                                                                                                      
Retrieving file: /splash.bmp                                                                                                                      
1:      Default                                                                                                                                   
Enter choice: 1:        Default                                                                                                                   
Retrieving file: /initrd.img                                                                                                                      
20436592 bytes read in 581 ms (33.5 MiB/s)                                                                                                        
Retrieving file: /Image                                                                                                                           
35183104 bytes read in 988 ms (34 MiB/s)                                                                                                          
Retrieving file: /dtb/amlogic/kvim3.dtb                                                                                                           
107608 bytes read in 20 ms (5.1 MiB/s)                                                                                                            
Retrieving file: /dtb/amlogic/kvim3.dtb.overlay.env                                                                                               
19 bytes read in 21 ms (0 Bytes/s)                                                                                                                
WARNING: 'fdt_overlays_dir' neither in running nor in imported env!                                                                               
fdt_overlay_helper: /dtb/amlogic/kvim3.dtb.overlay.env                                                                                            
 /dtb/amlogic/kvim3.dtb.overlays: uart3                                                                                                           
Retrieving file: /dtb/amlogic/kvim3.dtb.overlays/uart3.dtbo                                                                                       
225 bytes read in 25 ms (8.8 KiB/s)                                                                                                               
fdt overlay: uart3 - apply                                                                                                                        
MIPI LCD not exist, disable lcd & touch panel nodes.                                                                                              
Setup PCIe/USB3.0 mode to USB3.0.                                                                                                                 
Setup DDR size to 4GB.                                                                                                                            
Retrieving file: /boot/uEnv.txt                                                                                                                   
539 bytes read in 8 ms (65.4 KiB/s)                                                                                                               
Import user vars: /boot/uEnv.txt 539 bytes                                                                                                        
append: root=UUID=a76c9bd7-d7a1-43de-8d45-affd5c205f3e rootflags=data=writeback rw rootfstype=ext4 loglevel=4 no_console_suspend earlycon=aml-uar 
load dtb from 0x1000000 ......                                                                                                                    
## Flattened Device Tree blob at 20000000                                                                                                         
   Booting using the fdt blob at 0x20000000                                                                                                       
remove env:hdr_policy=0                                                                                                                           
remove env:hdr_priority=                                                                                                                          
remove env:lcd_debug=0x00000000                                                                                                                   
remove env:dolby_vision_on=0                                                                                                                      
remove env:osd_reverse=0                                                                                                                          
   reserving fdt memory region: addr=20000000 size=1b000                                                                                          
   Loading Ramdisk to 3d482000, end 3e7ff670 ... OK                                                                                               
   Loading Device Tree to 000000001ffe2000, end 000000001fffffff ... OK                                                                           
.....

I couldn't post the whole log due to length limitation. Can I just upload txt file?

Hello @Alex999
I’m sorry I couldn’t reproduce your issus.And I also measured PINs 15 and 16 using a multimeter, and they are not always high.

Normally we use PINs 18 and 19 as debug ports.PINs 15 and 16 are additional serial ports that are opened via overlays.

Code in docs is support to /dev/ttyS2 and baud rate 921600 device, VIM3 PRO should change it to /dev/ttyS3 and baud rate 115200.

I didn’t use the code, just minicom. Debug uart works fine - this is how i’ve got startup log. Any suggestions for steps to debug further? looks like maybe those pins 15,16 left gpios and not switched to uart.
Maybe i could somehow verify this?

Maybe you can update the firmware to the latest version. You can also check gpio pins via gpio readall.


Looks like this is it, right?

When you say “firmware to the latest version” do you mean these images dl.khadas.com - Index of /products/vim3l/firmware/ubuntu/emmc/ ?
I’ve flashed vim3-ubuntu-22.04-gnome-linux-5.15-fenix-1.6.3-240112-emmc from there originally.

Yes, the latest firmware has benn released on our site.

From the picture, it loooks like PINs 15 and 16 is always high, but that are not the default value, maybe you changed their values manually earlier? :face_with_monocle:

Nope. I did not. And to prove it once again. I reflashed board with the same image (latest, i guess) checked pin 15 16 states: mode IN, V 0
Then enabled uart3 overlay, started minicom -D /dev/ttyS3 connected 14 15 16, tested with minicom from the host - not working. My ttl-usb is proved working device - i’ve read startup log from this exact VIM3 with it.
So. UART3 is not working.
gpio readall → pins 15 16 mode ALT1, V 1
disconnect pins
pin 15 goes down: V 0 pin 16 as it was V 1

Any suggestions?

Please show me how did you test the uart3.

Hey! I finally managed to run it. The key was the hw flow control that enabled by default in minicom.
My bad, Guys. Sorry for taking so much of your time for this mistake.

:laughing::laughing::laughing:
Anyway congratulations!