Jump to content

disable UART0 on OPI-Zero


Hikmet TEKIN

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

Link to comment
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

Link to comment
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

Link to comment
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

Link to comment
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

Link to comment
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

 

Link to comment
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

 

Link to comment
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. 

Link to comment
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

 

Link to comment
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? 

Link to comment
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

 

Link to comment
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

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines