USBBL001 Problem writing in two lines

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hi,

I just tried the example project "USBBL001_USBMS001_Example1" and it works fine. I get the folder, the file and the string. I tried to add some words in a second line like this:

f_printf( &fp,"Hello World \nHello World");

I also tried:

f_printf( &fp,"Hello World");
f_printf( &fp,"\nHello World");

If I compile this in Dev C++ (c-file) and run it (with additional code) the result is correct:

Hello World
Hello World


In the ReadMe.txt created by the µC it I only see

Hello World Hello World

How can I get things written in two or more lines?

I want to use this example to write an array with 500x4 values to use in Excel later. Am I on the right way or is there an easier one?

Thanks for Help!
MTR

PS: How can I mark the code-segments in the forum better?
0 Likes
7 Replies
Not applicable
Hello,

I write again, because I haven't found a solution yet. In the first part of the project it wasn't necessary to write on a SD-Card but this time I have to store some results.

My problem is, that I want to use Excel to visualize my data. The import doesn't work fine without new lines, so I ask again, how I can write in a new line.

In a later application, I want to store the conversion results of two ADCs. Is there something I have to take care of?

Thank you for your help.
Best regards,
MTR
0 Likes
Not applicable
Hi Manuel,

This has been forwarded to our colleague. He will try to look into it and give some suggestions if any.

Best regards,
Sophia
0 Likes
Not applicable
Hi MTR,

In order to use '\n' as carriage return, you need to set the 'String Func Configuration' in FATFS002 to '2'.
Then regenerate the code and build your project again.
434.attach
0 Likes
Not applicable
Hi Jackson,

thank you very much for your help. It works fine.

Best regards,
MTR
0 Likes
Not applicable
Hi MTR,

I read your dialog in some topics here about the how write the SDcard.
I am looking for any solution to write in SDcard, I really need only to create a file .txt and manipulate it into my SDcard.
I tried some examples, but I am using the kit XMC4500 and I think it does not work for this board.
Is possible to me explain me which example can I use?

Kind Regards,
Bruno Fernandes.
0 Likes
Not applicable
Hi Bruno,

Perhaps you can take a look on FATF003_Example1/2 under "File System" category.

BR,
Zain
0 Likes
Not applicable
Hi Bruno,

I posted this on a different thread, but it is my solution for your problem:

I tried the USBBL001_USBMS001_Example 1 and did some modifications:

main.c:
Line 133: f_chdrive (0) //instead of 1
Line 136: DResult = f_mount(0, &myfsObject); //instead of 1

because the SD is configurated as drive 0 in FATFS004_0 App.

I hope it works for you, too!
Regards,
MTR
0 Likes