Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 00:27 08 Feb 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 : Volatile RAM. Thinking DS1307 without battery.

     Page 2 of 2    
Author Message
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4528
Posted: 07:54am 23 Jan 2025
Copy link to clipboard 
Print this post

  Frank N. Furter said  @PhenixRising:

Please don't forget to put a diode in front of the capacitor from Volhout's idea. Then the capacitor cannot be discharged externally.
This is how I have implemented it in the past and it has always worked well...

Frank


There is a diode between Vbus and Vsys on the genuine pico board.

Volhout
PicomiteVGA PETSCII ROBOTS
 
bfwolf
Newbie

Joined: 03/01/2025
Location: Germany
Posts: 26
Posted: 09:47am 23 Jan 2025
Copy link to clipboard 
Print this post

  PhenixRising said  
It was the reason for the start of the thread. Before going for a hardware solution, I wondered if there was some sort of persistent-memory-while-power-was-applied that I was unaware of.
Pete had already done this in the past but there was no interest and so it was disabled.
Now it has been reinstated and works perfectly for my needs.

See phil99's posts from earlier.

  Quote  SAVE PERSISTENT and MM.INFO(PERSISTENT) added in b2.


The question is, whether "SAVE PERSISTENT" stores the information in "persistent storage" (EEPROM, FLASH) or not..   If it does, it may destroy the chip in time (wear out the cells). Flash doesn't have the large count of write cycles as EEPROM has. There's an other risk: Writing to FLASH/EEPROM may be interrupted by a power loss and destroy even other data (if in the same erasable page/sector).

I always try to avoid storing informations in FLASH/EEPROM, if they are likely to change frequently. If it's not necessary that the informations survive power failures, the RAM method is sufficient. Even the fact, that power failure (or reset or watchdog timeout) happened, can be obtained this way.

I just found in the RP2350's manual, that there is a (slow) 1KB "Boot RAM" at an address (0x400e0000, BOOTRAM_BASE) far away from the "regular RAM".

bfwolf
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9512
Posted: 10:26am 23 Jan 2025
Copy link to clipboard 
Print this post

uint64_t __uninitialized_ram(_persistent);
 
bfwolf
Newbie

Joined: 03/01/2025
Location: Germany
Posts: 26
Posted: 11:06am 23 Jan 2025
Copy link to clipboard 
Print this post

  matherp said  
uint64_t __uninitialized_ram(_persistent);


That's what I hoped!

But I found this issue while googled for "pico __uninitialized_ram" (as nosy as I am)..

https://github.com/raspberrypi/pico-sdk/issues/2203

Issue "opened" by you, peter, true?

bfwolf
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4528
Posted: 11:51am 23 Jan 2025
Copy link to clipboard 
Print this post

For modern NAND flah (and eMMC/SD cards) there are 2 things that ar bad

1/ frequent writing to it (wear out)
2/ long time power off

This type flash looses content pretty fast, and as long as the data is refreshed/re-written that is not a problem. But leaving a modern SD card without power for years, will make the card useless. The higher the temperature, the worse it gets.

So this is not the type of storage for your family photo's. Better use an old harddisk. SSD's are the same type of memory and will exhibit the same phenonem.

I learned this yesterday from the vendor.

Volhout
PicomiteVGA PETSCII ROBOTS
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 1024
Posted: 12:08pm 23 Jan 2025
Copy link to clipboard 
Print this post

@Volhout: Good info  
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 902
Posted: 07:38am 24 Jan 2025
Copy link to clipboard 
Print this post

  Volhout said  
  Frank N. Furter said  @PhenixRising:

Please don't forget to put a diode in front of the capacitor from Volhout's idea. Then the capacitor cannot be discharged externally.
This is how I have implemented it in the past and it has always worked well...

Frank


There is a diode between Vbus and Vsys on the genuine pico board.

Volhout


Yes, but if there are other loads BEFORE the capacitor, they can drain the capacitor without an additional diode.

Frank
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3907
Posted: 07:50am 24 Jan 2025
Copy link to clipboard 
Print this post

  Volhout said  For modern NAND flah (and eMMC/SD cards) there are 2 things that ar bad

1/ frequent writing to it (wear out)
2/ long time power off

This type flash looses content pretty fast, and as long as the data is refreshed/re-written that is not a problem. But leaving a modern SD card without power for years, will make the card useless.

Volhout

Useless (i.e. no longer works) or just content gone?

John
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4528
Posted: 10:38am 24 Jan 2025
Copy link to clipboard 
Print this post

John,

I was told that the eMMC controller (when powered) swipes the memory for errors, and when there are, it relocates and corrects (the error correction can correct X bit errors in each block). But over time, more bits fail (charge leaks away) and the block content is lost.

It is depending on your filesystem how you handle that. The filesystem can only see the  block is flagged "corrupt". If this is part of your executable binaries, it should mark the whole file (multiple blocks) lost. And probably it will do that for the other file formats also. But in case it is a JPEG or MPEG file, recovery/repair could still be a valid option (family photo's). But I am not sure how a filsystem handles that, and if recovery is an option. It all depends on what is lost.

So in essence: I don't know.

Volhout

The horrid is that the number on this scary. When you have amodern high capacity eMMC/SD card, and write data and storage at 50+ degrees C (depending the temp rating of the card), 300 hours without power is sufficient for bit fails, and after 1000 hours it is not guaranteed they can be recovered. In 99.9% of cases they still can, but no guarantee is given anymore. For mission critical applications that is the number to work with. That is only 40 days ....
Temperature is major in this. At 25 degrees the numbers are far, far more friendly.
But storing family photos on SD card for years in the attic, where in summer it can reach 50C easily, may not be a good idea.
Edited 2025-01-24 20:43 by Volhout
PicomiteVGA PETSCII ROBOTS
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3907
Posted: 11:07am 24 Jan 2025
Copy link to clipboard 
Print this post

Thanks, very interesting.

Suppose it's just an SD card or SSD with data no longer needed but has been left without power for ages.

Then you try to erase it (by writing 1s (or 0s) to all of it) - will it work for new data written after that?  I suppose you'd have to "format" (repartition etc), but will it then be OK?

("format" used to be something else, with disks it meant writing sector stuff, timing info etc, not really relevant for SD / SSD)

John
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2098
Posted: 02:17pm 24 Jan 2025
Copy link to clipboard 
Print this post

hmmm... this is backed up by GRC - he has recently updated spinrite to refresh SSDs - the areas where the data doesn't move, degrade and become slow. Re-writing the data in the same block refreshes the data and so increase the speed. I must say I don't really understand the underlying tech of SSD but he makes a point and a recent frefresh on one of my machines here has defo made a difference

GRC

h
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4528
Posted: 03:59pm 24 Jan 2025
Copy link to clipboard 
Print this post

huh...

back to DOS ?

Volhout
PicomiteVGA PETSCII ROBOTS
 
circuit
Senior Member

Joined: 10/01/2016
Location: United Kingdom
Posts: 247
Posted: 07:29pm 24 Jan 2025
Copy link to clipboard 
Print this post

Integrity of long-term storage is certainly an issue; I have a number of old recordable CD data disks that are no longer accessible.  Following this thread, I dug out some old compact flash cards that are over twenty years old and have not been accessed during that time.  I put them into a card reader and found all the images and videos were intact; images from 2004-5 from an early Nikon digital camera. Checked out five cards and all were readable.  Now to dig out an old digital camera that supports Compact Flash cards and see if the things are still fully operational. Time to get into the attic...
Edited 2025-01-25 05:30 by circuit
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9512
Posted: 04:40pm 25 Jan 2025
Copy link to clipboard 
Print this post

PhenixRising:

Don't know if this helps but V6.00.02b4 will include

MM.INFO(BOOT)

returns POWER, RESET, or WATCHDOG depending on what cause the firmware to restart.
Permanent OPTION commands and CPU RESTART will both report WATCHDOG as will a real H/W watchdog. Both a H/W and software watchdog will set MM.WATCHDOG to 1
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 1024
Posted: 07:53pm 25 Jan 2025
Copy link to clipboard 
Print this post

  matherp said  PhenixRising:

Don't know if this helps but V6.00.02b4 will include

MM.INFO(BOOT)

returns POWER, RESET, or WATCHDOG depending on what cause the firmware to restart.
Permanent OPTION commands and CPU RESTART will both report WATCHDOG as will a real H/W watchdog. Both a H/W and software watchdog will set MM.WATCHDOG to 1


Spectacular   All these refinements are enough to give me heart palpitations   Like tailor-made, just-in-time for my needs.

My original need was; initializing the zero-position of servo axes (big-ish machine) can be a PITA (slow). I needed the flag to indicate that the machine had/had-not been referenced.
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 1024
Posted: 02:45am 01 Feb 2025
Copy link to clipboard 
Print this post

  CaptainBoing said  hmmm... this is backed up by GRC - he has recently updated spinrite to refresh SSDs - the areas where the data doesn't move, degrade and become slow. Re-writing the data in the same block refreshes the data and so increase the speed. I must say I don't really understand the underlying tech of SSD but he makes a point and a recent frefresh on one of my machines here has defo made a difference

GRC

h


Awesome    

I am familiar with Gibson Research from the 80's.

I have a guitar FX pedal that takes the Type-1 CF card, 2GB. I sourced some on eBay and they just wouldn't be recognised "Insert disk for drive e:"

On the GRC site, there are some free utilities. I downloaded "InitDisk" which instantly brought my CF cards to life  

Cheers, Cap'n
 
     Page 2 of 2    
Print this page


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

© JAQ Software 2025