Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

disable UART0 on OPI-Zero

Featured Replies

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

  • Author


 

 

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

  • Author

Hi martinayotte,

I am new to linux enviromemt. How can I re-compile u-boot with CONFIG_SILENT_CONSOLE=y? 

Thanks

  • Author

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

  • Author

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

  • Author

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

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

 

  • Author

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

  • Author

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

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

 

  • Author

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 

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

  • Author

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

  • Author

It is second one. I mean I get full image output. Am I going to change the file manually? Where is the file output and in img file? Thanks

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

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

 

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

  • Author

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?

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.