Debugging u-boot stage1 on P4080DS, source code unsync with disassembler view in CW 10.3

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

Debugging u-boot stage1 on P4080DS, source code unsync with disassembler view in CW 10.3

Jump to solution
4,249 Views
kanatalimzhanov
Contributor III

Hello everyone,

Hope my question among common one.

 

I build u-boot.bin u-boot (elf file) by

=> version                                                                                                                
                                                                                                                         
U-Boot 2013.01QorIQ-SDK-V1.5 (Dec 11 2014 - 11:19:47)                                                                     
powerpc-fsl_networking-linux-gcc (GCC) 4.7.3                                                                              
GNU ld (GNU Binutils) 2.23.1.20121113                                                                                     

=>

 

and start it debugging as said in "Code Warrior U-Boot Debugging" (Document Number AN4876).

After reset i able to step code in start.S.

I know little about assembler of PowerPC CPU, but suppose that things in disassembler window is far not the same as in source_code window.

Below a screen shot of this windows.

17553_17553.jpgUboot_stage__1__Screen_of_P4080DS__CW_10_3__.jpg

 

After transiting into Stage-2 (after sti instruction) CW says that "Source not found" and run into Endless Loop when stepping more.

See here a picture:

 

17554_17554.jpgUboot_stage__1_Endless_Loop_Screen_of_P4080DS__CW_10_4__.jpg

 

 

What is wrong in this case?

Labels (1)
Tags (4)
0 Kudos
Reply
1 Solution
3,932 Views
catalindemergia
Contributor IV

Hello,

The u-boot debugging process depends on the core you have on your board.

Since you are using 4080, your core is e500mc. In the app note that you are reading from

there are various sections corresponding to different cores. For start, please make sure that

you are following the correct section - in your case "Debugging U-Boot from NOR for e500mc".

regards,

Catalin

View solution in original post

0 Kudos
Reply
7 Replies
3,932 Views
kanatalimzhanov
Contributor III

Ok. I found that in Reset dialog should use /opt/Freescale/CodeWarrior_PA_10.3/PA/PA_Support/Initialization_Files/QorIQ_P4/P4080DS_uboot_36.tcl  initialization script (same as in Target's). Instead of P4080DS_init_core.tcl.

Now i see source code and disassembler window in sync with each other.

Hope this will be useful for other beginners.

It seems that after some amount of stepping CW says "Maximum amount of hardware breakpoint reached"

A way to handle it is terminate thread and relaunch Stage-1 session, is it right?

0 Kudos
Reply
3,932 Views
catalindemergia
Contributor IV

Hello,

A hardware breakpoint uses a register to function. It stores the address where you want your code to stop and

then compares the contents of the PC register to that address so that it will know where to stop the execution.

The number of these registers is limited in the hardware; the message "Maximum amount of hardware breakpoint reached"

means that all those registers are already used and if you want a breakpoint somewhere else in the code you have to delete

an existing one.

Of course, this is true when you execute your code from flash memory. When you execute from RAM you can use software

breakpoints. Software breakpoints don't have this limitation.

regards,

Catalin

0 Kudos
Reply
3,932 Views
kanatalimzhanov
Contributor III

Thanks Catalin.

When i reach code of U-boot that relocated to RAM i start feel more comfortable while debugging.

0 Kudos
Reply
3,932 Views
kanatalimzhanov
Contributor III

Hello, EveryOne!

I am getting more familiar with CodeWarrior 10.3

Now can debug u-boot at all 4-stages.

And now i want to do my job faster.

I read from  Document Number: AN4876

"

Similarly, you can go straight to board_init_f breakpoint:

1. reset hard

2. %>bp –hw board_init_f: Assuming that this breakpoint is not yet enabled in your

Breakpoints view.

3. %>setpicloadaddr reset: For a NOR flash setup, board_init_f runs in the address

range to which U-Boot was linked to. So, reset is ok.

4. %>go: It runs through all the various memory map changes and stops on board_init_f

breakpoint in NOR.

"

But i see:

%>bp –hw board_init_f

Error: unable to resolve location

%>setpicloadaddr reset

If the AN4876 document is obsolete now?

Or maybe i must load symbol table by hand?

I found command "help" in Debugger Console, it is encouraging, but maybe here some recent documents to read.

Uboot_stage__5_relocated_to__RAM__Screen_of_P4080DS__CW_10_3__.jpg

0 Kudos
Reply
3,821 Views
Irfan3
Contributor III

Hi,

can you provide the steps you used to debug u-boot. As i am stuck in transition from first stage to second. While it is jumping from rfi to switch_as function . the source code is becoming unavailable.so can you help me in this issue by providing the steps you used for debugging all the four stages.

FYI,

I have referred AN4876 as well as Targeting_Pa_processors documents for debugging.

Thanks & regards,

irfan

0 Kudos
Reply
3,933 Views
catalindemergia
Contributor IV

Hello,

The u-boot debugging process depends on the core you have on your board.

Since you are using 4080, your core is e500mc. In the app note that you are reading from

there are various sections corresponding to different cores. For start, please make sure that

you are following the correct section - in your case "Debugging U-Boot from NOR for e500mc".

regards,

Catalin

0 Kudos
Reply
3,930 Views
kanatalimzhanov
Contributor III

Thanks Catalin. Found this "Debugging U-Boot from NOR for e500mc".

0 Kudos
Reply