p1020rdb-pc and u boot debugging

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

p1020rdb-pc and u boot debugging

2,479 Views
tomvogel
Contributor II

I have a Freescale P1020rdb-pc development kit, Codewarrior Tap  and am using CodeWarrior 10.3 in Linux for development. (LinuxMint OS).

U boot source and toolchain is the from the Freescale SDK1.4 Yocto package.

I am sucessfully able to build u boot with the GNU cross compiler and download uboot.bin into NOR flash using CodeWarrior and the Tap.

The P1020rdb-pc starts up and runs fine. Now at a point where we need to be able to debug u boot as we will be customizing the hardware.

I set up debug configuration to Download.

When debugging using Connect, seems to run fine, here is the console output:

 

Executing Initialization File: /home/vogel/QorIQ-SDK-V1.4-20130625-yocto/u-boot/CFG/P1020RDB_init_core.tcl

radix x

cmdwin::eclipse::config hexprefix 0x

cmdwin::eclipse::config MemIdentifier v

cmdwin::eclipse::config MemWidth 32

cmdwin::eclipse::config MemAccess 32

cmdwin::eclipse::config MemSwap off

cmdwin::reg PIR %d -np

thread break: Stopped, 0x0, 0x0, cpuPowerPCBig, u-boot (state, tid, pid, cpu, target)

cmdwin::mem p:0xff700000 = 0x000e0000

cmdwin::mem p:0xe0005000 = 0x00001000

cmdwin::mem p:0xe0020e44 = 0x0000001D

cmdwin::reg Standard Special Purpose Registers/MSR = 0x02000200

cmdwin::reg regPPCTLB1/L2MMU_CAM0 = 0x70000FCAFC080000FF000000FF000001

cmdwin::reg regPPCTLB1/L2MMU_CAM1 = 0xA0007FC41C0800000000000000000001

cmdwin::reg regPPCTLB1/L2MMU_CAM3 = 0xA0007FCA1C0800008000000080000001

cmdwin::reg regPPCTLB1/L2MMU_CAM6 = 0x500003CAFC080000E0000000E0000001

cmdwin::reg regPPCTLB1/L2MMU_CAM7 = 0x500003CAFC080000E0100000E0100001

cmdwin::reg regPPCTLB1/L2MMU_CAM8 = 0x500003CAFC080000EFC00000EFC00001

cmdwin::reg regPPCTLB1/L2MMU_CAM10 = 0x300000CA1C080000EFF00000EFF00001

cmdwin::reg regPPCTLB1/L2MMU_CAM11 = 0x400001CA1C080000EFA00000EFA00001

cmdwin::reg e500 Special Purpose Registers/L1CSR0 = 0x2

cmdwin::reg e500 Special Purpose Registers/L1CSR1 = 0x0

cmdwin::reg e500 Special Purpose Registers/L1CSR1 = 0x2

cmdwin::mem p:0xe00e0004 -np

cmdwin::mem p:0xe0000c08 = 0x000FF000

cmdwin::mem p:0xe0000c10 = 0x80400017

cmdwin::mem p:0xe0000c28 = 0x00080000

cmdwin::mem p:0xe0000c30 = 0x8020001c

cmdwin::mem p:0xe0000c48 = 0x000efc00

cmdwin::mem p:0xe0000c50 = 0x8020000f

cmdwin::mem p:0xe0000c68 = 0x000a0000

cmdwin::mem p:0xe0000c70 = 0x8010001c

cmdwin::mem p:0xe0000c88 = 0x000efc10

cmdwin::mem p:0xe0000c90 = 0x8010000f

cmdwin::mem p:0xe0000ca8 = 0x000efa00

cmdwin::mem p:0xe0000cb0 = 0x80400010

cmdwin::mem p:0xe0000cc8 = 0x000eff00

cmdwin::mem p:0xe0000cd0 = 0x8040000d

cmdwin::mem p:0xe0000d68 = 0x00000000

cmdwin::mem p:0xe0000d70 = 0x80f0001d

cmdwin::mem p:0xe00e0000 -np

cmdwin::mem p:0xe0002110 = 0x470c0008

cmdwin::mem p:0xe0002000 = 0x0000003f

cmdwin::mem p:0xe0002008 = 0x00000000

cmdwin::mem p:0xe0002080 = 0x80014302

cmdwin::mem p:0xe0002084 = 0x00000000

cmdwin::mem p:0xe0002104 = 0x00110104

cmdwin::mem p:0xe0002108 = 0x5d59e544

cmdwin::mem p:0xe000210c = 0x0fa888cd

cmdwin::mem p:0xe0002100 = 0x00020000

cmdwin::mem p:0xe0002114 = 0x24401010

cmdwin::mem p:0xe0002118 = 0x00441210

cmdwin::mem p:0xe000211c = 0x00000000

cmdwin::mem p:0xe0002120 = 0x00000000

cmdwin::mem p:0xe0002124 = 0x0a280100

cmdwin::mem p:0xe0002128 = 0xdeadbeef

cmdwin::mem p:0xe0002130 = 0x03000000

cmdwin::mem p:0xe0002160 = 0x00000001

cmdwin::mem p:0xe0002164 = 0x01401400

cmdwin::mem p:0xe0002170 = 0x89080600

cmdwin::mem p:0xe0002174 = 0x8675f608

cmdwin::mem p:0xe0002b28 = 0x00000000

cmdwin::mem p:0xe0002b2c = 0x00000000

cmdwin::wait 500

cmdwin::mem p:0xe0002110 = 0xc70c0008

cmdwin::wait 2000

cmdwin::mem p:0xe0007000 = 0x80000404

cmdwin::mem p:0xe0007008 = 0x0000FB00

cmdwin::mem p:0xe0007020 = 0x25170008

cmdwin::mem p:0xe0005000 = 0xFF001001

cmdwin::mem p:0xe0005004 = 0xFF000FF7

cmdwin::mem p:0xe0005008 = 0xEFF00C21

cmdwin::mem p:0xe000500c = 0xFFF003AE

cmdwin::mem p:0xe00050e0 = 0x0000F020

cmdwin::mem p:0xe0005018 = 0xEFA00801

cmdwin::mem p:0xe000501c = 0xFFFE09F7

cmdwin::mem p:0xe00050d0 = 0x4000000f

cmdwin::mem p:0xe00050d4 = 0x80000008

cmdwin::mem p:0xe0020000 -np

cmdwin::mem p:0xe0020000 = 0x50000000

cmdwin::reg e500 Special Purpose Registers/IVPR = 0x00000000

cmdwin::reg e500 Special Purpose Registers/IVOR0 = 0x00000100

cmdwin::reg e500 Special Purpose Registers/IVOR1 = 0x00000200

cmdwin::reg e500 Special Purpose Registers/IVOR2 = 0x00000300

cmdwin::reg e500 Special Purpose Registers/IVOR3 = 0x00000400

cmdwin::reg e500 Special Purpose Registers/IVOR4 = 0x00000500

cmdwin::reg e500 Special Purpose Registers/IVOR5 = 0x00000600

cmdwin::reg e500 Special Purpose Registers/IVOR6 = 0x00000700

cmdwin::reg e500 Special Purpose Registers/IVOR8 = 0x00000c00

cmdwin::reg e500 Special Purpose Registers/IVOR10 = 0x00000900

cmdwin::reg e500 Special Purpose Registers/IVOR11 = 0x00000f00

cmdwin::reg e500 Special Purpose Registers/IVOR12 = 0x00000b00

cmdwin::reg e500 Special Purpose Registers/IVOR13 = 0x00001100

cmdwin::reg e500 Special Purpose Registers/IVOR14 = 0x00001000

cmdwin::reg e500 Special Purpose Registers/IVOR15 = 0x00001500

cmdwin::reg e500 Special Purpose Registers/IVOR32 = 0x00001600

cmdwin::reg e500 Special Purpose Registers/IVOR33 = 0x00001700

cmdwin::reg e500 Special Purpose Registers/IVOR34 = 0x00001800

cmdwin::reg e500 Special Purpose Registers/IVOR35 = 0x00001900

cmdwin::mem v:0x00000700 = 0x48000000

cmdwin::mem v:0x00001500 = 0x48000000

cmdwin::reg e500 Special Purpose Registers/IAC1 = 0xfffffffc

cmdwin::reg e500 Special Purpose Registers/DBCR0 = 0x40800000

cmdwin::reg e500 Special Purpose Registers/DBCR1 = 0x00000000

cmdwin::eclipse::config runcontrolsync off

cmdwin::go

cmdwin::wait 50

cmdwin::eclipse::config runcontrolsync on

cmdwin::stop

thread break: Stopped, 0x0, 0x0, cpuPowerPCBig, u-boot (state, tid, pid, cpu, target)

cmdwin::reg e500 Special Purpose Registers/DBSR = 0x01CF0000

cmdwin::reg e500 Special Purpose Registers/DBCR0 = 0x41000000

cmdwin::reg e500 Special Purpose Registers/IAC1 = 0x00000000

cmdwin::reg e500 Special Purpose Registers/CSRR0 = 0x00000000

cmdwin::reg e500 Special Purpose Registers/CSRR1 = 0x00000000

cmdwin::reg Standard Special Purpose Registers/MSR = 0x02001200

cmdwin::reg e500 Special Purpose Registers/HID0 = 0x00004000

cmdwin::reg e500 Special Purpose Registers/DBCR0 = 0x41000000

cmdwin::reg General Purpose Registers/PC = 0xFFFFFFFC

cmdwin::reg General Purpose Registers/SP = 0x0000000F

cmdwin::mem p:0xe0001010 = 0x03000000

 

Executing download task: /home/vogel/QorIQ-SDK-V1.4-20130625-yocto/u-boot/Flash uboot.tcl

cmdwin::fl::target -lc debug download

cmdwin::fl::target -b 0x2000 0x30000

cmdwin::fl::target -v off -l off

cmdwin::fl::device -d S29GL128P -o 8Mx16x1 -a 0xff000000 0xffffffff

cmdwin::fl::image -f /home/vogel/QorIQ-SDK-V1.4-20130625-yocto/u-boot/u-boot.bin -t Auto Detect -re on -r 0xff000000 0xffffffff -o

e on -o 0xfff80000

cmdwin::fl::erase image

Beginning Operation ...   

-------------------------

Auto-detection is successful.  

  File is of type Binary/Raw Format.  

 

Performing target initialization ...   

Downloading Flash Device Driver ...  

Reading flash ID ...  

Erasing Sector 0xFFF80000 to 0xFFF9FFFF  

Erasing Sector 0xFFFA0000 to 0xFFFBFFFF  

Erasing Sector 0xFFFC0000 to 0xFFFDFFFF  

Erasing Sector 0xFFFE0000 to 0xFFFFFFFF  

Erasing ...  

Erasing ....  

Erasing .....  

Erase Command Succeeded   

cmdwin::fl::write

Beginning Operation ...   

-------------------------

Using restricted address range 0xFF000000 to 0xFFFFFFFF  

Programming file /home/vogel/QorIQ-SDK-V1.4-20130625-yocto/u-boot/u-boot.bin  

Auto-detection is successful.  

  File is of type Binary/Raw Format.  

 

Downloading Flash Device Driver ...  

Reading flash ID ...  

Auto-detection is successful.  

  File is of type Binary/Raw Format.  

 

Downloading 0x00010000 bytes to be programmed at 0xFFF80000  

Downloading 0x00010000 bytes to be programmed at 0xFFF90000  

Executing program ....  

Program Command Succeeded   

Downloading 0x00010000 bytes to be programmed at 0xFFFA0000  

Downloading 0x00010000 bytes to be programmed at 0xFFFB0000  

Executing program ....  

Program Command Succeeded   

Downloading 0x00010000 bytes to be programmed at 0xFFFC0000  

Downloading 0x00010000 bytes to be programmed at 0xFFFD0000  

Executing program ....  

Program Command Succeeded   

Downloading 0x00010000 bytes to be programmed at 0xFFFE0000  

Downloading 0x00010000 bytes to be programmed at 0xFFFF0000  

Executing program ....  

Program Command Succeeded   

cmdwin::fl::disconnect

 

 

Then CodeWarrior switches to Debug view, but there is an exception:

 

7688_7688.pngpastedImage_10.png

 

 

I have some moderate success with Debug configuration Attach. However am not able to step through code as I would like.

Any suggestions would be appreciated.

Labels (1)
5 Replies

1,131 Views
yipingwang
NXP TechSupport
NXP TechSupport

First of all, for debugging u-boot with CodeWarrior, you need to build u-boot with CodeWarrior support, please use the following steps in SDK 1.4.

1. $ cd <yocto_install_path>

2. $ bitbake -c cleansstate u-boot

3. Modify the u-boot_git.bb file and add following content:

$ cd meta-fsl-ppc/recipes-kernel/u-boot

$ add 'EXTRA_OEMAKE += "CONFIG_CW=1"' in u-boot_git.bb file

4. Rebuild u-boot:

$ bitbake u-boot

Then import the elf file in CodeWarrior from File->Import->Power Architecture ELF Executable.

Secondly, in u-boot debugging please use the initialization file CW PA v10.3\PA\PA_Support\Initialization_Files\QorIQ_P1\P1020RDB_uboot_32.tcl instead of P1020RDB_init_core.tcl, then use attach method to debug u-boot. P1020RDB_init_core.tcl is used to reset and initialize the target, then download elf file into the target.

For detailed steps of debugging u-boot from NOR Flash, please refer to the section "5.4.6.4.2 U-Boot Debug from NOR Flash" in page 259 of CW PA v10.3\PA\Help\PDF\Targeting_PA_Processors.pdf.

1,131 Views
sourabhdas
Contributor III

Hi Yiping, I have a similar kind of problem. I am using P1020 RDB PC. I am using QorIQ SDK 1.7. Firstly, I tried to build my u-boot using bitbake. I was able to boot my image through SD card.

Next I tried to build my u-boot using standalone toolchain. I first generated my toolchain using

bitbake fsl-toolchain

I got my cross compiler at "QorIQ-SDK-V1.7-20141218-yocto/build_p1020rdb_release/tmp/sysroots/i686-linux/usr/bin/ppce500v2-fsl-linux-gnuspe/powerpc-fsl-linux-gnuspe-gcc".

Then I tried to use this standalone tool chain to compile my source code. I went to the u-boot source code directory. From their, I run the commands:

make P1020RDB-PC_SDCARD_config

make all CROSS_COMPILE=<cross compiler path>

I got my u-boot.bin build at the same directory (u-boot source directory). It is of 498 KB size. I then build my sd card with that image. I can't able boot my board. Please help me in this.

0 Kudos

1,131 Views
tomvogel
Contributor II

Thank you Yiping.

I should mention that I had extracted the uboot source from Yocto, and installed the fsl_toolchain. I had in fact created a stand-alone uboot project in that could be compiled in CodeWarrior.

Using your advice, I imported the EFL executable from that project to create a 'uboot debug' project. Also used the correct initialization file P1020RDB_uboot_32.tcl.

I am able to set a breakpoint, attach then reset and stop at breakpoint in source.

Stepping though source seems to work so  far.

Can you tell me what effect the flag 'EXTRA_OEMAKE += "CONFIG_CW=1"' has on the build, as I do not seem to have used it.

Thanks,

Tom

0 Kudos

1,131 Views
marius_grigoras
NXP Employee
NXP Employee

Historically, this macro was used for enabling the debugging support necessary by CodeWarrior. Right now, this macro is deprecated and is no longer used. The debugging support is enabled by default for the most of the boards.

Regards,

Marius

0 Kudos

1,131 Views
kanatalimzhanov
Contributor III

Hello, Marius.

"Right now, this macro is deprecated and is no longer used.

The debugging support is enabled by default for the most of the boards."

Is there a way to know if "CONFIG_CW=1" was defined when building u-boot and u-boot.bin?

(maybe there are some flag seen in u-boot binary, or some special code fragments in start.S)

And second, urgent question: Is "debugging support is enabled" for P4080DS board ?

I use to build u-boot this SDK: /opt/SDK/QorIQ-SDK-V1.5-20131219-yocto

0 Kudos