top of page

Rebuild, Test and Save a Source Code Change to U-Boot in PetaLinux Tools 2018.2 Using devtool

Updated: May 15, 2023



This post shows a way to rebuild, test and save a source code change in U-Boot using PetaLinux Tools 2018.2 using devtool;


Prerequisites


This write up assumes you've:

  • Installed PetaLinux Tools, Vivado, minicom,

  • Have done a complete build

  • Have programmed that build over JTAG and

  • Have viewed the output over minicom

See these for help:


Install 64bit Ubuntu 16.04.3 on a VirtualBox 5.2.12 Managed Virtual Machine Running on Windows 7 SP1 at [link]

ZCU102 Development Using 2018.2 on a Linux VM Running on Windows: Part 1 at [link]

ZCU102 Development Using 2018.2 on a Linux VM Running on Windows: Part 2 at [link]

Connecting Vivado to Digilent's USB-to-JTAG through VirtualBox at [link]

Arg! Nothing I type shows up in the Minicom console! at [link]



Pull in PetaLinux


Type from PLXPROJ directory, i.e. zpfeffer@z:~/plxprjs/xilinx-zc706-2018.2/


Pull in BitBake


Type from PLXPROJ directory, i.e. zpfeffer@z:~/plxprjs/xilinx-zc706-2018.2/



Pull u-boot-xlnx into devtool


Type from PLXPROJ/build/ directory, i.e. zpfeffer@z:~/plxprjs/xilinx-zc706-2018.2/build/

Note: this will checkout u-boot to /opt/pkg/petalinux/components/yocto/source/arm/workspace/sources/u-boot-xlnx


You should see:



Make a Change


Edit board_info.c:

Make the change:



Build it


Type from PLXPROJ/build/ directory, i.e. zpfeffer@z:~/plxprjs/xilinx-zc706-2018.2/build/

You should see something like:

Note: you may see different values of tasks and entries


Check that board_info.c was rebuilt


Find the u-boot-xlnx log.do_compile file


Type from PLXPROJ/build/ directory, i.e. zpfeffer@z:~/plxprjs/xilinx-zc706-2018.2/build/

You'll see:

Grep for board_info

You should see


Test it


Find the ELF file:


Type from PLXPROJ/build/ directory, i.e. zpfeffer@z:~/plxprjs/xilinx-zc706-2018.2/build/

Note: this excludes files that are links


You'll see something like:

Copy the ELF:


Type from PLXPROJ/build/ directory, i.e. zpfeffer@z:~/plxprjs/xilinx-zc706-2018.2/build/

Start minicom:

Boot:


Type from PLXPROJ/build/ directory, i.e. zpfeffer@z:~/plxprjs/xilinx-zc706-2018.2/build/

You should see


Save Your Changes


Type from /opt/pkg/petalinux/components/yocto/source/arm/workspace/sources/u-boot-xlnx

Type from PLXPROJ/build/ directory, i.e. zpfeffer@z:~/plxprjs/xilinx-zc706-2018.2/build/

You'll see:

The patch is at:



Finish


Type this from PLXPROJ/build/ directory, i.e. zpfeffer@z:~/plxprjs/xilinx-zc706-2018.2/build/

You should see:



Check


To make sure your patches got picked up...


Type these commands from PLXPROJ/build/ directory, i.e. zpfeffer@z:~/plxprjs/xilinx-zc706-2018.2/build/


Build U-Boot:

Find the ELF file:

Copy it to where PetaLinux Tools expects it to be:

Boot it:



Edit Code Again


To edit code again with devtool and maintain your existing source tree:


Type from PLXPROJ/build/ directory, i.e. zpfeffer@z:~/plxprjs/xilinx-zc706-2018.2/build/

...then follow the steps from Make a Change above.



References


bottom of page