裸机系统的软件测试

发布于 2024-07-08 03:15:22 字数 1454 浏览 16 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

诠释孤独 2024-07-15 03:15:22

裸机环境中缺乏基础设施是相当具有挑战性的。 我建议您专注于调试工具。 即使非常小心和出色的方法,您也需要具有调试能力。

你应该让 gdbagent 工作。 您需要自己实现它,但它是一个简单的基于文本的协议。 您在外部计算机上运行 gdb 并与目标上的 gdbagent 进行通信。
您当然可以通过串行端口运行 gdbagent 协议,但是当需要检查大量数据时,这很快就会变得乏味。 如果您有更快的界面,请利用它。

我不知道您的预算是多少,但您还应该计划一个 JTAG 调试器。 只要目标上的 gdbagent 能够运行,gdbagent 就很棒。 如果一切都崩溃了,你就完蛋了。 JTAG 调试器非常昂贵,但可以租用。 我过去使用过 Corelis 产品,并且听说过有关 Abatron

The lack of infrastructure in a bare metal environment is pretty challenging. I'd recommend you focus on debugging tools. Even with great care and excellent methodology, you'll need the ability to debug things.

It would behoove you to get gdbagent working. You'll need to implement this yourself, but it is a simple text-based protocol. You run gdb on an external machine and communicate with the gdbagent on your target.
You certainly could run the gdbagent protocol over the serial port, but this rapidly becomes tedious when large amounts of data need to be examined. If you have a faster interface available, take advantage of it.

I don't know what your budget is, but you should also plan for a JTAG debugger. gdbagent is great so long as your gdbagent on the target is able to run. If everything crashes hard, you're toast. JTAG debuggers are enormously expensive, but can be rented. I've used Corelis products in the past, and I've heard good things about Abatron.

世态炎凉 2024-07-15 03:15:22

我认为你最好的选择是与编译器的供应商合作以获得设备模拟器。

据说泰西可以使用该芯片。 查看:http://www.hitex.us/products.html?con_186 .html~内容

I think you're best bet is to work with the vendor of your compiler to get a device simulator.

Tessy supposedly works with that chip. Check out: http://www.hitex.us/products.html?con_186.html~content

许一世地老天荒 2024-07-15 03:15:22

当时序很重要时,我喜欢使用一个或两个空闲 I/O 引脚和一个示波器来检测代码。 我也非常喜欢用于源代码级调试的 JTAG 端口。 您还可以让微处理器存储数据向量,并通过第二个 UART(如果有)将其发送回 PC 进行分析。

When timing is important I like to use a free I/O pin or two and a scope together to instrument the code. I'm also a fan of the JTAG port for source-level debugging. You can also have the microprocessor store a vector of data and send it back over a second uart (if you have one) to the PC for analysis.

有深☉意 2024-07-15 03:15:22

我所看到的在此类领域所做的事情就是单元测试。

不,我不是在开玩笑。

单元测试在主机 PC 的控制下在设备上运行。

您编写一个包装器来在单元测试控制下将程序加载到 SRAM 中。

然后你的电脑可以发送一个程序,运行它并检查输出。

如果您需要锻炼您的开发板,请获取 LabJack 或类似的 USB 接口卡。

现在这就是测试夹具中的硬件,全部从您的主机 PC 运行。

Something that I've seen done in this sort of area is unit testing.

No, I'm not joking.

Unit tests run on the device, under the control of the host PC.

You write a wrapper to ley load programs into SRAM under unit test control.

Then your PC can send a program, run it and check the output.

If you need to exercise your board , get a labjack or similar USB interface card.

Now that's the hardware in a test jig, all run from yours host PC.

┈┾☆殇 2024-07-15 03:15:22

我取得了一些成功的一件事是设计一个 PC 环境,其中可以使用 C++ 为 PC 编译代码并进行测试,然后使用“直接”C 编译以在嵌入式系统上运行。 I/O 端口引用被定义为 I/O 对象的属性访问,然后通过套接字发送到“硬件模拟”程序。 系统的某些部分最终比我希望的更笨重,但我预计后续版本将不再那么笨重。

One thing I've done with some success was to design a PC environment where code can be compiled with C++ for the PC and tested, and then later compiled with "straight" C to run on the embedded system. I/O port references are #defined to be property accesses for an I/O object, which are then sent via socket to a "hardware emulation" program. Parts of the system ended up being clunkier than I would have liked, but I expect succeeding versions will be less clunky.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文