1 1
Hikmet TEKIN

disable UART0 on OPI-Zero

Recommended Posts

Hi everybody,

 

I have orange pi zero h2+ 512mb ram and I need to use 3 uart to run my c code. 

I can use UART1 on pin 8-10 and UART2 on pin 11-13. I also want to use UART0 in my program but it is attached to console. 

 

How can I disable the UART0 console to use it as normal TTL serial?

 

Thanks

Share this post


Link to post
Share on other sites


 

 

I tried to disable from boot/boot.cmd file in orange pi zero 

 

if test "${console}"= "serial" || test "${console}" ="both"; then setenv consoleargs "${consoleargs} console=ttyS0,115200"; fi

I changed this line to this;

if test "${console}"= "serial" || test "${console}" ="both"; then setenv consoleargs "${consoleargs} console=ttyS2"; fi

There is still get u-boot messages from serial port. I will need to use 3 UART for my application and there is only 2 I can use right now.

 

image.thumb.png.907c253b449d508a9f722c67b88d48c9.png

 

How can I disable this u-boot messages?

 

Thanks

Share this post


Link to post
Share on other sites

From what I remember, changing  the above consolve argument only tell kernel to switch to new port.

To get rid of the u-boot logs, you need to re-compile a u-boot with CONFIG_SILENT_CONSOLE=y

Share this post


Link to post
Share on other sites

I added some patch to file /build/patch/u-boot/u-boot-sunxi/mine.patch and compiled the debian jessie and load image to SD card. but it is not disable the u-boot messages on serial.

 

I added these to patch file

diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -487,8 +487,8 @@ extern int soft_i2c_gpio_scl;

 #ifdef CONFIG_VIDEO
 #define CONSOLE_STDOUT_SETTINGS \
-	"stdout=serial,vga\0" \
-	"stderr=serial,vga\0"
+	"stdout=\0" \
+	"stderr=\0"
 #else
 #define CONSOLE_STDOUT_SETTINGS \
 	"stdout=\0" \

#define CONFIG_SILENT_CONSOLE=y \

 

I also changed the /boot/boot.cmd from this

if test "${console}" = "display" || test "${console}" = "both"; then setenv consoleargs "console=tty1"; fi
if test "${console}" = "serial" || test "${console}" = "both"; then setenv consoleargs "${consoleargs} console=ttyS0, 115200"; fi

to this

if test "${console}" = "display" || test "${console}" = "both"; then setenv consoleargs "console=tty1"; fi
if test "${console}" = "serial" || test "${console}" = "both"; then setenv consoleargs "${consoleargs} console=tty1"; fi

 

 

But I am still getting u-boot messages on serial output.

 

What should I do?

 

Thanks

Share this post


Link to post
Share on other sites

Am I gonna add it to this file 

build/config/kernel/linux-sun8i-dev.config

or 

build/config/kernel/linux-sun8i-default.config

 

Because these file header says "DO NOT EDIT ."

 

Could you please help me little bit more where should I enter it. I installed ubuntu 16.04 to my desktop and clone the armbian git repository. If you give me the folder direction I can just add it and re-compile it and than test it. 

 

Thanks

Share this post


Link to post
Share on other sites

martinayotte,

 

I am not very familiar with linux enviroment. I always worked in C for embedded processors. but now I need to use orange pi zero and could you please help me to make patch to update file.  I will try to create a patch file and put it to patch directory. when I compile the armbian. Is it apply patches to it or not? 

 

Thanks

Share this post


Link to post
Share on other sites

The patch should look like the following, although not tested :

 

--- a/configs/orangepi_zero_defconfig
+++ b/configs/orangepi_zero_defconfig
@@ -15,3 +15,4 @@ CONFIG_SPL_SPI_SUNXI=y
 CONFIG_SUN8I_EMAC=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
+CONFIG_SILENT_CONSOLE=y

 

Share this post


Link to post
Share on other sites

I added a patch file to /build/userpatches/u-boot/u-boot-sunxi/disable.patch

 

But when I try to compile it gives me error as failed what should I do?

 

image.png.bd37b58af440422ac0f89e1aabb7188f.png

 

Thanks for helps

Share this post


Link to post
Share on other sites

I tried the compile one more time and it compiled the armbian-debian-jessie 8 and I got the image file load it to sd card. I booted it up and check it on serial port. There is still u-boot messages. What can I do?  I added the log file and patch file.

disable.patch

patching.log

 

here is the serial output screenshot.

 

image.thumb.png.b629ade65e107c7b2e4f4032bebdf95c.png

Share this post


Link to post
Share on other sites

Your patch didn't applied because you deleted the context lines. Keep the all the lines here :

 

--- a/configs/orangepi_zero_defconfig
+++ b/configs/orangepi_zero_defconfig
@@ -15,3 +15,4 @@ CONFIG_SPL_SPI_SUNXI=y
 CONFIG_SUN8I_EMAC=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
+CONFIG_SILENT_CONSOLE=y

 

Share this post


Link to post
Share on other sites

I compiled the armbian-debian-jessie with this patch. I found the error on patch. It just because of space character in front of the CONFIG_'s part. I fixed it and compiled but I couldn't disable u-boot messages. there is still u-boot messages. 

Thanks 

Share this post


Link to post
Share on other sites

Euh ??? The spaces in front of CONFIG should be present ...

Did you looked at resulting build/cache/sources/u-boot/v2017.11/configs/orangepi_zero_defconfig ?

Also, did you look at resulting build/cache/sources/u-boot/v2017.11/.config ?

 

Share this post


Link to post
Share on other sites
8 hours ago, martinayotte said:

Did you looked at resulting build/cache/sources/u-boot/v2017.11/configs/orangepi_zero_defconfig ?

Yes, I checked the file, there is two file. One is ending with .config and other end with config.orig  I checked them one of them is original file and other is in use. Patch applied to it. I can see there is  CONFIG_SILENT_CONSOLE. It is at the end of file. 

Share this post


Link to post
Share on other sites

That is strange that this option doesn't work. I've never tried it myself, but I presume lot of people did ...

Are you sure that this newly compiled u-boot is effectively installed on your boot media ?

 

Share this post


Link to post
Share on other sites

I run Ubuntu 16.04 on virtual machine. I just clone the armbian/build and it downloaded everything and compiled. How can I check that newly compiled u-boot? thanks

Share this post


Link to post
Share on other sites

If it is the second, then you don't get a full image.

 

To write the newly compiled u-boot, do the following where /dev/sd? is the unmounted existing sdcard :

dd if=build/cache/sources/u-boot/v2017.11/u-boot-sunxi-with-spl.bin of=/dev/sd? bs=1024 seek=8

 

Share this post


Link to post
Share on other sites
3 hours ago, martinayotte said:

If it is the second, then you don't get a full image.

 

To write the newly compiled u-boot, do the following where /dev/sd? is the unmounted existing sdcard :


dd if=build/cache/sources/u-boot/v2017.11/u-boot-sunxi-with-spl.bin of=/dev/sd? bs=1024 seek=8

 

Am I going to do it on Ubuntu or Armbian? 

Share this post


Link to post
Share on other sites

In fact it can be done from both places, except that on Armbian, you will need first to copy the file u-boot-sunxi-with-spl.bin on the board, and then use the 'dd' with different arguments :

dd if=u-boot-sunxi-with-spl.bin of=/dev/mmcblk0 bs=1024 seek=8

So, maybe it would be faster doing the previous from your cross-compile host ... :P

 

Share this post


Link to post
Share on other sites
On 22.12.2017 at 1:58 AM, martinayotte said:

In fact it can be done from both places, except that on Armbian, you will need first to copy the file u-boot-sunxi-with-spl.bin on the board, and then use the 'dd' with different arguments :


dd if=u-boot-sunxi-with-spl.bin of=/dev/mmcblk0 bs=1024 seek=8

So, maybe it would be faster doing the previous from your cross-compile host ... :P

 

I made it and there is still u-boot messages on UART0 console. see the below picture. ( copy the file in ubuntu compile enviorement and on orangepi zero. 

image.png.36d113e64a108b4f06cbb0d90902742d.png

 

 

I also tested the these commands ; CONFIG_SILENT_CONSOLE_UPDATE_ON_SET=y  and CONFIG_SYS_DEVICE_NULL=y  (I found them on another forum about u-boot silent "Stackexchange") and I also test them. But there is still messages on UART Console. 

 

Thanks

Share this post


Link to post
Share on other sites

I could not disable it. I added the this 

 

#define CONFIG_EXTRA_ENV_SETTINGS \ "silent=1\0"

 

to u-boot include/configs/sunxi-common.h with a patch file but nothing changed. 

 

Where should declare it? İn boot.cmd?

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
1 1