
4 Debugging Your BSP
4.2 Basic Debugging Techniques
121
4
Looking at the disassembly of an object file is helpful when, given the address of
an exception, you need to find out where the exception took place in your code.
The following command is helpful in this situation:
objdumparch --disassemble-all --show-raw-insn tmp.o
Finding Addresses in RAM
The previous sections describe several ways to determine what should be in RAM.
However, this information must be correlated with what is actually there. The
easiest way to do this is to connect an on-chip debugging (OCD) device to your
target, then set a hardware breakpoint at the RAM entry point, and use the OCD
device to examine memory. Without the OCD device, determining what is in RAM
is more difficult.
If a vendor-supplied ROM monitor is available, it may be possible to use the ROM
monitor to load the application and then check the contents of RAM. If two flash
banks are available, the VxWorks image can be programmed into the other flash
bank and examined from the ROM monitor. Finally, if the ROM monitor provides
hardware breakpoint support, it may be possible to set a hardware breakpoint at
the RAM address and then start executing the VxWorks boot application. When
the breakpoint is reached and execution stops, the memory can be examined using
the ROM monitor.
If no ROM monitor is available, it may still be possible to do some debugging.
During the initial phases of BSP development, when the BSP consists only of LED
code, the entire image may fit into a small bank of NVRAM. After the system boots,
this memory can be removed from the system and read on another system.
4.2.3 Verifying RAM
The section discusses how to verify RAM.
Runtime Execution
At this point, you are building an image and programming the flash with it. The
image is located in the correct area and you are ready to power on and run the boot
ROM code. You now need a way to debug the runtime image. The following
discussion assumes that you do not have an OCD device, but you do have at least
Comentários a estes Manuais