Author Topic: CF card support  (Read 14055 times)

Offline aersek

  • Newbie
  • *
  • Posts: 17
    • View Profile
CF card support
« on: January 22, 2010, 11:05:38 AM »
Is in plan to support CF cards in uTasker uFAT project? I'm interested in using uFAT in my project on CF cards because our system has many SPI devices connected and high SPI bus utilization. Processor is MCF52259 or some other ColdFire with parallel bus interface.

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: CF card support
« Reply #1 on: January 22, 2010, 11:34:03 AM »
Hi

I don't know for sure but it looks as though CF cards are essentially compatible with SD cards - see the following adapter where an SD card is inserted into a CF card holder: http://de.wikipedia.org/w/index.php?title=Datei:CompactFlash_SecureDigital_Adapter.jpg&filetimestamp=20090504141232

If this is the case then it should already work.

Regards

Mark

Offline aersek

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: CF card support
« Reply #2 on: January 22, 2010, 12:21:56 PM »
With current code it can not work because SD card is connected to processor using SPI bus, CF cards use parallel bus like SRAM or MRAM memory, 8 or 16 data lines and 11 address lines with addressing range configured to one of chip selects on processor. MCF52259EVB board has CF card connector on it. This adapter can be used if software and hardware supports CF card interface, to access SD card using CF card interface.

Regards

Andrija

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: CF card support
« Reply #3 on: January 22, 2010, 01:01:34 PM »
Hi Andrija

You are right - the adapter that I saw allows an SD card to be used in a system with CF interface but this has nothing to do with compatibility - the adapter is probably active and performs the necessary conversion for backward compatibility.
Due to the parallel architecture the CF is more powerful - ex. for high throughput photography.
The Freescale M52259EVB has a CF adapter, for which also a CPLD is used due to the interface requirements.
his makes the solution quite specific to this board - a high-end one rather than a simple generic one as SPI allows.

The first things to define are what a file system does and what it doesn't. A file system (specifically FAT) allows managing a generic memory system for saving and retrieving data - this the the FAT32 level. This can however not work on its own because physical memory requires routines to perform detection (when removable), initialisation and the low level reading and writing. On top of this it requires an application interface so that it can be used (without too much effort) for useful applications.

utFAT V1.0 provides thus a package of these functions to allow the user to use SD cards based on SPI access. It doesn't allow other media to be used without adapting the parts which are media specific. One interface which should be added is SD mode operation rather than SPI mode. This allows processors with in-built SD controllers to operate more efficiently but is of course restricted to processors with this capability. Since a number of processors do have such interfaces (especially the NXP LPC2xxx family) this is probably the next step in media support.

The CF Flash interface requires that the processor has a high performance external bus which also restricts its application. Due to its timing requirements (and the fact that the M52259EVB has an additional CPLD) this interface is probably further complicated, again restricting its use (due to space, complication and costs) to applications which require higher performance rather than more general mass storage capabilities.

My conclusion is therefore that, when the hardware can support this interface (it will probably make physical accesses even easier due to memory mapping) an adaptation of the low level interface should in fact not be complicated at all. It should be theoretically easier than the SPI interface, although there are questions about how much support for things like error correction and level wearing is contained in the device itself (it may be necessary to add additional management level code?). This development does however seem quite specific to higher end applications with processors/boards with the necessary hardware resources and so less suitable for a general extension development in the uTasker project framework.

Regards

Mark

Offline aersek

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: CF card support
« Reply #4 on: January 23, 2010, 10:18:53 AM »
Ok, I understand that main target of uTasker are small integrated processors, but it is very powerful and can also be used in higher class of processors. It's very simply to port it on other processor of similar family. Currently we use it on MCF5282 which is not supported by uTasker but in few days of adapting we get all functionality which we needed. Also I suppose that it would not be hard to port it to more powerful processors like ColdFire V3 or V4 in near future if we decide that is needed more powerful processor for our projects. I suppose that similar situation is with AVR and ARM cores supported by uTasker.

CF card interface hardware is not complicated and CPLD isn't necessary to create it. MCF5329 evaluation board from LOGICPD has CF interface realized just using standard parallel bus with one transistor and one inverter on single control line. On software side CF driver is almost absolutely portable because it used simply parallel interface and is not dependent on some processor specific interface (like SPI). Maybe would be more customers who will want to use higher performance CF interface in their projects.

Best regards

Andrija
« Last Edit: January 23, 2010, 10:27:20 AM by aersek »

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: CF card support
« Reply #5 on: January 23, 2010, 02:36:03 PM »
Hi Andrija

You are correct in saying that porting to more powerful processors is not complicated and I am pleased that you could achieve the desired functionality without too much effort.

I think that the most important point is that the uTasker project is designed for single chip processors, which essentially means that it needs to be able to achieve a high level of functionality and user comfort without being able to rely on large amounts of memory. This means that it is certainly restrictive in its use of such resources, or put another way, it tried to use these as sparingly and as efficiently as possible.

When processors, like the larger Coldfires, have external memory it means that they tend to have large resources available (this also means that space requirements, power consumption and costs are generally higher too) and so some of the resource saving mechanisms in the project, which were optimised for the smaller processors - for example the single-chip V2 Coldfires - then become of less importance and may even be seen as a weakness. The project will of course be able to run on processors with high resource levels but may use a tiny footprint in comparison. The basic reason why it is probably not of great interest to support the larger chips is because this is then moving into territory dominated by solutions such as ucLinux, and others. These other solutions are on the other hand not practical when a larger design is to be shrunk to a smaller design - they would probably simply not be possible. To summarise, I don't want to say that the project is not of use or a bad choice for larger processors - I hope that it remains still a very good solution - but I don't think that generally the investment required to extend into this area and support it would be sensible since it is not such a good match and the competition is so great.

It is however worth noting that the uTasker project does make for a very good boot loader project for something like ucLinux on the larger platforms. It allows a full featured loader to be installed (essentially a uTasker project or a stripped down version with just the desired features - like a comfortable web browser for controlling uploads) which then controls loading of large applications.

But back to the CF card question: I still don't know the technical details about programming the cards but assume that there is a command mode which needs to be added. The FAT32 layer and most above it should be media independent. This means that it should not be a great amount of work to adapt the utFAT interface to work with the CF card. Are you interested in adding this interface specifically for your project?

Regards

Mark

Offline aersek

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: CF card support
« Reply #6 on: January 23, 2010, 08:28:43 PM »
As I see uTasker project is mainly oriented to let say it simple ethernet supported consumer applications. Another market also looking for low footprint easily adaptable ethernet communication software base. That are industrial control applications (my area of interest) which can use uTasker as background process of higher priority RTOS which manages main control application. In system like that uTasker is responsible for communication and non real time control. In projects on which I'm working motto is "make it as simple as possible". Because of that uCLinux and other packages like that are not option.

Currently we are planning one future project which will have mass storage capability. On hardware side are possible SPI interface (SD cards) and parallel interface (CF cards). We didn't decided which type of cards we will use, but maybe we will add CF card support in uTasker for our project if decide it. Plans are little bit long term and this discussion is part of research for possible options.

Thanks on good overview and discussion  :)

Best regards

Andrija

Offline jezc

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
Re: CF card support
« Reply #7 on: January 23, 2010, 10:43:21 PM »
Hi,

I'd be very interested if you (and any other contributors) would be prepared to share some of your experience with porting uTasker to the Freescale 5282 processor (or others) - we've an existing design using this processor which would benefit greatly from uTasker being available!

I know this isn't directly relevant to this thread, but is there scope within this forum for people to identify which processors they have ported to?

One of the most refreshing (and valuable) things about this software is the excellent support offered by Mark and the forum contributors - along with the great value and continual improvements, of course!

Just hoping to be able to widen the use of uTasker within our company!   ;D

Cheers,
    JezC

Offline s2c97

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: CF card support
« Reply #8 on: April 01, 2010, 10:01:16 PM »
Hi,

like jezc mentionned it would be interesting to hear from aersek (and others) about some pointers on porting utasker over to the MCF5282.

I am going to start a new discussion under "utasker general" regarding porting utasker to non supported processors like the MCF5282 and see if I could get some other members to share their technical experiences.

kind regards,
s2c97