How to disable serial console(non-kernel) in u-boot
I'm getting back to this issue almost a year later, now I've managed to find a proper solution.
The board I was working on had a reasonably new u-boot in its BSP. To disable the serial console I had to do the following:
Add the following defines to the board's config header(located in include/configs/board.h):
#define CONFIG_DISABLE_CONSOLE
#define CONFIG_SILENT_CONSOLE
#define CONFIG_SYS_DEVICE_NULLDEVCheck if your board has early_init_f enabled in the same file:
#define CONFIG_BOARD_EARLY_INIT_F 1
Find the arch file(Something like arch/x86/cpu/architecture/architecture.c) and add this call to its early_init_f function. It actually modifies board's global data variable to have these flags:
gd->flags |= (GD_FLG_SILENT | GD_FLG_DISABLE_CONSOLE);
My board did not have one, so I had to add the whole function
int board_early_init_f(void)
{
gd->flags |= (GD_FLG_SILENT | GD_FLG_DISABLE_CONSOLE);
return 0;
}
Example:
If you are looking for board_early_init_f of Orange Pi 4B it is in /build/cache/sources/u-boot/v2020.10/board/rockchip/evb_rk3399/evb-rk3399.c
That's it. Hope this helps someone else!
see also
Why doesn't U-Boot disable the console output
U-Boot is doing exactly what it should (silencing the output) with the following command:
#define CONFIG_EXTRA_ENV_SETTINGS \
"silent=1\0" \
see also
How do I turn off the console on an embedded system built with Yocto?
For kernel versions 5.11 and newer:
In the submenu "Character devices" under "Device Drivers" from make menuconfig
, there is an option called "Null TTY driver" (CONFIG_NULL_TTY
) that you can enable and add console=ttynull
to the kernel boot cmdline so that all console output will be simply discarded.
You can also disable CONFIG_VT
and CONFIG_UNIX98_PTYS
, since you don't need to interact with your program via console at all.
For older kernels (like my 4.14):
You can add this support with the diffs at: https://lore.kernel.org/lkml/20190403131213.GA4246@kroah.com/T/ and then follow the instructions above.
Kernel no serial console output if started through U-Boot
After some time with other tasks at hand I revisited the problem and literally magically found a working config. I still don't understand how the same kernel command line worked coming from cmdline.txt
but not from u-boot's bootargs
. Until further proof I'll assume gross negligence on my side. ^^
So now I'll post my boot.cmd for our cm3 and 3B+ in hopes it helps others.
cm3
setenv fdtfile bcm2710-rpi-cm3.dtb
mmc dev 0
fatload mmc 0:1 ${kernel_addr_r} Image
fatload mmc 0:1 ${fdt_addr} ${fdtfile}
setenv bootargs console=ttyAMA0,115200 printk.devkmsg=on usbcore.autosuspend=-1 fsck.mode=force fsck.repair=yes
booti ${kernel_addr_r} - ${fdt_addr}
3B+
setenv fdtfile bcm2710-rpi-3-b.dtb
fatload mmc 0:1 ${kernel_addr_r} Image
fatload mmc 0:1 ${fdt_addr} ${fdtfile}
setenv bootargs 8250.nr_uarts=1 console=ttyS0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
booti ${kernel_addr_r} - ${fdt_addr}
Disclaimer: This is a rough cut. But as I fell into despair making this work I wanna get this solution out as fast as possible
Having trouble stopping U-Boot autoboot
So it turns out there is a short somewhere between the RX pin and the +3.3V pin which is not allowing me to send anything to the board. Thank you to those who have commented.
Related Topics
Why Doesn't Tar Preserve File Permissions
How to Make Sure Only One Instance of a Bash Script Is Running at a Time
Is Swarm Required for Using Multi-Host Networking Feature Using Overlay in Docker
Does File ".Bash_History" Always Record Every Command I Ever Issue
Berkeley Db Mismatch Error While Configuring Ldap
Docker Compose Volume Permissions Linux
Unknown Symbol in While Loading a Kernel Module
Docker Run a Shell Script in The Background Without Exiting The Container
How to Get a Bash Script Working on Freebsd, Openbsd and Linux Without Modifying It
Linux: How to Put a Load on System Memory
In Linux, How to Create a File Descriptor for a Memory Region
What Does "No More Variables Left in This Mib View" Mean (Linux)
Convert Column to Matrix Format Using Awk
Running a Script Just Before Installation of Debian Finishes Using Preseed
Linux Transfer Parameter for Function in Declare_Work
Cx_Oracle: Distutils.Errors.Distutilssetuperror: Cannot Locate Oracle Include Files