Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 02:10 17 Jul 2025 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 : Program Erased

     Page 1 of 3    
Author Message
srnet
Senior Member

Joined: 08/08/2014
Location: United Kingdom
Posts: 164
Posted: 05:50am 20 Mar 2015
Copy link to clipboard 
Print this post

While testing the power options for the LoRa receiver (see other thread) the receiver program erased itself.

At the time the FTDI adapter was not connected, there was a pullup resistor of Console TX output but Console RX was open circuit.

Whilst there should maybe of been a pullup on Console RX, self erasure of the program is not good, you may not have a PC handy to re-program the MicroMite.

Would it be possible to remove the MMBasic reset facility completly ?

I understand its there to recover from a lost PIN situation, but I would rather sacrifice that facilty if you could be sure the program will not erase itself.
$50SAT is Silent but probably still working.
For information on LoRa visit http://www.loratracker.uk/

 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9594
Posted: 09:29pm 20 Mar 2015
Copy link to clipboard 
Print this post

Has this happened to you before?

I hear some people have been having this false-erase situation.

It has never happened to me - yet.


Smoke makes things work. When the smoke gets out, it stops!
 
srnet
Senior Member

Joined: 08/08/2014
Location: United Kingdom
Posts: 164
Posted: 09:45pm 20 Mar 2015
Copy link to clipboard 
Print this post

First time, although I have only been using the Micromite for a month or so.
$50SAT is Silent but probably still working.
For information on LoRa visit http://www.loratracker.uk/

 
srnet
Senior Member

Joined: 08/08/2014
Location: United Kingdom
Posts: 164
Posted: 08:41pm 30 Apr 2015
Copy link to clipboard 
Print this post

My program erased itself again.

I was investigating why my PCF8563 RTC was using around 150uA in backup mode, cutting pins, removing components etc. When I powered the circuit back up my program was gone.

There is an openlog on the Console TX, and the openlog has a 4k7 pull up on it to ensure a clean start. There is nothing on Console RX apart from the FTDI adapter.

Would it be possible to have an option to disable this emergency erase feature ?

$50SAT is Silent but probably still working.
For information on LoRa visit http://www.loratracker.uk/

 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 1000
Posted: 09:17pm 30 Apr 2015
Copy link to clipboard 
Print this post

I have had the program erased on my MMII based on Mick's MUP a few times when fiddling with power supply. Again on recent power outages. I can even sort of reproduce it by flicking 240v power switch to the plug pack off and on a the right interval, so power to MMII just fades but not fully gone.(The console was not connected)
I added the MCP130T-315I/TT supervisory chip (as used on the SkinnyMite) to control the reset on brownouts and have not been able to reproduce the erasure as yet.

Regards
Gerry
Latest F4 Latest H7 FotS
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9594
Posted: 09:20pm 30 Apr 2015
Copy link to clipboard 
Print this post

Interesting.

Any other members seeing this in their MM chips as of now?
I know there was talk of this a while back, but up until now, that subject seemed to have gone, so...

PERSONALLY, I think that the default settings thing should be dropped.
This is ONLY my 2c - make of that what you will.

My reasons for this are:

1) Occasional reports like this one - it's not a good thing to have spontaneous erasure of the code within the MM, if the MM seems to think that the TXD and RXD pins are shorted at power-up(even if they are not).

2) In the event that you set the console baud-rate to something unknown, or set a PIN number and then forget it, it would be a better idea to have the chip simply locked like that, and to fix it, you have to reflash the MMBASIC firmware into it.

As has been mentioned by many members here now, PICkit-3 clones are very affordable now(less then $50), and with that, you can program the chip with the MMBASIC firmware and not need to rely on never tripping up the pre-programmed firmware.

Using MPLAB-X instead of the IPE, once you have perfected your code and everything is running the way you want, you can then use MPLAB to suck the entire code from the chip into a file - MMBASIC and your running code as one file. You can then re-flash the chip with THAT hex file, and it restores both MMBASIC and your running code in one whack. This is the way I prefer to do things with more permanent projects.

...but again, this is only my 2c opinion, so.........

EDIT:

  Disco4Now said  I added the MCP130T-315I/TT supervisory chip (as used on the SkinnyMite) to control the reset on brownouts and have not been able to reproduce the erasure as yet.


Perhaps that is the simplest solution for ALL concerned?

This would allow those who want to keep the default idea, but protect against those dirty-power situations, which seem to be one of the main causes of these self-erasure issues.

The MCP130 is very cheap, but it DOES add to the overall cost, if you are trying to keep prices as cheap as possible.Edited by Grogster 2015-05-02
Smoke makes things work. When the smoke gets out, it stops!
 
G8JCF

Guru

Joined: 15/05/2014
Location: United Kingdom
Posts: 676
Posted: 11:59pm 30 Apr 2015
Copy link to clipboard 
Print this post

I think that an "Option NoReset True" would be useful, ie once a uMite was being put into production, issue an Option NoReset True and then shorting the TX/RX pins together would have no affect. As Grogster says, then one has to erase the whole chip. This seems to me to be the proper behaviour for Production Quality systems.

Stuff in development/hobby etc is different and resetting by shorting TX/RX is useful and cheap way out of a hung program.

In summary:
New argument to command Option

NoReset True - Shorting TX/RX together on power on has NO affect
NoReset False - Shorting TX/RX togther on power on resets the flash/baudrate etc

The default is Option NoReset False

Just my tuppence worth

Peter


The only Konstant is Change
 
PicFan
Senior Member

Joined: 18/03/2014
Location: Austria
Posts: 133
Posted: 12:06am 01 May 2015
Copy link to clipboard 
Print this post

Hello !

That's my only, but biggest problem with the Micromite MK2 4.6b. I have several battery-powered projects, but I can neither release as when changing the battery in 8 of 10 cases, the program is lost.

Geoff, please help !!

Thank you and best regards from Austria!

Wolfgang

PS: We are a group of 3 hobbyists with the same big problem!
Edited by PicFan 2015-05-02
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4038
Posted: 12:29am 01 May 2015
Copy link to clipboard 
Print this post

I'd vote NoErase as the default (if the feature stays at all). Mine had been erased before I even got to do any testing!

John
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10251
Posted: 12:40am 01 May 2015
Copy link to clipboard 
Print this post

If you want to get rid of erase just do it!

Download the source from mmbasic.com

Install MPLABX and XC32 (v1.32 or v1.33). Activate the trial of the full licence to allow optimisation 2

comment out line 143 in main.c - "ResetAllFlash(); "

compile and reflash your chipEdited by matherp 2015-05-02
 
twofingers

Guru

Joined: 02/06/2014
Location: Germany
Posts: 1579
Posted: 01:22am 01 May 2015
Copy link to clipboard 
Print this post

I got the same issue.
AFAIK is Geoff already working on it. Please let him some time to fix it.
causality ≠ correlation ≠ coincidence
 
G8JCF

Guru

Joined: 15/05/2014
Location: United Kingdom
Posts: 676
Posted: 01:35am 01 May 2015
Copy link to clipboard 
Print this post

PeterM



PeterCEdited by G8JCF 2015-05-02
The only Konstant is Change
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4038
Posted: 01:39am 01 May 2015
Copy link to clipboard 
Print this post

And re-do the licence hassle when it's expired.

Yep, pretty user-friendly.

It's 1st May not April...

JohnEdited by JohnS 2015-05-02
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10251
Posted: 01:50am 01 May 2015
Copy link to clipboard 
Print this post

John

I've been looking over your posts and it seems you never contribute - only snipe at others

My solution is not ideal but would get round srnet and picfan's short term problems whilst waiting on a permanent solution from Geoff.

They can decide if it is a useful idea without your "contribution"

 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4038
Posted: 02:40am 01 May 2015
Copy link to clipboard 
Print this post

I wrote the free (*) programming code.

(*) but needs cheap (from £0 to £1 to £3 to £25) hardware depending on which you choose

I've contributed about C.

I've suggested any number of things as well.

If you mean contributed my code to Geoff's closed source, no. I choose not to. I've made it very clear I'd contribute if it was open (as it once was).

You might perhaps not have noticed it was me that kept suggesting the STM32F4 as a new host for MMBasic.

JohnEdited by JohnS 2015-05-02
 
srnet
Senior Member

Joined: 08/08/2014
Location: United Kingdom
Posts: 164
Posted: 06:15am 01 May 2015
Copy link to clipboard 
Print this post

  matherp said   If you want to get rid of erase just do it!

Download the source from mmbasic.com

Install MPLABX and XC32 (v1.32 or v1.33). Activate the trial of the full licence to allow optimisation 2

comment out line 143 in main.c - "ResetAllFlash(); "

compile and reflash your chip


Well, thanks for the tip which I will try, but I suspect that whilst it may be straight forward for those that already know how to use the apprpriate tools to do that, its not so easy for the rest of us.


$50SAT is Silent but probably still working.
For information on LoRa visit http://www.loratracker.uk/

 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2437
Posted: 06:52am 01 May 2015
Copy link to clipboard 
Print this post

loss of stored basic code (through an 'emergency recovery' triggered unintentionally) on the micromite does seem to be a recurring theme that comes up regularly, to the extent that it is pretty much proven that it does happen on occasion.

as i have suggested before, i favour mandating the need to insert a "key" device of some sort as the first step to enable any 'reset to factory' option - either a DS18B20 or just an NPN transistor (inverter) wired up between TxD and RxD:



very sound arguments can also be put for having some way to permanently disable the 'emergency recovery' feature completely for a finished project, though i feel this should be something that has to be explicitly enabled by the user, rather than the default behaviour.

geoff graham did enter into the discussion about all this in an earlier thread:
http://www.thebackshed.com/forum/forum_posts.asp?TID=7424

it would be good to hear if he has plans for the next release of micromite basic to address the problem.


cheers,
rob :-)Edited by robert.rozee 2015-05-02
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3285
Posted: 07:10am 01 May 2015
Copy link to clipboard 
Print this post

  robert.rozee said  it would be good to hear if he has plans for the next release of micromite basic to address the problem.

My current plan is to just disable the feature. It seemed like a good idea at the time but with PICKit3 clones for US$20 it is just as easy to reprogram the chip.
Geoff Graham - http://geoffg.net
 
PicFan
Senior Member

Joined: 18/03/2014
Location: Austria
Posts: 133
Posted: 07:32am 01 May 2015
Copy link to clipboard 
Print this post

  Geoffg said  
My current plan is to just disable the feature. It seemed like a good idea at the time but with PICKit3 clones for US$20 it is just as easy to reprogram the chip.


Hi Geoff !

This is the best solution!

Many thanks and best regards from Tyrol!

Wolfgang
 
G8JCF

Guru

Joined: 15/05/2014
Location: United Kingdom
Posts: 676
Posted: 08:04am 01 May 2015
Copy link to clipboard 
Print this post

Geoff,

could I ask that you please reconsider your decision to eliminate this functionality completely and implement the

Option NoReset True|False idea ?

From looking at the STM32 ArmMite source code, it looks really simple to implement.

Thanks

Peter
The only Konstant is Change
 
     Page 1 of 3    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025