During our work with the OpenRISC platform we were missing our favourite real-time operating system – eCos. Although some porting work had been performed earlier, the eCos port was no longer supported. With the development of the OpenRISC project, as a result of toolchain and other changes, it had stopped working.
Also, it was based on the now obsolete 2.0 version of eCos.
We decided that a freshly updated eCos port could be useful both in our work and for the OpenRISC community, and here it is!
On http://opencores.org/or1k/ECos you will find the associated wiki page and from there you can download the code, of which Piotr Skrzypek is the maintainer.
Tags: eCos, openrisc
Posted in OpenRISC, eCos | No Comments »
Using eCos on AT91SAM7 family processors has generally been a positive experience, however, the absence of some important functionalities can be somewhat of a problem. One of the most striking deficiencies of eCos is the lack of an interrupt-based driver for I²C, a popular bus used especially with various sensor chips. As we had to devise such a driver in one of our projects, we publish it below. The code can be used for the eCos userspace application on both SAM7X and SAM7S and, after some modification, can successfully be used seperately from the eCos platform.
The code is released on the BSD license. We appreciate any remarks!
First we have to declare a few variables – mutex and flag handles, and some buffer structures:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| // rx_tx_struct
typedef struct {
cyg_int16 len;
cyg_uint16 index;
char *buffer;
} I2C_RX_TX_STRUCT;
I2C_RX_TX_STRUCT rx_data_struct, tx_data_struct;
// handles, flags, mutexes
cyg_flag_t rxrdy_flag;
cyg_flag_t txrdy_flag;
cyg_flag_t txcomp_flag;
cyg_flag_t done_flag;
cyg_handle_t hIntr;
cyg_interrupt intr;
cyg_mutex_t twi_mutex; |
(more…)
Tags: ARM7, AT91SAM7, eCos, I²C
Posted in ARM | No Comments »