裸机嵌入式系统 (ARM) 的分析
我想知道您如何在裸机系统(ARM Cortex a8)上配置软件?以前我使用的是具有内置基准统计数据的模拟器,现在我想比较真实硬件(在 BeagleBoard-Xm 上运行)的结果。
我知道你可以使用 gprof,但是我有点迷失,因为假设你必须在目标系统上运行 Linux?
我使用 Codesourcery 的 arm-none-eabi 交叉编译器构建可执行文件,目标系统正在运行 FreeRTOS。
I am wondering how you profile software on bare metal systems (ARM Cortex a8)? Previously I was using a simulator which had built-in benchmark statistics, and now I want to compare results from real hardware (running on a BeagleBoard-Xm).
I understand that you can use gprof, however I'm kind of lost as that assumes you have to run Linux on the target system?
I build the executable file with Codesourcery's arm-none-eabi cross-compiler and the target system is running FreeRTOS.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
仔细评估“分析”的含义。您的操作确实非常接近裸机,并且您可能需要承担 gprof 等工具执行的一些工作。
您想对函数调用进行计时吗?或者ISR?在进入和退出受检查的代码时切换 GPIO 线怎么样?可以将数据记录器或示波器设置为触发这些事件。 (根据我的经验,数据记录器更方便,因为我的数据记录器可以配置为捕获这些事件的序列 - 允许我计算平均时间。)
您想计算执行次数吗? Cortex A8 配备了许多可以提供帮助的功能(如可配置事件计数器):链接。您的 ARM 芯片可能还配备了其他可以使用的外设(取决于供应商)。无论如何,请看一下上面的链接 - 新的 ARM 有很多很酷的功能,但我无法充分利用这些功能! ;-)
Closely evaluate what you mean by "profiling". You are indeed operating very close to bare metal, and it's likely that you will be required to take on some of the work performed by a tool like gprof.
Do you want to time a function call? or an ISR? How about toggling a GPIO line upon entering and exiting the code under inspection. A data logger or oscilloscope can be set to trigger on these events. (In my experience, a data logger is more convenient since mine could be configured to capture a sequence of these events - allowing me to compute average timings.)
Do you want to count the number of executions? The Cortex A8 comes equipped with a number of features (like configurable event counters) that can assist: link. Your ARM chip may be equipped with other peripherals that could be used, as well (depending on the vendor). Regardless, take a look at the above link - the new ARMs have lots of cool features that I don't get to play with as much as I would like! ;-)