Problem writing to sd card

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
Emanuel Lourenco
Posts: 63
Joined: Mon Dec 23, 2013 5:51 pm
Been thanked: 8 times
Contact:

Problem writing to sd card

Post by Emanuel Lourenco »

hi,

I'm here with a problem and do not know what could be.
I have a code to save 20 temperature probes for sd card.
But when I open the records from the recording appear esquecitos characters.
If any can help me grateful.

Thank you
Attachments
1_3.txt
registration
(9.21 KiB) Downloaded 216 times
RTD_DataLogger_V1.15.fcfx
(139.51 KiB) Downloaded 238 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Problem writing to sd card

Post by Benj »

Hello,

I think the problem may be down to your program structure.

A typical program will have a while 1 loop in the main which loops forever and calls the functions.

In your program the structure looks to be like this as one possible option.

Main -> Menu -> Registar -> FileName -> Menu -> Registar -> FileName -> Menu -> Registar -> FileName -> Menu -> Registar -> FileName -> Menu -> .......

As you can see we have re-entered the Menu macro and this will likely corrupt the first instance (if we ever get back to it). Best case scenario the stack will eventually fall over and then things get a bit unpredictable.

I would see if you can re-arrange your code so that it is called from a loop in the Main, maybe using variables to keep track of what your doing in the loop.

Emanuel Lourenco
Posts: 63
Joined: Mon Dec 23, 2013 5:51 pm
Been thanked: 8 times
Contact:

Re: Problem writing to sd card

Post by Emanuel Lourenco »

Hi Benj

I made a program with only the part that is giving me problems, is much simpler.
But I still with the problem.

If I am able to help thanked
Attachments
RTD_DataLogger_V1.15_main.fcfx
(72.36 KiB) Downloaded 245 times
oi.txt
(78.87 KiB) Downloaded 220 times

Emanuel Lourenco
Posts: 63
Joined: Mon Dec 23, 2013 5:51 pm
Been thanked: 8 times
Contact:

Re: Problem writing to sd card

Post by Emanuel Lourenco »

hi,

I noticed that with several program to see my records, they never show the same mistakes.

Which program do you use to be records?

best regards

Emanuel Lourenco
Posts: 63
Joined: Mon Dec 23, 2013 5:51 pm
Been thanked: 8 times
Contact:

Re: Problem writing to sd card

Post by Emanuel Lourenco »

Hi
After all is not the open log file program. I'm desperate. can help?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Problem writing to sd card

Post by Benj »

Hello,

I've had a go at simplifying your program so you don't need as many variables etc. I'm not sure why you're getting the corruption but hopefully this should make it easier to see what's going on.

I have reduced the sensor count from 20 to 5 temporarily so we can quickly and easily change bits of the code without having to do it 20 times to see if it works.

I have reduced the append function down to a single cycle per loop and this should hopefully greatly reduce the comms to the card and hopefully also reduce the chance of the error.
RTD_DataLogger_V1.15_main-1.fcfx
(27.37 KiB) Downloaded 262 times
Have a go and let me know how you get on.

Emanuel Lourenco
Posts: 63
Joined: Mon Dec 23, 2013 5:51 pm
Been thanked: 8 times
Contact:

Re: Problem writing to sd card

Post by Emanuel Lourenco »

hi benj

Thanks for the reply
I put your code to work and had the same problem.
I leave the file to view

best regards
Attachments
oi.txt
(310.85 KiB) Downloaded 224 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Problem writing to sd card

Post by Benj »

Hello,

Is it the simulation or embedded code that is creating the log files with issues your posting? Looks like there is a bug lurking here somewhere.

Emanuel Lourenco
Posts: 63
Joined: Mon Dec 23, 2013 5:51 pm
Been thanked: 8 times
Contact:

Re: Problem writing to sd card

Post by Emanuel Lourenco »

Hello benj,
The file I posted is what gave me when your post code on my hardware

Emanuel Lourenco
Posts: 63
Joined: Mon Dec 23, 2013 5:51 pm
Been thanked: 8 times
Contact:

Re: Problem writing to sd card

Post by Emanuel Lourenco »

Hello

I'm back to my project.
But still no progress.
I leave the record of my memory card.
490 490 records in practically the value gets spoiled.
Does not detect a change lines.
What could it be?
File in Excel

greetings
Attachments
RTD_DataLogger_V1.15_main-1.fcfx
(27.38 KiB) Downloaded 231 times
oi.xls
(205 KiB) Downloaded 202 times

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Has thanked: 49 times
Been thanked: 101 times
Contact:

Re: Problem writing to sd card

Post by hyperion007 »

Hi,

Can you please try this modified file and let us know if or how it worked.

/Daniel S
RTD_DataLogger_V1.15_main-1.fcfx
(29.99 KiB) Downloaded 243 times

Emanuel Lourenco
Posts: 63
Joined: Mon Dec 23, 2013 5:51 pm
Been thanked: 8 times
Contact:

Re: Problem writing to sd card

Post by Emanuel Lourenco »

good Morning

It does not work. Gives the same error

Any more suggestions?

greetings

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Has thanked: 49 times
Been thanked: 101 times
Contact:

Re: Problem writing to sd card

Post by hyperion007 »

It still says that the file I provided hasn't been downloaded yet so how have you been able to test it?

edit: I just downloaded the file I provided and it instantly says it's been downloaded 1 time. I just wanted to make sure the information was accurate.

Emanuel Lourenco
Posts: 63
Joined: Mon Dec 23, 2013 5:51 pm
Been thanked: 8 times
Contact:

Re: Problem writing to sd card

Post by Emanuel Lourenco »

hyperion007 wrote:It still says that the file I provided hasn't been downloaded yet so how have you been able to test it?

edit: I just downloaded the file I provided and it instantly says it's been downloaded 1 time. I just wanted to make sure the information was accurate.
In his commentary is a file. I test this file. If you can post again thanked.

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Has thanked: 49 times
Been thanked: 101 times
Contact:

Re: Problem writing to sd card

Post by hyperion007 »

Sorry but I don't understand what you just said.

I have attached a file, which you have not downloaded...
hyperion007 wrote:Hi,

Can you please try this modified file and let us know if or how it worked.

/Daniel S
RTD_DataLogger_V1.15_main-1.fcfx

Emanuel Lourenco
Posts: 63
Joined: Mon Dec 23, 2013 5:51 pm
Been thanked: 8 times
Contact:

Re: Problem writing to sd card

Post by Emanuel Lourenco »

Hello
The file does not work. He just writes a record of each probe

Emanuel Lourenco
Posts: 63
Joined: Mon Dec 23, 2013 5:51 pm
Been thanked: 8 times
Contact:

Re: Problem writing to sd card

Post by Emanuel Lourenco »

Good afternoon,

Any other opinion? I am desperate.
Does the configuration of DSPIC or perhaps viewing program records?
Attached leave the system I am using
Can I get help?
Attachments
ujet32_plus_manual.pdf
(3.23 MiB) Downloaded 152 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Problem writing to sd card

Post by Benj »

Hello,

Looks like a nice little board, do the manufacturers know of any potential problems with the hardware?

Have you tried more than one card? Also have you tried formatting the card? I've received flash based devices before from sources like eBay and they are essentially fake but look the real deal until you try and store data.
490 490 records in practically the value gets spoiled.
Not sure what you mean by this.

Is there a pattern at all you can see to what is going wrong?

Have you tried reducing the number of sensors to 1 and seeing if you can get this to work reliably?

Post Reply