![]() |
Forum Index : Microcontroller and PC projects : A Micromite feature request
Author | Message | ||||
Seco Newbie ![]() Joined: 20/03/2019 Location: AustraliaPosts: 5 |
Hi All. I would like to put forward a feature request for consideration. When an embedded program crashes, and the watchdog timer restarts the program, it would be great if not only the mm.watchdog variable is set, but additional variable(s) that contain the line number, error number and error message associated with the crash are populated (if there is no crash and we just have a watchdog timer expiry then the variables could report this - as well as the line number executing at the time). This would make it very easy to write errors to the SDCARD (or similar) to be reviewed at a later time and hopefully fixes implemented. Regards Gerard |
||||
lizby Guru ![]() Joined: 17/05/2016 Location: United StatesPosts: 3378 |
I haven't tried it, but I wonder if you could do some of what you want with flags and the "TRACE LIST nn" command (the problem being that I don't know how you can capture the output of TRACE LIST so that you could send it to the SDCARD rather than just to the console--or whether a watchdog reset also resets the TRACE LIST ring buffer). Some experimenting might be in order. Access to the TRACE LIST ring buffer would be helpful in the situation you describe, perhaps in the form of an mm.traceArray() array variable. PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
Seco Newbie ![]() Joined: 20/03/2019 Location: AustraliaPosts: 5 |
Hi. Unfortunately a quick test program shows that the TRACE LIST "ring buffer" is reset when the watchdog reset occurs... And as you mentioned, how could you capture the output so it can be logged to a SDCard? Regards Gerard |
||||
Andrew_G Guru ![]() Joined: 18/10/2016 Location: AustraliaPosts: 871 |
Hi Seco, I'm interested in a solution here too as I've been chasing a problem with my remote weather station for months. Without some sort of remote recording I can't see how a watchdoged MM can report the details of its own demise, eg to an SD, except by being connected to a console and reporting lots of data until it stops? - please correct me if I'm wrong. Andrew (My remote goes for weeks/days then (randomly?) just watchdogs continuously (Autorun is ON). It is on my HC-12 network so in an effort to track the problem I have my base station recording (to an SD card and PC) all sorts of data but so far no clue as to what is causing it. When I bring it indoors to my console it behaves flawlessly . . . AND no; it is no longer, ants, moisture, temperature, low voltage . . . ) A |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
A perfect use for EERAM like the 47C16. I love them. https://www.thebackshed.com/forum/forum_posts.asp?TID=11033&KW=47c16 Using one in my weather station. 2k of unlimited writes with automatic backup. Jim VK7JH MMedit |
||||
Andrew_G Guru ![]() Joined: 18/10/2016 Location: AustraliaPosts: 871 |
Hi Jim, Thanks for that - I'll read fully and I'm sure Ill need to ask for more help . . . Cheers, Andrew (I'm in the process of carting the remote inside for one more try) |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3292 |
There is never one line that will cause the watchdog timer to time out. However, retaining the trace memory is a possibility and that would provide a clue as to what caused the timeout. I will look into it. Geoff Graham - http://geoffg.net |
||||
Andrew_G Guru ![]() Joined: 18/10/2016 Location: AustraliaPosts: 871 |
Thanks Geoff - you're a marvel. A |
||||
Seco Newbie ![]() Joined: 20/03/2019 Location: AustraliaPosts: 5 |
Hi All. As there are effectively 2 reasons the watchdog reset can occur: 1) looping, waiting or paused code and the timer expires 2) the code crashes (syntax or run time error), the watchdog timer expires For the first case, the trace memory would potentially be very useful. For the second case, the ability to see the line number of the code that crashed (possibly from the trace memory), as well as the errno/errmsg of the crash (perhaps the mm.errno and mm.errmsg values could be copied to a pair of read only variables that are set by the watchdog reset routine) would be very useful. I have some very large embedded programs (nearly consuming all available flash memory on the MM+) with multiple interrupt driven com ports and interrupt timers etc, and diagnosing an infrequent failure can be rather difficult as I cannot have a PC connected all the time... Regards Gerard |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |