Question

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.

Was it helpful?

Solution

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).

OTHER TIPS

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 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.

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.

There are some FRAM msp430 parts out that may also be worth looking at. It's still not a lot of memory, though.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top