Hikmet TEKIN Posted December 15, 2017 Posted December 15, 2017 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
Hikmet TEKIN Posted December 16, 2017 Author Posted December 16, 2017 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. How can I disable this u-boot messages? Thanks
martinayotte Posted December 16, 2017 Posted December 16, 2017 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
Hikmet TEKIN Posted December 16, 2017 Author Posted December 16, 2017 Hi martinayotte, I am new to linux enviromemt. How can I re-compile u-boot with CONFIG_SILENT_CONSOLE=y? Thanks
Hikmet TEKIN Posted December 17, 2017 Author Posted December 17, 2017 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
martinayotte Posted December 17, 2017 Posted December 17, 2017 The CONFIG_SILENT_CONSOLE=y needs to be added in the .config file before compiling u-boot.
Hikmet TEKIN Posted December 17, 2017 Author Posted December 17, 2017 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
martinayotte Posted December 17, 2017 Posted December 17, 2017 You need to create a small patch to will update the file build/cache/sources/u-boot/v2017.11/configs/orangepi_zero_defconfig
Hikmet TEKIN Posted December 17, 2017 Author Posted December 17, 2017 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
martinayotte Posted December 17, 2017 Posted December 17, 2017 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
Hikmet TEKIN Posted December 18, 2017 Author Posted December 18, 2017 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? Thanks for helps
Igor Posted December 18, 2017 Posted December 18, 2017 5 hours ago, Hikmet TEKIN said: But when I try to compile it gives me error as failed what should I do? Look into debug/patching.log
Hikmet TEKIN Posted December 18, 2017 Author Posted December 18, 2017 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.
martinayotte Posted December 18, 2017 Posted December 18, 2017 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
Hikmet TEKIN Posted December 18, 2017 Author Posted December 18, 2017 When I try as you wrote, it gives me error. Here is the log file for the error. I couldn't understand why it is giving error. Thanks patching.log disable.patch
Hikmet TEKIN Posted December 18, 2017 Author Posted December 18, 2017 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
martinayotte Posted December 18, 2017 Posted December 18, 2017 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 ?
Hikmet TEKIN Posted December 19, 2017 Author Posted December 19, 2017 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.
martinayotte Posted December 19, 2017 Posted December 19, 2017 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 ?
Hikmet TEKIN Posted December 19, 2017 Author Posted December 19, 2017 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
martinayotte Posted December 19, 2017 Posted December 19, 2017 Does your build was a full image or only u-boot/kernel ? If it is the second, you need to install the resulting u-boot-sunxi-with-spl.bin into proper sector of the existing SDCard.
Hikmet TEKIN Posted December 20, 2017 Author Posted December 20, 2017 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
martinayotte Posted December 21, 2017 Posted December 21, 2017 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
Hikmet TEKIN Posted December 21, 2017 Author Posted December 21, 2017 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?
martinayotte Posted December 21, 2017 Posted December 21, 2017 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 ...
Hikmet TEKIN Posted December 23, 2017 Author Posted December 23, 2017 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 ... 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. 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
martinayotte Posted December 23, 2017 Posted December 23, 2017 Doing a bit of googling, I found that having CONFIG_SILENT_CONSOLE=y only enable the code. https://www.denx.de/wiki/DULG/UBootEnvVariables But to make it effective, you need the environment variable "silent" to be set to any value. It is also mentioned in cache/sources/u-boot/v2017.11/doc/README.silent.
Hikmet TEKIN Posted December 24, 2017 Author Posted December 24, 2017 Where do I need to decleare the value “silent”?
martinayotte Posted December 24, 2017 Posted December 24, 2017 https://lists.denx.de/pipermail/u-boot/2014-March/175689.html
Hikmet TEKIN Posted December 28, 2017 Author Posted December 28, 2017 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?
Recommended Posts