如何调试闪存中的引导加载程序?
s3c44b0x不支持flash断点(不像其他处理器,如lpc1758,有片上flash),那么当它仍然运行在flash中时如何调试bootloader?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
逻辑分析仪、printf、ICE 和 EPROM/闪存仿真器将是老式方法。
三星 S3C44b0x (ARM7TDMI)声称拥有片上 ICE 断路器调试支持,因此您可能需要一个在线仿真器。
添加:
如果您有足够的 RAM,在从 Flash 启动期间,您可以将日志消息打印到 RAM 中的内存缓冲区,然后在 UART 初始化后使用 printf 串行输出该缓冲区。
第二个补充:
要隔离引导过程的哪个部分,您可以用空存根替换模块或步骤,其唯一目的是隔离崩溃。该方法是为了缩小失败的可能性。制作一个仅初始化第一个基本步骤(例如系统内存)的固件映像,如果可以的话,添加您的任务或进程管家模块/步骤,稍后包括初始化 UART 等。
如果您有输出引脚,请添加一些 LED 来计数二进制文件中的部分,使您可以查看当前正在运行的代码部分。
查看调试规则一书并打印您自己的免费调试规则海报。这是一本简短的书,虽然没有什么革命性的内容,但它巩固了调试过程,并帮助大多数人在调试时更有条理、更有条理。
参考文献:
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: