0

我刚开始学习微控制器编程,似乎入门有很多困难,尤其是模拟部分。

这是我需要编写的一个应用程序:我需要在闪存芯片中存储几个波形文件,并使用 Cortex-M0 从闪存中读取音乐,并组合播放它们,或者运行一些基本信号对它们进行处理。

我正在寻找一个支持端到端模拟的 IDE。我查看了 CoIDE(因为如果我在谷歌上搜索免费的 Cortex IDE,那是第一个出现的),在确定 Cortex 之前,我还查看了 MPLAB,但我没有看到其中任何一个支持闪存芯片模拟。我似乎能够正确模拟芯片,但我没有看到构建虚拟闪存芯片的方法。

我错过了什么吗?非常感谢。

4

1 回答 1

2

首先 - MPLAB 是 Microchip 产品的 IDE,而 Microchip 没有任何 ARM 芯片,所以这个 IDE 根本帮不了你。

至于 CooCox - 这个 IDE 基本上是 Eclipse + GCC 工具链,据我所知,网络上可用的大多数工具链都没有启用模拟器,即使它们启用了,这也只是一个指令模拟器(可能不适合你的架构,但我不确定),所以你也可以在 PC 上编写你的软件,在那里测试它,然后将它移动到真正的硬件上——算法的工作原理是一样的(如果你使用可移植代码,所以使用“int “在 64 位桌面上不是一个好主意,最好对所有内容使用类型)。

只有像 IAR 或 Keil 这样的大型商业 IDE 和工具链可能为您的芯片提供模拟器(但这也可能有问题,因为这些都是相当新的),您只需要几千欧元就可以了。

我的建议 - 在进行嵌入式工作时忘记模拟器。

出现这种情况的原因可能很简单——不可能准确地模拟真实的硬件。要实现这样的目标,您首先必须拥有设备的完整 IP 内核,以及芯片内所有连接和外围设备的准确 VHDL(或类似的东西)描述。我只是没有看到所有供应商都将此类信息提供给任何愿意创建 IDE 的公司(;然后您需要一个用于 VHDL(或其他任何东西)的实时模拟器,能够模拟具有大量外围设备的非常大的芯片. 这可能是可能的,所以让我们转移到另一点。在现实世界中,芯片不是在真空中运行的,它连接到具有真实现象和真实信号的真实硬件。你无法准确地模拟。

Your project is quite a good example of the problems listed above. You may find a simulator of your ARM Cortex-M0 chip, but you won't be able to simulate the external flash chip connected to your microcontroller. You may as well stop looking, as I assure you that you won't find anything like that. BTW - your chip does not have external memory bus, so you'll have to operate the memory completely in software (the contents of external memory will NOT be mapped to some address range of your chip).

So as a final note - lack of simulator is not a problem - you have a debugger (which is capable of some things you could use simulator for), you have multiple debug-like-methods (blinking LEDs, printfs(), ...), you have h/w tools to check the system (multimeters, oscilloscopes, logic analyzers, ...), so it's not that bad (;

One more thing about CooCox. For me the idea is a bit fishy - it's free, it's based on free components, so why it's not open-source (some places claim it is, so where's the source)? There were other "free" environments like that in the past and it turned out that "free" meant "let's use free beta-testers for a while", and when the project reached some level of maturity it became commercial or severely limited in the free version... Atollic TrueStudio comes to mind as a great example of this strategy (and people LOVED it when it was free - everyone recommended it - "don't bother with GCC, use atollic, it's free and has no limitations"). I don't know how will future of CooCox look like, but this software is sometimes a bit strange, sometimes a big buggy and does not support all chips, so first check whether it "likes" your chip of choice. Oh - and it's done by people from China.

Embedded work may seem very like writing code for PC, but actually is a big shift in a way you think...

于 2013-02-18T07:41:54.597 回答