saving a light weight log to an sdcard

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

saving a light weight log to an sdcard

521 Views
georgejoseph
Contributor III

Once you have created the log and filled it with data, and you want to periodically save this data to an sdcard, do you have to read each entry in the log and save individually or can you save the entire log to a file? The training video mentions that you can save to USB. What command is available? fprintf?

0 Kudos
3 Replies

390 Views
georgejoseph
Contributor III

Yes Daniel I am using MQX.

0 Kudos

390 Views
danielchen
NXP TechSupport
NXP TechSupport

I think you need to read each entry with _log_read, and save it individually.

You can use the following command to save it to USB .

MQX_FILE_PTR      log_fp;

log_fp = fopen(LOG_FILE,"a");

write(log_fp, XX, strlen(XX));

 fclose(log_fp);

Regards

Daniel

0 Kudos

390 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Jeorge Joseph:

Can you detail your question a little bit more? Do you use MQX or other RTOS?

Regards

Daniel

0 Kudos