Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 19:26 29 Apr 2024 Privacy Policy
Jump to

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 : VAR SAVE bug Micromite II 4.6 B20

Author Message
jimbotron
Regular Member

Joined: 27/11/2013
Location: Australia
Posts: 46
Posted: 04:41am 14 Nov 2014
Copy link to clipboard 
Print this post

Hi fellow Micromite testers,
I was giving the VAR SAVE and Restore functions a good testing and found 2 problems.
The first one is minor the second requires reprogramming the firmware.

'Saved Variables Test

watchdog off
S$ = string$(200,"X")
S1$ = "1"+S$
S2$ = "2"+S$
S3$ = "3"+S$
S4$ = "4"+S$
S5$ = "5"+S$
S6$ = "6"+S$
S7$ = "7"+S$
S8$ = "8"+S$
S9$ = "9"+S$
S10$ = "10"+S$


VAR Save S1$, S2$, S3$, S4$, S5$, S6$, S7$, S8$, S9$
Memory

'Don't run the next line unless you have your Pickit ready.
'VAR Save S1$, S2$, S3$, S4$, S5$, S6$, S7$, S8$, S9$, S10$
'Memory


This was a test to confirm that there we could save 2K of flash storage. So the I made some longish strings to save.
If I run the above program, I get the following output which displays the incorrect percentage of flash used. Also it would be more useful to see variable storage in bytes.
> RUN
Flash:
0K ( 0%) Program (21 lines)
2K ( 0%) 9 Saved Variables
58K (100%) Free

RAM:
3K ( 6%) 11 Variables
0K ( 0%) General
50K (94%) Free


To test second bug un-comment last 2 lines, but be warned it could get nasty. Here an extra string variable S10$ has been added to overfill the flash variable storage. Once this runs the chip will send a never ending stream of nulls (hex 00).

The normal method of restoring the device by shorting the serial pins does not seem to work. The only way I could recover was to reflash the firmware.

It only seems to be a problem if you try to save way to much data. If you go just over the limit you will get a nice message telling you the flash is full.

I've tried this with 2 chips and get the same result.

One little bonus "bug". I noticed that if you specify the same variable multiple times it gets stored multiple times. Though I can't see how this would ever be a problem.

'The following would brick the chip as well.
VAR Save S1$, S1$, S1$, S1$, S1$, S1$, S1$, S1$, S1$, S1$


Jimmy
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3165
Posted: 12:49pm 14 Nov 2014
Copy link to clipboard 
Print this post

Good find, thanks very much. I will chase the bug down.

I debated with myself over displaying the memory consumption in bytes or KB and ended up choosing KB because it matched the program storage display but I agree,bytes would be much more useful.

Geoff
Geoff Graham - http://geoffg.net
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9063
Posted: 02:23pm 14 Nov 2014
Copy link to clipboard 
Print this post

My 2c on KB vs bytes - Bytes wins. This only jives with relatively small areas of space to work in. If you have 100MB of space, reporting in bytes seems a little silly, for example.

However, with a maximum of 2000 bytes to play with, a four-digit bytes usage figure makes more sence to me - but that is just me, and my 2c........

@ jimbotron - You're quite the Beta tester, aren't you! (rhetorical)

I think your nickname should be: "The bug bounty-hunter."
Keep on actively tracking those bugs - nice work.
Smoke makes things work. When the smoke gets out, it stops!
 
jimbotron
Regular Member

Joined: 27/11/2013
Location: Australia
Posts: 46
Posted: 09:07pm 14 Nov 2014
Copy link to clipboard 
Print this post

I understand the dilemma Geoff,
The current display looks neat and tidy.

Thanks for the encouragement Grogster. I might have to add that to my job description at work.

Jimmy
 
jimbotron
Regular Member

Joined: 27/11/2013
Location: Australia
Posts: 46
Posted: 02:20am 17 Nov 2014
Copy link to clipboard 
Print this post

For the benefit of anyone reading this thread. I have confirmed that these problems are fixed as of Micromite Mark II version 4.6 beta 21. The percentage usage is now correctly displayed and overflowing the SAVE VAR command no longer corrupts the chip. Usage is still displayed in K rather than bytes, but that is a minor issue that I'm sure Geoff is mulling over.

Jimmy
 
jimbotron
Regular Member

Joined: 27/11/2013
Location: Australia
Posts: 46
Posted: 11:38am 24 Nov 2014
Copy link to clipboard 
Print this post

Just tested uMite II 4.6 beta 23
The memory usage display issue has also been addressed:
> a$ = "Hello Worlrd"
> var save a$
> memory
Flash:
0K ( 0%) Program (0 lines)
0K ( 0%) 1 Saved Variable (17 bytes)
60K (100%) Free

RAM:
0K ( 0%) 1 Variable
0K ( 0%) General
53K (100%) Free

Nice bit of design work Geoff. You managed to display the information we needed and still kept the output looking tidy. It's nice to see workmanship still counts in the digital world.

JimmyEdited by jimbotron 2014-11-25
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024