EFSL + MSP430

Gast #395019
Lesenswert?

Hallo!

Ich versuche EFSL auf den MSP430 zu "portieren". Leider bekomme ich
beim efs_init immer -1 zurück. Hier mein Harsware-Endpoint (basiert auf
dem vom atmega128):
<c>
#include <io.h>
#include "interfaces/msp430.h"
#include "interfaces/sd.h"

esint8 if_initInterface(hwInterface* file, eint8* opts)
{
  if_spiInit(file);
  if(sd_Init(file)<0)
    {
      DBG((TXT("Card failed to init, breaking up...\n")));
      return(-1);
    }
  if(sd_State(file)<0){
    DBG((TXT("Card didn't return the ready state, breaking
up...\n")));
    return(-2);
  }
  file->sectorCount=4; /* FIXME ASAP!! */
  DBG((TXT("Init done...\n")));
  return(0);
}

esint8 if_readBuf(hwInterface* file,euint32 address,euint8* buf)
{
  return(sd_readSector(file,address,buf,512));
}

esint8 if_writeBuf(hwInterface* file,euint32 address,euint8* buf)
{
  return(sd_writeSector(file,address, buf));
}

esint8 if_setPos(hwInterface* file,euint32 address)
{
  return(0);
}

void if_spiInit(hwInterface *iface)
{
  U0CTL |= SWRST;
  ME1 |= USPIE0;
  P3SEL |= 0x0E;
  P3DIR |= 0x01;
  U0CTL |= CHAR + SYNC + MM;
  U0TCTL |= SSEL_3 + STC;
  U0BR0 = 0x02;
  U0BR1 = 0x00;
  U0MCTL = 0x00;
  U0CTL &= ~SWRST;
  P3DIR |= 0x01;
  P3SEL |= 0x0E;
  P3OUT = 0x01;
}

euint8 if_spiSend(hwInterface *iface, euint8 outgoing)
{
  euint8 incomeing;
  P3OUT = 0x00;
  U0TXBUF = 0xFF;
  while(!(U0TCTL & TXEPT));
  //for(outgoing = 0; outgoing < 0xFF; outgoing++);
  incomeing = U0RXBUF;
  P3OUT = 0x01;
  return incomeing;
}
</c>

Hat hier schon jemand EFSL erfolgreich auf einem MSP430 eingesetzt?
Gast #588501
Lesenswert?

Es gibt fertigen Code für MSP430 mit FAT auf MMC irgendwo auf dem 
Circuit Cellar ftp-Server (von einem Autoren namens Sham oder ähnlich, 
google müsste helfen). Der FAT code ist im Vergleich zur efsl recht 
einfach gehalten und "nur" FAT16, reicht aber vielleicht schon so wie er 
ist für die Anwendung aus. Ansonsten kann man sich zumindest die 
Low-Level-Funktionen für SPI-init/MMC-Init/read block/write block 
abschauen und sehr viel davon in ein MSP430 Interface für efsl oder 
Chans fat-module übernehmen

Martin Thomas
Gast #613019
Lesenswert?

@ niko

I asked the same question some weeks ago, I didn't get an answer by 
Karlos.

But I think mthomas gave a right advice. EFLS seems to be too 
complicated and  too big to be used with the MSP430.

I suggest to try the following which seems to be much more simpler to 
convert. http://elm-chan.org/fsw/ff/00index_e.html.

A first short test I did was almost successful. I converted the
basic stuff to a F149. There is also a tiny version which possibly fits 
to smaller devices.

It's just an idea, because I'm looking for something similar.
Gast #618361
Lesenswert?

Hi roty,

thanks for the reply.

I am a programmer hobbyist and would be willing to help you out with 
debuging the code, if you want. However, my target platform is an 
MSP430F169 (its the only one I got).

Would you be willing to share code with me?

Regards
niko

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren