我希望能够为高端 MSP430 提供一个基本操作系统和一个基本文件系统,可能是 MSP430F5438。我知道我可以使用 FreeRTOS 、 IAR PowerPac 或 Micrium 来命名只是操作系统和文件系统的一些选项。不过,我希望能够在稍后加载小小程序或线程,理想情况下可以从文件系统中获取这些额外的代码。我的目标是不必重新刷新整个设备来更改或实现嵌入式设备上的功能。不确定该去哪里实现此功能,或者是否需要切换到 ARM 等其他处理器。
I would like to be able to have a basic OS and a basic file system for the high end MSP430 probably the MSP430F5438. I know I can go with something like FreeRTOS , IAR PowerPac or Micrium to name just some of the options for the OS and file system. However I would like to be able to also have the ability to load little applets or threads at a latter time ideally getting this extra code off of the file system. My goal is not to have to reflash the entire device to change or implement a function on the embedded device. Not sure where to head to implement this ability or if I need to switch to another processor like an ARM.
发布评论
评论(5)
MSP430 是一个很棒的控制器,但如果您想运行操作系统并加载应用程序而不将其刻录到闪存,您可能应该切换到 ARM(另一个拥有许多基于 ARM 的微控制器的出色平台)。
The MSP430 is a great controller, but if you want to run an OS, and load apps without burning them to flash, you should probably switch to ARM (another great platform with many ARM based microcontrollers).
我非常确定每次想要更改程序代码时都必须重新刷新 MSP 430。当然,引导加载程序可以自行更新闪存,因此您只需制作一个像引导加载程序一样运行的程序,但仅更新程序存储器的某些部分 - 即您希望放置小程序的位置。然后您必须知道小程序代码所在的闪存每个区域的内存位置,以便您可以调用它。
在这些小程序中运行代码时您还会遇到问题。如果您只想从一个内存位置运行它们,那么您可以在编译它们时考虑到这一点。如果您想要多个不同的小程序可以从内存中的任何“小程序空间”运行,那么您可能会遇到麻烦,因为它们不知道从哪个地址开始。
当然,这些小程序都不会很大。您的 RTOS 会占用多少空间?
I'm pretty sure that you're always going to have to reflash the MSP 430 every time you want to change the program code. Of course a bootloader can update the flash by itself, so you'll just want to make a program that acts like a bootloader but only updates ceratin parts of the program memory - ie, where you want your applets to be placed. And then you'll have to know what memory location each area of the flash where your applet code is so you can call it.
You'd also run into a problem with running the code in these applets. If there's only one memory location you want to run them from then you can compile them with that in mind. If you want several different applets that could run from any 'applet space' in memory then you might run into trouble because they won't know what address they are starting from.
And of course, none of these applets is going to be able to be very large. How much room will your RTOS take up?
Msp430 控制器受多种操作系统支持,可提供您所需的功能。其中一些提供 OTA(无线编程)。有些提供(基于闪存的)文件系统。然而,这通常意味着使用闪存来存储上传的程序。
以下是目前支持 msp430 的几个活跃操作系统:
Contiki - 用于“物联网”的操作系统。提供原始线程。
MansOS - 类 unix 操作系统,支持 msp430 设备的线程和 OTA。
Msp430 controller is supported by several OS-es that may provide the functionality you desire. Some of them provide OTA (over the air programming). Some provide (flash based) file systems. However, this will often mean using flash memory to store the uploaded program.
Here are a couple currently active OS-es supporting msp430:
Contiki - OS for "Internet of things". Provides proto-threads.
MansOS - a unix-like OS that supports threads and OTA for msp430 devices.
闪光
在 msp430 上,您可以以 512 字节块擦除/重写板载闪存(用户闪存可以处理更小的块)。
因此您的引导加载程序/稳定 RTOS 可以使用此“应用程序”对芯片进行重新编程。
重定向中断有点棘手,但这可以通过从“真实”向量表到应用程序向量表的重定向跳转来完成。
调用稳定/RTOS
还可以从应用程序调用稳定部分的函数,您可以在稳定部分中为每个函数构建一个固定的跳转表,这样应用程序就知道如何调用该函数,即使您构建了另一个稳定/RTOS 版本。
内存
如果您只允许一个应用程序,这很容易。
您必须为稳定的 RTOS 保留一些 RAM,其余的 RAM 可供应用程序使用。
但是,如果您想使用多个应用程序,那么解决放置变量的问题可能会很棘手。
要从应用程序保留 RAM,我更喜欢动态分配,但即便如此,您也需要一个用于动态分配块的指针,并且这些指针是固定的,或者您的应用程序使用堆栈上的变量。
Flash
On a msp430 you can erase/rewrite the onboard flash in 512byte chunks (the user flash can handle smaller chunks).
So your bootloader/stable-RTOS could reprogram the chip with this "applications".
It's a bit tricky to redirect the interrupts, but that can be done with a redirection jump from the "real" vector table to an application vector table.
Calling stable/RTOS
It's also possible to call functions of the stable part from the applications, you could build into the stable part a fixed jump table for each function, so the application knows how to call the function, even if you build another stable/RTOS version.
RAM
If you only allow one Application, this is easy.
You have to reserve some RAM for your stable RTOS, and the rest of the RAM can be used by the application.
But to solve the problem with placing your variables could be tricky, if you want to use more than one application.
To reserve RAM from an application I would prefere then dynamic allocation, but even then you need a pointer for the dynamic allocated blocks, and these pointers are fixed based or your applications use variables on the stack.
还有一些 FRAM msp430 部件也可能值得一看。不过,内存仍然不是很多。
There are some FRAM msp430 parts out that may also be worth looking at. It's still not a lot of memory, though.