This document shows how to debug i.MX8MP uboot with TRACE32 debugger.
For Linux debug, please check https://community.nxp.com/t5/Blogs/Debug-i-MX8MP-Linux-with-TRACE32/ba-p/1582382
Follow IMX_LINUX_USERS_GUIDE.pdf to build uboot and generate flash.bin.
We will boot i.MX8MP from eMMC/SD, attach TRACE32 and load uboot symbol.
The uboot image and symbol should come from the same build.
Program flash.bin to eMMC or SD card, boot uboot and "Hit any key to stop autoboot". Run command bdinfo to get uboot reloc off value.
Attached imx8mp-uboot-attach.cmm is TRACE32 script. You need to modify Data.LOAD.Elf and SYMbol.reloc according to your environment.
The full command in this example is
Data.LOAD.Elf C:\Debugging\Linux\Sources\uboot-imx\u-boot /NoCODE /STRIPPART "uboot-imx" /SOURCEPATH C:\Debugging\Linux\Sources\uboot-imx
The first parameter C:\Debugging\Linux\Sources\uboot-imx\u-boot tells debugger where to download ELF file. Please note you should not use u-boot.bin.
/NoCODE: The option /NOCODE should be used to only load the symbols without uboot code.
/STRIPPART: With the option /STRIPPART you can remove parts of the path stored in the object file.
/SOURCEPATH: With the option /SourcePATH you can specify a basis directory for the source files.
For example, if you have compiled your uboot on a Linux machine in the directory /home/user/linux/uboot-imx, and you are running TRACE32 on a Windows machine where you have the uboot source files tree under C:\Debugging\Linux\Sources\uboot-imx, set /STRIPPART to “uboot-imx”, and set /SOURCEPATH to C:\Debugging\Linux\Sources.
With above setting, to look for the source file board/freescale/imx8mp_evk/imx8mp_evk.c, the debugger will here use the path
C:\Debugging\Linux\Sources\uboot-imx + /home/user/linux/uboot-imx/board/freescale/imx8mp_evk/imx8mp_evk.c
thus
C:\Debugging\Linux\Sources\uboot-imx/board/freescale/imx8mp_evk/imx8mp_evk.c
We have got relocate offset in step 2, replace the value in SYMbol.reloc command.
Connect TRACE32 to JTAG port, open TRACE32 ICE Arm USB, then from “File->Run Script...”, run imx8mp-uboot-attach.cmm, you will see below window, TRACE32 is attached to i.MX8MP uboot.
If you want to debug some function, such as boot_jump_linux, you can set break point with command
break.set boot_jump_linux
Then press Go button in TRACE32 PowerView, and run boot command in uboot, uboot will continue to run and stop at boot_jump_linux, as shown in below figure.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.