tags:

views:

147

answers:

1

s3c44b0x does not support flash breakpoint(unlike other processors such as lpc1758 which has on-chip flash), then how to debug bootloader when it still runs in the flash?

+3  A: 

Logic analyzer, printf, ICE, and EPROM / Flash memory emulator would be the old-school ways.

The Samsung S3C44b0x (ARM7TDMI) claims to have an on-chip ICE breaker debug support, so getting a In-Circuit Emulator might be what you want to do.

Added:

If you have enough RAM, during the booting from Flash you could print log messages to an in-memory buffer in RAM, and then output this buffer, using printf to serial later once the UART is initialized.

2nd addition:

To isolate which portion of the bootstrap process, you could replace modules or steps with empty stubs, with the sole intent to isolate crashing. The approach is to narrow the possibilities of failure. Make an firmware image that initializes only the first basic step e.g. the system's memory, if that works add your task or process housekeeper module / step, later including initializing the UART, etc.

If you have the output pins, add some LEDs to count the sections in binary, allowing your to see which section of code is currently running.

Check out the book Debugging Rules and print off your own copy of the free Rules of Debugging poster. It's a short book, and while nothing revolutionary it solidifies the debugging process, and helps most people be more organized and methodical in their debugging.

References:

mctylr
I want to debug from the very beginning of the bootloader, since UART is not initialized, printf won't work.I have a jlink emulator, however, It does not support for flash debug of s3c44b0x.
wenlujon
what if the program crashed before the UART is initialized. and I want to locate the exact point,and then find why.
wenlujon
Assuming external RAM, you could replace the RAM with NVRAM and do read the memory dump post-crash. Otherwise get an ICE that works with your chip, or swap chips to one j-Link does support. That's likely to be a lot of bother I know, but your environment appears to be narrowing your options. And use a logic analyzer.
mctylr