Linux on ARM Cortex-M3系列


29

我是ARM的新手,对所有不同的系列都有些困惑。

我需要构建一个低功耗网关(以太网,无线网络...),所以我认为cortex-M或cortex-R将是一个很好的起点。但是没有找到任何支持Linux的cortex-m3(似乎很受欢迎)的开发板。

似乎是linuxM3,所以我想知道为什么在mbedLPCXpresso周围没有linux项目?

谁能指出我想要的开发板,或者向我解释为什么“ cortex m” + linux没有更多答案?


恩智浦对其他处理器不确定是否支持特定处理器,但对某些处理器有Linux支持。
肯尼

2
它需要多低的功率?我设法基于Freescale iMX283构建了一个1/2瓦的完整Linux系统。在没有以太网的情况下,正常负载下为1 / 2W,在没有负载的情况下为1W,在完全负载下为<1.5W以太网...以太网PHY是正常负载下系统功率的一半。
darron 2011年

Answers:


18

关于ARM Cortex-M3:

Linux需要MMU(内存管理单元)。ARM Cortex-M3没有一个。在ARM Cortex-M3上运行主线Linux内核是不可能的。

但是,有一种适用于MMUless处理器的Linux内核变体叫uCLinux

Linux on M3指南

ST在uCLinux上的应用笔记

但是,正如其他人指出的那样,Linux在M3上不太可能实用。没有外部RAM,它将无法运行。我相信,即使最大的Cortex-M3部件也只有1MB闪存,因此您可能还需要额外的存储空间。


12

Cortex-M不能胜任工作,您需要ARM926EJ-S

A search for "Cortex-M + Linux" doesn't come up with a lot of answers because the Cortex-M isn't designed for Linux. The least-powerful ARM generally considered able to run a full OS like Linux is the ARM926EJ-S series, which uses the ARMv5 architecture. This is a classic processor, with wide adoption (it's found in many NAS boxes, older smartphones, and the Chumby Classic) and lots of support, but it's a little less efficient than its successors. It has an ARMv5 architecture, and runs at a couple hundred MHz.

This is what you really want, but you can't have it

我认为,您真正想要的处理器是Cortex-A5:旨在取代ARM11(并且比ARM11强大一点),但是在更现代的过程中具有更高的功率效率。(注意:与Apple的A5无关,这是特殊的Cortex-A9)。它于2009年发布,我们正等待“现在任何一天”看到硅。尚无人为此处理器生产通用SoC,因为智能手机驱动着市场,而功能更强大的A9和较老的ARM11之间的市场并不引人注目。有关更多详细信息,请参见此讨论:http : //forum.beyond3d.com/archive/index.php/t-60145.html

更强大的选择

ARM11中的ARMv6效率更高,但功能也更强大(因此,您可能看不到功率预算的任何节省)。它为iPhone 3G,iPod Touch,Kindle和Zune等较旧的智能手机供电,运行频率为500-800 MHz。最新的架构ARMv7是Cortex系列。Cortex-A8和-A9正在以800MHz-1.2GHz的频率为最新的智能手机和平板电脑供电,如果您希望采用极简设计,则可能希望使用较小,速度较慢的处理器。这些处理器的每瓦性能数是惊人的,但是仅使用ARMv5部件可能会更安全(当然也不会那么复杂)。


2
注:在Cortex-A5现已开始发售,并爱特梅尔要求提供Linux支持他们的版本:atmel.com/Microsite/sama5d3/...
pjc50

10

请在此站点上找到一些支持Linux(uClinux)的Cortex-M3平台:

http://www.emcraft.com/

We successfully run uClinux on the following Cortex-M3 MCUs: NXP's LPC1788, STmicro's STM32F2, Actel's SmartFusion, and are in process of adding support for a couple more: Freescale Kinetis, STM32F4 (these two are Cortex-M4 rather than Cortex-M3).

确实,Linux(包括uClinux)需要外部RAM才能运行-即使对于超小型Linux配置,Cortex-M的集成SRAM也不够大。您至少需要4MB的外部RAM才能进行实际配置。实际上,越好越好-如果您的应用程序需要“功能”,Linux几乎可以支持任何功能,并且您添加更多而不是更少的RAM不会令您感到遗憾。

对于用于外部RAM的特定设备,所有这些都由特定MCU提供的外部存储器接口定义。STM32F和SmartFusion仅支持SRAM。您将能够以$ 6-7的价格获得16MB的70ns PSRAM(具有页面模式以加快操作速度);LPC1788支持更快的SDRAM存储器;Kinetis K70支持DDR2(64MB设备为5美元)等。所有这些存储器在静态时间仅消耗uA电平的功率。

您需要一些东西来从中加载可引导的Linux,但这几乎可以是任何东西-网络,SD卡,SPI EEPROM,NOR或NAND闪存等。

总的来说,我敢说Linux是Cortex-M3设计的一个完全实用的选择。

更新资料

在许多功耗敏感的应用程序中,您的设备大多数时候都处于空闲状态,但是,在运行时,它需要能够执行许多事情,而使用较小的RTOS则很难做到这一点。安全连接,VLAN,TCP / IP隧道,SNMP,SD卡,USB设备/主机,WiFI等,并且要求清单不胜枚举。

如果使用较小的RTOS,则可以使用其中的某些功能,有些则不可用,但这只是故事的一部分。我们越来越多地与客户一起看到,使用Cortex-M3的嵌入式设计不仅需要这些高级功能中的一两个,还需要在单个设备中完成许多这些高级功能。即使RTOS提供了设计需要的现成的所有功能,将其全部塞入片上存储器也将是一个挑战。是否使用uClinux,我的猜测是,趋势将是越来越多的基于Cortex-M的设计将使用外部存储器。当然,一旦您在设计中获得了外部RAM,uClinux就开始变得更有意义了。

关于Cortex-M提供的低处理能力(根据Linux内核的要求衡量),作为最近的经验,我们刚刚在Freescale K70 MCU上启用了uClinux。这是一个Cortex-M4(与Cortex-M3以及硬件FP和DSP单元相同);片上接口与2x8KB片上高速缓存的高密度RAM(DDR2)和闪存(NAND)。120Mhz Cortex-M内核,即将推出150Mhz部件。

Linux(uClinux)恰好在此设备上运行。使用“ dhrystone”,我们在250Mhz Freescale PowerPC盒上获得大约50%的性能。快速启动,大量RAM(TWR-K70模块提供128MB RAM和256MB NAND闪存),网络,JFFS2,帧缓冲,SSH,HTTPD,Qt / E-所有这些在K70上运行都很好。总体用户体验是在装有MMU的微处理器上的常规“嵌入式Linux”。

Here is a pointer to the video of a live uClinux session running on the Freescale Kinetis K70 Cortex-M4 MCU:

http://www.youtube.com/watch?v=UZjJrLG9CeA


5

Without some kind of support for external memory (both RAM and Flash) it is impossible that you can fit even the smallest linux distribution (say, uclinux) on to the mentioned devices' built in resources.

This typically means a 32-bit bus is exposed in order to hook up additional chips. This is why it's more common to see linux single-board-computers (SBC) with additional RAM and flash chips in the megabytes-range used to run linux. The microcontrollers you've listed don't offer this. The way I see it, the cortex-m0/m3 is meant more for applications where an 8-bit micro would not (or barely) suffice - thus all the resources you need are built into the chip.

To better answer this question, it would be wise to analyse the requirements for embedded linux. This typically means being able to fit a bootloader, kernel, and file system - and of course the actual user application and libraries required to run it. Total this up and you'll soon see that you may need a couple megabytes of RAM and Flash to do anything useful.


3

There is not MMU on the stm32 so you have to use ucLinux.

A quick google for ucLinux will send you in the right direction. https://www.google.com/search?q=stm32+uclinux

But on the other hand, Linux is not really that useful on this kind of small mcu and most of he time you need external ram and a SD-card to get it running. And then the pricetag is closing up on projects like the Rasperry PI, so you need to think about what your needs are.

Maybe another smaller OS is a better choice? Even thou it is nice to have Linux everywhere...


3

There are some low power applications like smart meetering where it is indeed usefull to use a Cortex-M3 with external Memory running Linux. Think not in terms of total cost (The boards will cost nearly as much as with a faster Core) but in terms of energy consumption.

If you live off a battery, and are idle mode most of the time, taking a measurement maybe each minute or so and then sending that off over a network it might be nice to be able to use the infrastructure brought to you by linux for TCP/IP, encryption etc.

On the embedded World Exhibition this year Pengutronix showed a linux on a prototyping-board from EnergyMicro running uCLinux on a Cortex-M3 with external RAM and a powerconsumption of 1.6mW when in idle Mode. Energy Micro has some incredible low power Cortex-M3 and M4 MCUs in their portfolio specifically optimized for low power applications which need aprox 16mW of Power when running at 32MHz while executing Code from RAM. This can enable Linux on a variety of battery powered devices where bigger and faster processors just don't fit your energy budget. On the other hand you won't get a lot of processing power from these either...

So basically if you're living of a battery and don't need much processing power this might be a solution for you, if not you might opt for a bigger ARM Core with MMU.


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.