Archive for June, 2012

June 20th, 2012
Ant Micro porting eCos to Enclustra’s Zynq module – Mars ZX3

The connection between the two worlds of embedded and FPGA is becoming more and more apparent – all the more so with solutions such as Xilinx Zynq, which combines a general-purpose dual-core ARM with programmable logic allowing for dedicated processing in a single chip.

As a company active in both fields, we were quite eager to lay our hands on Zynq chips, to get the feel of the module and how it works in practice.

Following our visit to X-Fest in Oslo we were talking with Enclustra, the Swiss FPGA company and producer of FPGA modules to give us an early sample so that we can be one of the first few companies able to work with physical Zynq chips. They agreed to partially sponsor the port of the eCos real-time operating system for the module, and so, here it is:

The module is excellent, just as well made as the previous board we got from Enclustra, coming in the popular (and small!) SO-DIMM format. It allows you to integrate Zynq into your design quickly, with much less effort than to design from scratch.

The port is scheduled for release early Q4 2012. Go to Enclustra’s website for updates, other operating systems as well as to subscribe for the Beta program and get the boards for yourself. If you already decided to use Zynq or are leaning towards it, we can help you with integrating it into your own designs and products.

Follow our blog if you want to learn of our progress and let us know if you want to use eCos on the Zynq. A note on running RedBoot on the ZX3 module as an alternative to U-Boot will follow soon, so as always – stay tuned (and enjoy the summer)!

June 14th, 2012
U-Boot for Colibri Tegra 2 pushed to github

In our post from over a year ago we published some patches to U-Boot which allowed us to use it with the Colibri Tegra 2 module from Toradex, the first widely available embedded SoM featuring an Nvidia CPU.

A long time has passed since then, and – as you can probably see if you follow the blog – we have been busy with lots of other things in the meantime. But as we have noticed that the the code lives on and has been put to good use, we thought it a good idea to include it on our github for more convenience and a clearer picture – the original manner of publishing of the code was the result of the haste which always accompanies work with hot technologies.

Our github fork of U-Boot shows how the necessary patches are applied in the proper order and might be helpful for people exploring how bootloaders are ported between different ARM modules and boards.

It is worth noting that those changes were performed before we got any CPU datasheets from Nvidia, using virtual platform tools that we are developing. This was a great example of a scenario where the appropriate tools really made a difference!

If you are interested in open source and new embedded technologies, follow us throughout the summer (the easiest way to do is through our twitter) – there will be a lot going on. One of the more interesting technologies we are already working with is Xilinx Zynq, be sure to come back soon for updates about that and other really interesting topics.

June 11th, 2012
Migrant – open source serialization library

It happens to everyone: you start using a library, find it lacking some features, start fixing it, committing opatches, and then end up rewriting it because the whole premise it based on does not suit your needs.

So it happened with us and serialization in C#, for which we originally used protobuf-net which employs the protocol buffer serialization format by Google.

Serialization is a tricky problem, especially when performance matters for your application. If you go for feature completeness, you compromise speed, but too much focus on speed makes you unable to serialize more complex objects.

We did, however, see room for improvement in both, so we set out to wirte our own library; thus Migrant was born. For now, it is hosted on our github account, but will get a dedicated page when time permits.

A few notes about the library: though it originally used reflection, we decided to abandon it in favour of a more efficient method (though we provide the option to switch between the two). Serializing with the new method is now complete, while deserializing still needs some work.

As far as speed is concerned, preliminary benchmarks are very promising. Care is taken to test the framework thoroughly (also across the two (de)serialization methods) so that things don’t get messed up as the library develops.

A recent feature is the possibility to serialize C# delegates. We will be aiming to increase the performance of this feature, but it works well as is.

Another feature we think quite interesting that we are aiming to get soon is what we call version-tolerant serialization. It often happens that in developing frameworks and programs classes are changed as time passes, and objects serialized by one version cannot be restored by another due to this incompatibility. There are many scenarions, however, when this should be perfectly possible, e.g. when the number of fields is reduced or the new fields have perfectly acceptable default values. In those situations Migrant will allow you to deserialize such a legacy object, perhaps issuing some warnings that this was done.

June 7th, 2012
SPI driver for OpenRISC eCos

After a short break, this week we are going to deal with SPI support for the OpenRISC eCos port,

To add the driver to the eCos build, the CYGPKG_IO_SPI package has to be added as follows:

1
ecosconfig add CYGPKG_IO_SPI

ECos requires that each device connected to the SPI bus is properly described. Our driver provides a macro for this purpose:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
CYG_DEVS_SPI_OPENCORES_SIMPLE_SPI_DEVICE(
  name,        // handler name of the device
  bus,         // SPI bus, numbering starts at 0
  cs,          // CS line, numbering starts at 0
  polarity,    // polarity (1 or 0)
  phase,       // phase (1 or 0)
  freq,        // maximum SCK frequency measured in hertz
  cs_to_tran,  // minimum delay between CS signal and start
               // of the transmission, measured in microseconds
  tran_to_cs,  // minimum delay between the end of the transmission
               // and the release of CS signal, measured in microseconds
  tran_to_tran // minimum delay between transmission of consecutive
               // bytes, measured in microseconds
);

For example, to add a m25pxx flash memory, fairly common on FPGA boards, connected to bus 0 chip-select 0, we can describe it as follows:

1
2
3
CYG_DEVS_SPI_OPENCORES_SIMPLE_SPI_DEVICE(
  m25pxx_spi, 0, 0, 0, 0, 1000000, 1, 1, 1
);

It is worth noting that eCos already has a driver for this memory type. To use it you have to add the CYGPKG_DEVS_FLASH_SPI_M25PXX package:

1
ecosconfig add CYGPKG_DEVS_FLASH_SPI_M25PXX

And connect the SPI device to it:

1
2
3
CYG_DEVS_FLASH_SPI_M25PXX_DRIVER (
  m25pxx_drv, 0, &m25pxx_spi
);

Note: Get the relevant code from our mirror of eCos-openrisc on Ant Micro’s github account.

The eCos provided by Ant Micro now supports:

  • UART
  • SPI
  • Ethernet
  • SDIO

Stay with us for more updates about OpenRISC, FPGA and open source in embedded systems.

 

Copyright © 2009 - 2013 ant micro. All rights reserved. | Design: Duind.com