Skip to contentSkip to conversation

How do you change the program counter (PC)

DISCUSSION Jason Park 3 participants 5 messages Jan 24, 2003

lore
Share & tools
lore

Jason Park

author
#0 lore raw

hi, I've got another simple question... but couldn't find an answer in the archives.

I just compiled the ppcboot for the ep8260.. and placed the .bin version at location 0xffc00000.

i have the planetcore bootloader that came with the ep8260 at location 0xfff00000.

now, i want to test and check whether the ppcboot loader will work properly before i overwrite the planetcore bootloader code. how can i change the PC (which states 0xfff0 0100 when i type "info" at the BDI prompt)...

also, whats the main difference between the 3 files created by ppcboot. (ELF, BIN, SREC) besides size.. is there an advantage/disadvantage using one over the other? is it dependant on the debugger?

thanks,
Jason P.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#1 lore raw
Quoted 4 lines

now, i want to test and check whether the ppcboot loader will work properly before i overwrite the planetcore bootloader code. how can i change the PC (which states 0xfff0 0100 when i type "info" at the BDI prompt)...

go 0xffc00100
or
ti 0xffc00100

Quoted 3 lines

also, whats the main difference between the 3 files created by ppcboot. (ELF, BIN, SREC) besides size.. is there an advantage/disadvantage using one over the other? is it dependant on the debugger?

ELF: portable binary format, which has program headers/sections and others information. You can't excute the ELF file directly. It needs intepreter(or named loader) to load it to proper memory address. BDI can do it. But remember not to program it to flash for excuting directly.

BIN: pure binary format, which has nothing but cpu instrctions(and data). If you want to program it to flash, it's the proper choise.

SREC: (I am not much sure) It seems an old format used mostly by motorola. It's like BIN format, but has other information used for downloading. It seems some bootloaders need SREC format for downloading.

Don't trust me. For ELF & SREC, you can download the specification if you do have interesting, and for BIN file, you do can disassemble it if you really want to know what's in it (of course, ELF format is the best choise for disassembling).

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

author
#2 lore raw
Quoted 4 lines

go 0xffc00100
or
ti 0xffc00100

starting address for flash is 0xff00 0000 where there is a hardware reset word . even when i type in "go 0xffc00100", it still jumps to the part in the flash where the embedded planetcore bootloader is stored (0xfff00100). so, i decided to delete the hardware reset word... and now BDI cant even connect to the target, as i get this output:

*** TARGET: resetting target failed
# PPC: unexpected response from target
- TARGET: target will be restarted in 10 sec
- TARGET: processing user reset request
- BDI asserts HRESET
- Reset JTAG controller passed
- Bypass check: 0x55 => 0xAA
- Bypass check: 0x55 => 0xAA
- JTAG exists check passed
- Target PVR is 0x00810101
- COP status is 0x05
- Check running state failed
- TARGET: Target PVR is 0x00810101
*** TARGET: resetting target failed
# PPC: unexpected response from target
- TARGET: target will be restarted in 10 sec

and it goes on and on... having some major regrets about deleting that hardware reset word... now i cant even connect to the embedded board.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#3 lore raw
Quoted 4 lines

starting address for flash is 0xff00 0000 where there is a hardware reset word . even when i type in "go 0xffc00100", it still jumps to the part in the flash where the embedded planetcore bootloader is stored (0xfff00100).

You should make sure that your ppcboot is linked to another address (not the 0xfff00000), where your new ppcboot is located(whether in RAM or FLASH). Change TEXT_BASE in your board directory to what you want. Be sure your CFG_MONITOR_BASE is set to TEXT_BASE or hard coded to the same address.

Quoted 2 lines

so, i decided to delete the hardware reset word... and now BDI cant even connect to the target, as i get this output:

No!!! Contact your HW engineer to help you to reprogram the HRCW. Or if you are luck, and if your board had a switch to control /RSTCONF, you can let 8260 use the default setting, and use the BDI program the HRCW.

Quoted 2 lines

and it goes on and on... having some major regrets about deleting that hardware reset word... now i cant even connect to the embedded board.

Good luck!

Shenrong

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#4 lore raw
In reply to Shen Rong
Quoted 5 lines · Shen Rong

SREC: (I am not much sure) It seems an old format used mostly by motorola. It's like BIN format, but has other information used for downloading. It seems some bootloaders need SREC format for downloading.

SREC is more or less the same as a BIN file but it has an address and checksum so it would be much smaller if you want to put a byte at 0 and one at 100000 and you can be sure that is is correctly transfered.

--
Kenneth Johansson
Ericsson AB Tel: +46 8 404 71 83
Tellusborgsvägen 94 Fax: +46 8 404 72 72
126 25 Stockholm [email protected]

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/