Forums MPLAB XC8 Tutorial Discussions How to use FatFs library in MPLAB XC8 without MPLAB Code Configurater? Reply To: How to use FatFs library in MPLAB XC8 without MPLAB Code Configurater?

#2543

Karalan
Participant

After configure that SPI module also I got same error.  Here is my new code:

#include “newxc8_header.h”
#include “ff.h”
#include “spi.h”
#define USE_OR_MASKS
#include <p18cxxx.h>

void main(void) {

ADCON1=0x0F;
OSCCON=0x76;

CloseSPI();

OpenSPI(SPI_FOSC_4,MODE_01,SMPMID );

 

FATFS FatFs; // FatFs work area needed for each volume
FIL Fil; // File object needed for each open file
UINT bw;
if (f_mount(&FatFs, “”, 1) == FR_OK) {
if (f_open(&Fil, “test.txt”, FA_OPEN_ALWAYS | FA_READ | FA_WRITE) == FR_OK) {
f_write(&Fil, “Hello world!\r\n”, 14, &bw);
}
}

CloseSPI();

while(1);
}

 

Error:

make[2]: *** [build/default/production/newmain.p1] Error 1
make[2]: *** Waiting for unfinished jobs….
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
make[2]: Leaving directory ‘C:/Users/CEERI/MPLABXProjects/SD_Card.X’
nbproject/Makefile-default.mk:84: recipe for target ‘.build-conf’ failed
make[1]: Leaving directory ‘C:/Users/CEERI/MPLABXProjects/SD_Card.X’
nbproject/Makefile-impl.mk:39: recipe for target ‘.build-impl’ failed

BUILD FAILED (exit value 2, total time: 794ms)

 

  • This reply was modified 1 year, 1 month ago by  Karalan.
Attachments:
You must be logged in to view attached files.