Forum: ARM programming with GCC/GNU tools EFSL + AT91SAM7X+ hwinterface

Author: Flying Arm (flying)
Posted on:

Rate this post
0 useful
not useful

I am working on EFSL and trying to port this on to my Olimex board

I am using a microsd card with an adapter.

I did all the necessary SPI functions.

I checked even the sd card pins, and the chip selct pin shows signals
like low, high, low and there are signals on other pins as well.

Now i am not sure if i need to change anything in the header file

I observed all the examples provided with EFSL but didn't find any

But according to the manual of EFSL we need to configure the .c and .h
files to suit our hardware after choosing and defining the Hardware

The structure 'hwinterface' doesn't have anything here so my question
Do i need to change or add anything to this structure because as far as
i observed the file system in all source files efs_init is done by
passing a pointer of type hwinterface and if yes how i can defind this.

My arm_spi.h is as follows:

*              efs - General purpose Embedded Filesystem library
*          --------------------- -----------------------------------
* Filename    : arm_spi.h
* Description : Headerfile for at91_spi.c and lpc2000_spi.c
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2
* of the License.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* GNU General Public License for more details.
* As a special exception, if other files instantiate templates or
* use macros or inline functions from this file, or you compile this
* file and link it with other works to produce a work based on this
file,     *
* this file does not by itself cause the resulting work to be covered
* by the GNU General Public License. However the source code for this
* file must still be made available in accordance with section (3) of
* the GNU General Public License.
* This exception does not invalidate any other reasons why a work based
* on this file might be covered by the GNU General Public License.
*                        AT91 and LPC2000 Interfaces (c)2005 Martin
Thomas    *

#ifndef _ARM_SPI_H
#define _ARM_SPI_H

#ifndef FALSE
#define FALSE  0x00
#define TRUE  0x01

#include "../debug.h"
#include "../../conf/config.h"

 FILE   imagefile    File emulation of hw interface.
* long    sectorCount    Number of sectors on the file.
struct  hwInterface{
  /*FILE   *imageFile;*/
  eint32    sectorCount;
typedef struct hwInterface hwInterface;

esint8 if_initInterface(hwInterface* file,eint8* opts);
esint8 if_readBuf(hwInterface* file,euint32 address,euint8* buf);
esint8 if_writeBuf(hwInterface* file,euint32 address,euint8* buf);
esint8 if_setPos(hwInterface* file,euint32 address);

esint8 if_getDriveSize(hwInterface *iface, euint32* drive_size );

void if_spiInit(hwInterface *iface);
euint8 if_spiSend(hwInterface *iface, euint8 outgoing);
void if_spiSelectDevice(hwInterface *iface);
void if_spiUnselectDevice(hwInterface *iface);

void if_spiSetSpeed(euint8 speed);


If anyone of you had success with EFSL porting onto AT91SAM7X256 or
working with this please give me your suggestions to fix this problem.

Thanks in advance.



Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]

Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.