Part Number: SIMPLELINK-CC26X2-SDK
Tool/software: TI-RTOS
Hello Ti Experts,
I am trying to implement the SDFatFS module ____
I was following the example implementation detailed in the following link:
From that link I developed the following code:
#if FATFS_ON #include "ff.h" //#include "ff.c" #include "SDFatFS.h" #include <ti/drivers/SD.h> /* Drive number used for FatFs */ #define SD_DRIVE_NUM 0 char fileName[100] = "1"; #endif void mainThread() { #if FATFS_ON SDFatFS_Handle sdfatfsHandle; FILE *src; // const char inputfile[] = "fat:"STR(SD_DRIVE_NUM)":input.txt"; /* Mount and register the SD Card */ sdfatfsHandle = SDFatFS_open(Board_SD0, SD_DRIVE_NUM); /* Open the source file */ src = fopen(fileName, "r"); #endif } int main() { /* Call driver init functions */ Board_initGeneral(); I2C_init(); SPI_init(); UART_init(); #if FATFS_ON SDFatFS_init(); #endif // Declare task param structure and task handle Task_Params taskParams; Task_Handle sampleSensors; Error_Block eb; Error_init(&eb); /* Create 1 task with priority 1 */ Task_Params_init(&taskParams); taskParams.stackSize = 2048; taskParams.priority = 1; sampleSensors = Task_create((Task_FuncPtr)mainThread, &taskParams, &eb); if (sampleSensors == NULL) { System_abort("Task create failed"); } //call BIOS_start() enables interrupts and starts the scheduler with BIOS BIOS_start(); return (0); }
I was having a number of issues with undefined symbols so I needed up directly importing ff.h and SDFatFS.c/h into the project. This brought the number of undefines down to the following:
undefined first referenced symbol in file --------- ---------------- SDFatFS_config ./SDFatFS.obj SDFatFS_count ./SDFatFS.obj ff_cre_syncobj ./ff.obj ff_del_syncobj ./ff.obj ff_rel_grant ./ff.obj ff_req_grant ./ff.obj
Any ideas on how to deal with these undefined symbols?
Also, I get a warning saying that the handle for the FATfs is not being used despite having it set equal to SDFatFS_open(Board_SD0, SD_DRIVE_NUM).
Any help would be greatly appreciated,
Thanks