Gast
#395019
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?