Skip to main content
Arduino

Timeline for Nano V3 values "overwritten" randomly

Current License: CC BY-SA 4.0

19 events
when toggle format what by license comment
Nov 18, 2018 at 15:03 history bumped Community Bot This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Oct 19, 2018 at 14:27 answer added hoekbrwr timeline score: 1
Oct 19, 2018 at 8:02 comment added Greenonline Comments are not recommended for any of the following: Answering a question or providing an alternate solution to an existing answer; instead, post an actual answer (or edit to expand an existing one);. Feel free to post an answer instead. Thanks.
Oct 18, 2018 at 19:52 comment added sempaiscuba @hoekbrwr You might want to post that as an answer, rather than a comment.
Oct 18, 2018 at 18:45 review Close votes
Oct 21, 2018 at 19:00
Oct 18, 2018 at 10:54 comment added hoekbrwr I found the problem. I could see that the false value is the character code of the minute I am displaying. I display hours and minutes and there was a declaration that was 3 characters short for the string I got as a result for hours added to minutes. Yes it was memory corruption. So be careful to dimension enough places for your strings including 1 extra for 0.
Oct 18, 2018 at 10:14 comment added Edgar Bonet If your program corrupts memory (which seems to be the case here), the part of the code that misbehaves can be quite far from the part that does the memory corruption. There is nothing wrong with the code you are showing here. Your problem lies in some part of the code you are not showing. Nobody will be able to help you without seeing the bug.
S Oct 17, 2018 at 19:12 history suggested jsotola CC BY-SA 4.0
added comment info and reformatted
Oct 17, 2018 at 18:10 review Suggested edits
S Oct 17, 2018 at 19:12
Oct 17, 2018 at 15:27 comment added hoekbrwr As I already said, it is 21k of code. But I show you the part of the code that mishaves: <code> while ((digitalRead(rotSwPin) == 0) && lpress <= 200) { delay(10);lpress++; if (lpress > 200) {menuActive++;menuLvl=0;menuPos=0;subPos=0;} } </code> Normally I use menuActive=1. Within the braces, it is still 1, out of that it changes. Maybe change from byte to bool.
Oct 17, 2018 at 15:12 comment added hoekbrwr Thanks for your suggestions, but I checked those things already carefully. I think of stepping to Eclipse for this Arduino project and find out more by debugging?
Oct 17, 2018 at 15:10 comment added Juraj or show your code and someone spots the problem
Oct 17, 2018 at 15:08 comment added Majenko Given the range of numbers it gives you, chances are it's a char array into which you are printing numbers, maybe with punctuation like brackets.
Oct 17, 2018 at 15:06 comment added Majenko You can't unless you generate a "map" file, for which you need to modify the compiler options in the IDE configuration files. Examine your code for any arrays that you use and make sure you don't try and use more than you should. One common misuse is to declare int foo[10] and then try and use foo[10] as a slice.
Oct 17, 2018 at 15:04 comment added hoekbrwr Agreed! But where can I find the memory assignment in a file/list to grab an idea which variable does the overwriting?
Oct 17, 2018 at 14:45 history edited hoekbrwr CC BY-SA 4.0
added 34 characters in body
Oct 17, 2018 at 14:45 review First posts
Oct 17, 2018 at 15:26
Oct 17, 2018 at 14:44 comment added Majenko Sounds like a buffer overflow to me.
Oct 17, 2018 at 14:44 history asked hoekbrwr CC BY-SA 4.0
toggle format

AltStyle によって変換されたページ (->オリジナル) /