Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 16:11 02 May 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 : Geez...Things were going so well...

     Page 1 of 2    
Author Message
hitsware
Guru

Joined: 23/11/2012
Location: United States
Posts: 535
Posted: 09:34am 22 Aug 2014
Copy link to clipboard 
Print this post

...



When trying to SAVE:

1) Started getting intermittent 'SD card is write protected'

2) With ColorMaxiMite powered, pulled and reinserted SD card
( seemed to wipe all files )

3) Now see above pic ^

4) SD ruined ? ..... MaxiMite ruined ? .... Missing something simple ?
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2794
Posted: 11:05am 22 Aug 2014
Copy link to clipboard 
Print this post

As with any computer data, I take it you made a back-up! (I just had a bad experience similar to this so I can really sympathise with you!)

Hey, lets hope you weren't using one of those 'bargain priced' SD cards.

Can you try another SD card to see if your CMM has survived? Please do post more details no matter how 'frustrated' you must be right now

WW
For everything Micromite visit micromite.org

Direct Email: whitewizzard@micromite.o
 
hitsware
Guru

Joined: 23/11/2012
Location: United States
Posts: 535
Posted: 11:13am 22 Aug 2014
Copy link to clipboard 
Print this post

No backup but nothing too important ....

1) Read SD direct with SD to USB adaptor .... Files seemed intact

2) Reloaded MMBasic hexfile ...... All is well !
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2794
Posted: 11:15am 22 Aug 2014
Copy link to clipboard 
Print this post

So is it a faulty SD card? OR is it because you removed the SD card while the MM was powered?

Something not quite right

Glad all is well though . . .
For everything Micromite visit micromite.org

Direct Email: whitewizzard@micromite.o
 
cosmic frog
Senior Member

Joined: 09/02/2012
Location: United Kingdom
Posts: 278
Posted: 11:26am 22 Aug 2014
Copy link to clipboard 
Print this post

I used to get a similar problem all the time.
It turned out to be the keyboard of all things!


Dave.
 
hitsware
Guru

Joined: 23/11/2012
Location: United States
Posts: 535
Posted: 11:40am 22 Aug 2014
Copy link to clipboard 
Print this post

> So is it a faulty SD card?

Seems not.
The indication is that the MMBasic
someways became corrupted ....
(knock on wood )

 
hitsware
Guru

Joined: 23/11/2012
Location: United States
Posts: 535
Posted: 11:44am 22 Aug 2014
Copy link to clipboard 
Print this post

> It turned out to be the keyboard of all things!

LOL .... I've gone nuts trying to boot up with a key stuck down !
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9066
Posted: 04:55pm 22 Aug 2014
Copy link to clipboard 
Print this post

What is the general consensus around the forums here, with the removal and insertion of SD cards on the MaxiMite series of computers, while powered?

I thought I read somewhere that this was a no-no.
Even if you are not accessing the card.
My thoughts wander to images in my mind of MMBASIC keeping track of the files list or the directory info, and so removing the card and putting in another one will perhaps confuse the hell out of MMBASIC's filesystem handler?

...only speculation on my part - just thinking out loud, so to speak.
Smoke makes things work. When the smoke gets out, it stops!
 
hitsware
Guru

Joined: 23/11/2012
Location: United States
Posts: 535
Posted: 05:36pm 22 Aug 2014
Copy link to clipboard 
Print this post

It may have been a 'final straw' in my episode, but not the whole problem at all.
My first symtom was intermittent 'SD card write protected' when I'd try to save.
I couldn't find any referance to that in the manual. It happened more and more
until I couldn't save at all. After (in desperation) I pulled the card (with power
(not thinking straight)) came :

Anyways after reflashing the PIC everything's hunky dory ....
Begs the question : Things not to do to corrupt your chip ?
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9066
Posted: 06:30pm 22 Aug 2014
Copy link to clipboard 
Print this post

Very interesting indeed.
Smoke makes things work. When the smoke gets out, it stops!
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3165
Posted: 01:23pm 23 Aug 2014
Copy link to clipboard 
Print this post

  Grogster said   What is the general consensus around the forums here, with the removal and insertion of SD cards on the MaxiMite series of computers, while powered?

On the original Maximite and Colour Maximite you can swap the SD card without any ill effects because the SD card holder used in them provides a card-present signal to MMBasic which tells the interpreter to re initialise the filesystem driver if the card is removed.

The Duinomites don't have this signal but by using a trick MMBasic can still tell when a card has been swapped so they are OK also.

On Circuit Gizmo's boards I am not sure. From what I remember the original monochrome CGMMSTICK1 does not signal a card change so you have to cycle the power after a card change while the colour CGCOLORMAX2 does provide the signal and is OK.

All of this assumes that you do NOT remove the card while MMBasic is writing to the card or when files are open on the card. Both are no nos and will result in a corrupted file or filesystem.

Geoff
Geoff Graham - http://geoffg.net
 
raketenbuggy
Newbie

Joined: 08/02/2014
Location: Germany
Posts: 21
Posted: 11:52am 24 Aug 2014
Copy link to clipboard 
Print this post

Some days ago I had a similar problem:

Suddenly my AUTORUN.BAS didn't run on my TFT-Maximite at startup because my SD-card seemed to be empty. Plugged into a cardreader I got a "file system error" message. Further investigation showed, that the MBR was ok but there was a large block of zeros where the first FAT should have been, and the second FAT was badly demaged (the beginning was overwritten with zeros). Luckily the data area was ok, so with the help of some tools (PhotoRec and a hex-editor) I got all files back but it was a hell a lot of work!

I don't know what exactly happened, but I think I caused a brownout: I didn't use the reset button to restart the TFT-maximite, but instead I unplugged the power cable for a short time.
Afterwards I discovered that if you reconnect power at the right (or wrong) time, when the display isn't illuminated anymore but the capacitors on the board have some electrons left, the PIC may get into an undefined state where strange things can happen. Most of the time it won't startup properly or will freeze during startup, but I've also seen error messages that would normally show up on completely other occasions.

So the lessons for me:
1. Use the reset-button or wait long enough before reconnecting power.
2. Make a backup!

Michael
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9066
Posted: 01:19pm 24 Aug 2014
Copy link to clipboard 
Print this post

Yes indeed - SD card use has to be very seriously considdered in your system. In my case, I also have a big red reset button, but this is NOT connected to the PIC32 MCLR line, as random core resets could be disastrous for the files or filesystem on the SD card, as already indicated.

In my case, I use a nice easy way to find out what is going on - Set a flag whenever the file is opened(I just use SDFLAG=1 for file open, and SDFLAG=0 for file closed), then have my reset button on an I/O pin using an interrupt. If the "Reset" button is pressed, the interrupt checks if SDFLAG is 1 or 0, and if it is 1, the interrupt knows the file is opened, so it closes the file handle(it's always the same one for writing), then restarts the system with a RUN command.

I have played with that quite a bit, and I have never had a corrupted file or filesystem. It IS true, that you can, on occasion, have a truncated log-file, if "Reset" is pressed while the log-file is open for append when that button is pressed, but at least the file is safely closed first. I have not actually noticed any truncation either, as all my data to the log-file is in strings, so I would GUESS that if an interrupt tried to close the file in the middle of writing a string, that MMBASIC would finish writing that string before closing the file? Perhaps not. Perhaps I have just been lucky there with no missing messages in the log.Edited by Grogster 2014-08-25
Smoke makes things work. When the smoke gets out, it stops!
 
hitsware
Guru

Joined: 23/11/2012
Location: United States
Posts: 535
Posted: 08:48am 29 Aug 2014
Copy link to clipboard 
Print this post

I just found :

After boot if you use EDIT"xxx.bas" to open a file then F2 to run,
you get "SD card protected"

You must use LOAD"xxx.bas" then EDIT then F2 and it runs ...

That may have been some of my confusion (or not )
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9066
Posted: 03:13pm 29 Aug 2014
Copy link to clipboard 
Print this post

From MMBASIC manual, page 61:

  Quote  
If EDIT is used on its own it will edit the program memory. If 'filename' is supplied the file will be edited leaving the program memory untouched.


What I gather from this is, that F2 to run won't work, as using a filename with the EDIT command does not alter the existing program memory.

Might have that wrong though - just my guess.



Smoke makes things work. When the smoke gets out, it stops!
 
hitsware
Guru

Joined: 23/11/2012
Location: United States
Posts: 535
Posted: 04:05pm 29 Aug 2014
Copy link to clipboard 
Print this post


The 'SD card protected' might have been part of my keyboard problem ( since resolved )
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9066
Posted: 04:13pm 29 Aug 2014
Copy link to clipboard 
Print this post

I will try the same as you with one of my CMM units shortly....

You are sure that the write-protect tab thing on the SD card IS in the writable position? I know you have probably checked that, but just to be sure....

EDIT: I just tried this, and I have no such error - I would be wanting to check the SD card write-protect tab thing. If the tab is OK, try loading a program from the command prompt, then saving it again using SAVE and see what happens.

It is POSSIBLE that the write-protect switch on the SD card slot is broken or faulty.
Probably not that likely, but worth checking that.

EDIT: I suppose I should list my process:


LOAD ASC.BAT
RUN

EDIT
(F2)

NEW
EDIT ASC.BAT
(F2)


That all completes fine.

EDIT: OK, I can recreate your error exactly:


EDIT ASC.BAT
(F2)

Error: SDcard is write protected


I did this, by moving the tab on the SD card to LOCK(write-protected).

So, assuming that you DON'T have the SD card tab in the LOCK position, but are still getting this error, then there may be an issue with the switch on the SD card holder that senses if the tab on the SD card is moved or not.Edited by Grogster 2014-08-31
Smoke makes things work. When the smoke gets out, it stops!
 
hitsware
Guru

Joined: 23/11/2012
Location: United States
Posts: 535
Posted: 04:23pm 29 Aug 2014
Copy link to clipboard 
Print this post

It must be ...... It's working now ......

The whole fiasco was evedently the keyboard ......
And I bought 4 of them for a 'lifetime supply '
Oh well ..... they work fine on a PC .....
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9066
Posted: 04:06pm 30 Aug 2014
Copy link to clipboard 
Print this post

Well then - perhaps the $20 keyboard is not such a mad idea after all. I retract my comments about it's price. I would therefore assume, that the $20 KB is just plain old PS2 KB with NO extra functions or support for any multimedia keys etc. Perhaps those multimedia keyboards are a cause for concern on the MM.

Out of interest, the KB's you bought that did not work - were they multimedia ones with extra keys on them?
Smoke makes things work. When the smoke gets out, it stops!
 
hitsware
Guru

Joined: 23/11/2012
Location: United States
Posts: 535
Posted: 04:32pm 30 Aug 2014
Copy link to clipboard 
Print this post

NO !

It' made by the Stamp Outfit for Propellar et. al ..........

Actually has a disclaimer against being anything else ...
 
     Page 1 of 2    
Print this page
© JAQ Software 2024