1
\$\begingroup\$

I am developing an I2C driver for an accelerometer.

My objectives (actually it's the restriction I have as per the project guidelines given in my institute):

  1. use Linux flavour of operating systems - (software)
  2. use ARM core based ISA (ARM CORTEX- A or M series) - (hardware)

Any help in this regard would be great.

One of the solution offered to me was to go for FreeRTOS on NXP's LPC1769 which is ARM cortex-M3 based SoC. (using LPCXpresso developmental board)

But my question is: Why go for RTOS when my requirement is driver implementation? Why can't I take up normal vanilla flavour of Linux kernel or so?

And also any help regarding the developmental boards supporting the above configuration?

Any suggestions or thought process on this?

\$\endgroup\$
  • \$\begingroup\$ It is probably meant to be educational. \$\endgroup\$ – Spoon Jun 25 '14 at 18:26
  • \$\begingroup\$ Do you mean that you have to use a Linux OS to develop on, or you want to use a Linux on the target MCU? \$\endgroup\$ – Blup1980 Jun 25 '14 at 19:12
  • \$\begingroup\$ I want to use Linux on the target controller. Actually, the basic necessity is to understand how to write i2c driver for a device.For that i need an operating system.I am in confusion regarding the combination of processor core(cortex-m or cortex-A) and operating system(linux),and plus Cortex M series does not support MMU ,so Linux does not come into picture. \$\endgroup\$ – kishanp Jun 25 '14 at 19:19
2
\$\begingroup\$

I am not sure what you are asking about but,

There is something interesting with your assignment:

  • You have to use a Linux kernel
  • It would be an ARM A or M.

First of all, porting a linux kernel is not an easy task !

You have two choices. Either the platform you choose is supported already and you can use it or it is not. And when I say platform I mean the whole board, not just the model of MCU. Each board may have different RAM chip & FLASH chip, use different IO assignments, clock tree, etc. All these things are pretty low level in the kernel (or in the bootloader) and would require a lot of effort to port (and to test). When I say a lot, I mean months if you are familiar with this, or maybe years if not...

I am not aware of standard Linux kernel port for Cortex-M. IFAIK the lack of MMU in Cortex-M devices is a NO-GO for a std linux kernel. You may use uClinux instead. But is it still Linux ? You would have to answer this.

This is also why you can't use a common linux distribution: Your platform won't be a PC. The RAM you will have might reach 512MB, not 4GB. Thing about a Raspberry Pi board. No standard Linux for it, but some custom distribution made specifically for it. In fact a Raspberry Pi might be OK for you here. All the system is ready, and you could focus on writing an I2C driver for your accelerometer.

Then you are talking about RTOS. First, Linux is not a real-time OS. Real-time may be added to the standard kernel (Xenomai for instance) but I am not sure why you are talking about real-time OSs here.

You also said that one option was to go with FreeRTOS. But this would violate your requirement to use a Linux kernel. And if the goal of the whole project is to learn device driver development. Using FreeRTOS or Linux is completely different in term of driver coding.

Anyway, using FreeFTOS seems a sound idea here. It comes with a lot of supported platforms including examples. It is quite easy to use (at least an order of magnitude (or maybe two) easier than porting a Linux kernel). It is real-time, this might be a requirement, depending what you plan to do with your accelerometer data. Last but not least, you may not need external RAM or FLASH. It is lightweight enough to fit into the internal memory of your MCU. A Cortex-M is fine here.

* EDIT *

I read in the history of your question that you initially said that it is supposed to be a 1 month project.

Thus you don't have the choice anymore and have basically two options:

  1. Go for a well known embedded Linux platform that is alread up and running, such as the Raspberry Pi. And dive into Linux kernel diver development right away.

  2. Go for a platform already supported with an I2C example of FreeRTOS. You may download FreeRTOS and look into the example folder. Find a board that has an I2C example attached to it and use that board.

I am not aware of your cost requirement for your project, but a sound dev-board might cost hundreds of dollars and may require a programmer or a development environment that may or may not be free, when a Pi is ~50$ and requires nothing.

\$\endgroup\$
  • \$\begingroup\$ My institute is providing me with BeagleBone, Beaglebone black, Beagleboard, LPCXpressso1769 boards. So my options are limited. And the reason why FreeRTOS came into picture was because LPCXpresso1769 boards have ARM Cortex-M3 core, which can do not have MMU support. So only RTOS seemed viable there. Secondly, the core thing is driver learning experience.Application level development is secondary to me.And i have to make a choice among the boards available,thats actually a big constraint.And ya regarding porting, YES IT IS NOT AN EASY TASK, but for sure, will learn alot. \$\endgroup\$ – kishanp Jun 26 '14 at 12:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.