Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : Strange error message
Author | Message | ||||
busa Regular Member Joined: 12/02/2015 Location: AustraliaPosts: 81 |
For the last two days I have been trying to track down an error message that suddenly appeared in a program that has been running for months on the Micromite backpack. The program in question is a clock, calendar that also reads the temperature and humidity from a DHT22 sensor. The high and low values from that sensor are saved by the VAR SAVE command along with the date and time the readings occured. In the event of a power failure I don't lose those readings. There are four VAR SAVE commands in the program each saving three variables. If I commented out the last VAR SAVE command everything worked ok but uncomment it and the error message I got was: "CPU exception #7 (bus error on load or store) at address 0x9D02F13F Processor restarted" Followed by "[27] VAR restore Error: Invalid variable name" After much head scratching and hair pulling I was finally able to track it down. The MX170 chip had gone flakey. After replacing and reprogramming with a new one everything works as it should. I know that the flash memory on these chips has a finite number of read and writes but the amount I was writing to flash was tiny. Sometimes weeks could pass with nothing new saved. Just my bad luck I guess. Anyway, that's my horror story. Hopefully it can help others out there that may have a similar error. |
||||
twofingers Guru Joined: 02/06/2014 Location: GermanyPosts: 1139 |
How many VAR SAVE operations per week do you estimate? |
||||
busa Regular Member Joined: 12/02/2015 Location: AustraliaPosts: 81 |
Hard to say but I know the last VAR SAVE operation when I checked a day or so ago was on 23rd December so nothing has been saved this year. I am in the process of changing my code to make a VAR SAVE operation once a day at midnight, that way I can be sure the flash memory won't quickly wear out. |
||||
twofingers Guru Joined: 02/06/2014 Location: GermanyPosts: 1139 |
No, I think once a day should be okay! I was afraid you did it once a minute or more. |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3167 |
Interesting tale. It does sound as if you have a flaky chip - very unusual. Geoff Geoff Graham - http://geoffg.net |
||||
CaptainBoing Guru Joined: 07/09/2016 Location: United KingdomPosts: 1993 |
it does happen. Not often but it does happen... A while back I drove GeoffG mad with a thread of mails that showed errors in the flow of a prog using local variables in a for/next loop - and it was a really silly fail , getting locked in a loop with the counter variable obviously not decrementing (STEP-1)... I could make it fail on cue but Geoff could not. I wasn't even touching the flash or doing anything exotic in that instance. In exasperation, I re-flashed the MM in question and everything went back to working as it should, to this day it is a mystery how it got corrupted. I have learnt that whenever really weird stuff starts happening - especially like in your situation where something has been working and then mysteriously starts playing up, I flash the MM as one of my first efforts. I appreciate this might not always be convenient. It's computers right? They are binary devices and always behave in a predictable manner - heh, yeah right! |
||||
busa Regular Member Joined: 12/02/2015 Location: AustraliaPosts: 81 |
Yes it sure had me scratching my head for a while. It was only in desperation that I changed to a new MX170 chip and reflashed it after I had changed all my other hardware and checked and rechecked solder joints etc trying to track it down. All's well that ends well though. |
||||
Print this page |