This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430F6776A: text not printing onto file

Part Number: MSP430F6776A


Tool/software:

I am very new to using code composer studio and embedded programming as a whole, so apologies if I am not fully informed of everything.
I am trying to take outputted sensor data and append the data to a file, which I will pass into another script for graphing onto a histogram for data analysis
I have been trying to get a simple hello world text to print onto a file which I took from a TI guide for file troubleshooting. This is the part of the code that is specifically being used to write to a file: 

FILE *fid;
fid = fopen("myfile.txt", "w");
fprintf(fid, "Hello, world\n");
fclose(fid);
printf("Hello again, world\n");

For some reason, on ccs 20, I don't see any file showing up in the debug folder. I downloaded ccs 12 to test this out, which showed a myfile.txt in the debug folder, but when I checked the contents of it, it was empty. I have my stack and heap sizes both changed to 512, and I also have printf enabled, which, printf is printing to my console just fine. I've also looked over the https://software-dl.ti.com/ccs/esd/documents/sdto_cgt_tips_for_using_printf.html#Getting_C_I.2FO_working_.2F_Troubleshooting tips for using printf article to try and find information, but I couldn't find anything that seemed to fix this issue. and I've tried using fwrite in place of fprintf, but this threw a compiler error. I also do have #include <stdio.h> in my code, and other parts of my code, like the parts that read sensor data, work with no issues. Does anyone have other suggestions/ a better approach to my problem? 

  • Yea it would be hard to troubleshoot with without more details. Can you provide an example project similar to the one you have with the same implementations you are currently using? Another option, maybe not as elegant, would be to transfer the data via UART and use something like tera term to log the data into a text file. 

**Attention** This is a public forum