September 14, 2018

The Nanopi Fire3 - lessons from U-Boot about software tools

U-Boot is a large and complex program. It supports hundreds of boards from a single code base for many different architectures. Like any large system, it has grown in unexpected ways and now has many warts an historical features. It is quite challenging for a newcomer to work with. The following are some comments based on lessons I have learned by working with the U-Boot sources.

Use ctags. This will save a huge amount of time as compared to doing searches and jumping around between directories.

Use ag. This is the "silver searcher". I spent a lot of time doing "grep -R xyz ." With "ag", you just type "ag xyz" which is much easier. It runs much faster, and it provides much more convenient output.

Rely on breadcrumbs. Namely object files. Build U-Boot for your target and then you will know what source files actually get used in the build, because you will see board.o sitting alongside board.c The build history can also be instructive, but keeping the object files scattered around in the source tree is a great help. Typing "make clean" gets rid of them. Don't do that.


Have any comments? Questions? Drop me a line!

Tom's electronics pages / tom@mmto.org