Pages: 1 [2]   Go Down
Author Topic: Program corruption? Inconsistent and odd failures mid-program  (Read 2238 times)
0 Members and 1 Guest are viewing this topic.
Fort Lauderdale, FL
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6144
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Every single print action(even moving the cursor), repeated or otherwise, consumes more RAM that it never frees up again.

How are you determining that?  You might be working with a flawed test (or flawed assumption).
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.c

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I was using the memory test library from this page, and testing the memory after every print action. The amount of memory consumed was consistent with the number of characters in the string, and the failure rate was also consistent with my previous testing of the problem. So at this point I'm fairly confident that the problem is the RAM not being freed up after being used to print a string. I'll keep combing my code, but if anyone has any experience with this, it would be really helpful.
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 303
Posts: 26354
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
o at this point I'm fairly confident that the problem is the RAM not being freed up after being used to print a string.
What memory would the "print" methods use, other than the supplied buffer to be printed and stack?
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm not entirely sure, as they're functions provided by the GLCD library, something which I'm also digging through, although I'm not sure that's the source of the problem, since I've made multiple programs using it, even ones that are very string heavy, and this has never been a problem before. I'll try to find the relevant functions in the library and post them here.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I moved all my strings to RAM using "GLCD.printFlash(flashStr("string"));" as per the suggestion of the GLCD library author, and while it freed up a few hundred bytes, it didn't change the problem. The program is still consuming large amounts of RAM every time there is a print action, and never freeing it up later. I'm clueless as to what the problem could be at this point.
Logged

Pages: 1 [2]   Go Up
Jump to: