I want to add custom command command to u-boot
be it a simple hello world command.
After searching I found this link Yocto u-boot Custom Commands where it says to look at timer
command in cmd/misc.c
as starting point.
How do I bring this timer
command to my u-boot image?
I assume I have make changes to the makefiles but not sure which makefile I should edit.
I am using qemu to test the u-boot
image in Ubuntu 18.04 using the following method
- Cloned the
u-boot
source from github. - Installed all the build dependencies in the system.
- Prepared u-boot config files using
make qemu_arm_config ARCH=arm CROSS_COMPILE=arm-none-eabi-
- Build u-boot
make all ARCH=arm CROSS_COMPILE=arm-none-eabi-
- Launch qemu with u-boot image
qemu-system-arm -M virt -nographic -kernel u-boot
U-boot log
$ qemu-system-arm -M virt -nographic -kernel u-boot
U-Boot 2020.01-dirty (Mar 29 2020 - 15:46:14 +0530)
DRAM: 128 MiB
WARNING: Caches not enabled
Flash: 128 MiB
*** Warning - bad CRC, using default environment
In: pl011@9000000
Out: pl011@9000000
Err: pl011@9000000
Net: No ethernet found.
Hit any key to stop autoboot: 0
=> timer
Unknown command 'timer' - try 'help'
=>
Few more details
U-boot:
- repo : https://github.com/u-boot/u-boot.git
- branch / tag : v2020.01
Host OS:
Distributor ID: Ubuntu
Description: Ubuntu 18.04.4 LTS
Release: 18.04
Codename: bionic