Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 7 months ago.
Downloaded the MSC file system to sample and log data through the usb port Compiler Error L6647E
I have downloaded the MSC file system library for use in sampling and logging data through the usb port to a micro sd but keep getting Compiler Error L6647E The Ticker or the file opening are not interfering, please help I believe it to be some possible clash of files in the MSC library
Thanks
#include "mbed.h" #include "xbee.h" //xbee library #include "C12832_lcd.h" //new applications board library #include "MSCFileSystem.h" MSCFileSystem fs("fs"); C12832_LCD lcd; //initialise lcd screen xbee xbee1(p9,p10,p11); //Initalise xbee_lib Serial pc(USBTX, USBRX); //Initalise PC serial comms void returnSomeData(); void clearBuf(char *p); void tickFn(void); int flag=0; Ticker t; int cnt=0; void tickFn(void) { flag=1; cnt++; } int main() { t.attach(&tickFn,5); FILE *fp = fopen("/fs/test.csv","w"); printf("Create filehandle for test.csv\n"); while(1) { char read_data[202]; clearBuf(read_data); xbee1.RecieveData(read_data, 0); //Read data from the XBee lcd.cls(); printf("Bytes received is: %i\n",strlen(read_data)); lcd.printf("Value Received: %s \n",read_data); printf("Value Received: %s \n",read_data); memset(&read_data[0], 0, sizeof(read_data)); if (flag==1) { printf("Writing data\n"); flag=0; for(int i=0;i<4;i++) fputc(read_data[i],fp); } if (cnt==20){ printf("data sorted\n"); fclose(fp); cnt=0; } } } void clearBuf(char *p) { for (int i=0;i<202;i++)*p++='\0'; }
Question relating to:
1 Answer
10 years, 7 months ago.
First of all, it is handy to copy paste the complete compiler error, I don't know the numbers myself ;).
Then, are you using a micro-SD card, which is connected via SPI, or a USB flash drive, which is connected via D+ and D-? For sure MSCFileSystem is old, if it is a USB flash drive, use: http://mbed.org/handbook/USBHostMSD. If it is an SD card, use SDFileSystem.
yea, sorry about that, bit of a noob.. Thanks for replying, I am using a micro sd card into the usb connection on the cool applications board. the overall project is reading an analog voltage through a pin input and logging the data to the micro usb inside the usb stick. I will download the USBHostMSD library when I can get around to It tomorrow and test it within my code. Il post back as soon as I have it tested. Thanks again Erik
posted by 10 Apr 2014