Issues in Generated Code with "SD Card Library" and "FatFs Library"
I have encountered a couple of issues during building a code which handles sd card. I am happy if I would have clues to resolve the issue.
Followings are the steps I have tried.
1. Generate the new project with following parameters: Device=PIC18F14K50, Compiler=XC8 v2.05
2. Launch MCC and set as follows:
- Added FatFs Library and SD Card Library to the project
- In the FatFs module, Added the "SD Card (SPI)" driver
- Assigned CD, CS, WP pins of the SD Card (SPI) module
3. Generate the code
After generating the code, building the code results in the following error.
i. "../drivers/spimaster.h" not found error
ii. Redefinition of "DIR" structure error
As for the (i) error the header file name is wrong. So I modified it to the correct name "../drivers/spi_master.h" and error resolved.
As for the (ii) error I have no idea to resolve it. "DIR" structure is defined in both ff.h and pic18f14k50.h. ff.h defines "DIR" structure to handle directory objects in FAT file system. pic18f14k50.h defines "DIR" as USTAT <DIR> bit.
I will wait for the update, but I would like to know any workaround if possible.
Thanks in advance.