pberrett
Posts: 51
Joined: Sun Jan 29, 2012 1:44 pm

A Plea for Flash memory in Pi3

Sat Dec 12, 2015 1:19 pm

Hi all

I have been playing with Pis and Arduinos for some time. One frustration for me is the corruption of Sd disks.

By contrast the Arduino's flash memory is rock solid. If I am using the board in a remote location or in a device that is not easy to dissassemble, I can be absolutely sure that the Arduino will fire up its programmed software as I originally programmed it.

An example of where a Pi could be useful but is at risk from sd card corruption is a balloon transmitter. One might launch a weather balloon with a Pi on board and program the Pi to do do various tasks eg take pictures and transmit them using ham radio. However if the sd card gets corrupted due to a power outage then its impossible to get to the balloon to fix the problem.

So my plea to Mr Upton and the Raspberry Pi Foundation is to take the cheap model Zero and enhance it with a similar type of flash memory as exists on an Arduino, or some form of flash memory which will give rock solid certainty that the operating system will boot up every time. That may require some of the memory to be locked down as Read only but so be it. Given the Zero's low price point you can add extra components and still produce a very cheap board.

At the moment the various flavours of Pi don't cater to this need and mean that the Pi is too unreliable to be used in remote applications where access is difficult or impossible,

Thanks

Peter Berrett VK3PB

emma1997
Posts: 200
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not the old one)

Re: A Plea for Flash memory in Pi3

Sat Dec 12, 2015 1:59 pm

I think Pi Compute Module does have flash.

Anyway Arduino flash is not rock solid and will corrupt very easily if you power down while writing or have slow supply rise/fall times. In fact SD is somewhat more secure in this respect.

Personally i think a built-in coffee maker would be a very useful feature for next Pi model. Design team please take note.

Heater
Posts: 12723
Joined: Tue Jul 17, 2012 3:02 pm

Re: A Plea for Flash memory in Pi3

Sat Dec 12, 2015 2:09 pm

Be sure to mount your SD card as read only.

See here for hints and tips on that https://wiki.debian.org/ReadonlyRoot

The Pi has been up in many balloons and many people use it in remote locations reliably.

If you really need to write data use a tiny USB memory stick or better still send it out over the net.

User avatar
r3d4
Posts: 967
Joined: Sat Jul 30, 2011 8:21 am
Location: ./

Re: A Plea for Flash memory in Pi3

Sat Dec 12, 2015 2:25 pm

Heater wrote: If you really need to write data use a tiny USB memory stick or better still send it out over the net.
+ if you realy need to avoid "risk from sd card corruption" : use initramfs root :|

emma1997 wrote:Personally i think a built-in coffee maker would be a very useful feature for next Pi model. Design team please take note.
Please include a firmware option for n tuple espresso on the built-in coffee mekar, tar.

User avatar
jjex22
Posts: 153
Joined: Tue Feb 24, 2015 12:41 pm

Re: A Plea for Flash memory in Pi3

Sat Dec 12, 2015 2:42 pm

I am tending to agree, but not because of the arduino.

The reason the comparison to the arduino isn't particularly applicable is because most people will need at least 4GB of storage for a Pi, with 8GB reccomended. This is because it has to house the OS, in addition to your code. Containing a full desktop OS, there will also be data storage and such.

Arduinos have until recently just stuck to AVR MCU's, which only have couple to a few 10's KB flash memory + eeprom space for your code. They don't *need* much more because you plug it into a computer with the OS and your files already on it to code it, and you are using it in small code uses. There is also the production and form factor of this storage space; microcontrollers have all this on package - when arduino or whoever buy the chips, they get the ram, rom and flash included - so that means not having to increase the board size for the extra chips, and no extra stuff to buy. Even the new arduino zero, which departs from the AVR architecture for the ARM-v7m with the cortex-M0 MCU and impressive 256kb flash, that flash is again on die - it comes from amtel as one chip.

Pi's run on CPU's, not MCU's; you have to add the RAM and the flash storage as seperate chips, which cost more to make and take up more space. You can sometimes save space if heat and design allow it with package on package ( like the gen1 pi's.)

I think the Pi zero using a micro SD is pretty sensible; it's a $5 computer and a micro SD reader is cheaper than a 4gb flash package. There is also the idea that a lot of people now will already have usable, spare/old SD cards from old cell phones and alike.

Personally having seen C.H.I.P come through Kickstarter with on board flash, that's an indication of the falling cost of production for the technology. For my own usage, micro SD cards are a pain because I always seem to have to go and buy another one - my old ones are never big enough, and my big enough ones are always in use lol, but for the earlier boards, using full sized cards I was able to re-purpose old camera cards. The cost of them is also falling; I just got a A$10(£5) class 10 8GB micro card with full sized adapter in the local supermarket.

I'd definitely like RPF to look into a board with flash and wifi as it seems some other boards are able to achieve this in a comparable package and I think there's the potential to lower the overal cost of set up for those that do not already have SD cards and wifi adapters but need them. In reality though, that's me looking at it as a consumer. I can look at all the stats and checklists and what not, but I have no idea about supply and manufacturing! Yes I'd like a board with wifi and flash, and they exist elsewhere, but I'm just gonna trust RPF to know more that me on this one :)

There is also the portability of SD cards. Coming from the magnetic generation of floppies and audio /data cassettes, I quite like being able to take thinks from one non networked location/ store indefinitely in a box nice and easy. These are easy to achieve without SD for sure, but there is something tactile and floppy-ish about the process which I enjoy :D
I had the idea for a single board computer in every seat on airplanes... but it all just seemed a bit Pi in the Sky!

fruitoftheloom
Posts: 19816
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: A Plea for Flash memory in Pi3

Sat Dec 12, 2015 3:02 pm

pberrett wrote:Hi all

I have been playing with Pis and Arduinos for some time. One frustration for me is the corruption of Sd disks.

By contrast the Arduino's flash memory is rock solid. If I am using the board in a remote location or in a device that is not easy to dissassemble, I can be absolutely sure that the Arduino will fire up its programmed software as I originally programmed it.

An example of where a Pi could be useful but is at risk from sd card corruption is a balloon transmitter. One might launch a weather balloon with a Pi on board and program the Pi to do do various tasks eg take pictures and transmit them using ham radio. However if the sd card gets corrupted due to a power outage then its impossible to get to the balloon to fix the problem.

So my plea to Mr Upton and the Raspberry Pi Foundation is to take the cheap model Zero and enhance it with a similar type of flash memory as exists on an Arduino, or some form of flash memory which will give rock solid certainty that the operating system will boot up every time. That may require some of the memory to be locked down as Read only but so be it. Given the Zero's low price point you can add extra components and still produce a very cheap board.

At the moment the various flavours of Pi don't cater to this need and mean that the Pi is too unreliable to be used in remote applications where access is difficult or impossible,

Thanks

Peter Berrett VK3PB
.......just buy a Compute Module as that Model has eMMC, apart from you stating no RPi has !

http://uk.rs-online.com/web/p/processor ... ts/8134164


OR http://www.cnx-software.com/2015/12/11/ ... ry-pi-zero
adieu

My other Computer is an Asus CS10 ChromeBit running Chrome Operating System.
HP Envy 4500 Wireless Printer supported by HPLIP software in Raspbian Buster.
Raspberry Pi Model 2B v1.1

mikerr
Posts: 2768
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: A Plea for Flash memory in Pi3

Sat Dec 12, 2015 3:41 pm

The pi compute module does have 4GB onboard flash....

Reasons not to have onboard flash:
  • No onboard flash = unbrickable device though misconfiguration or flash failing.
  • You can instantly replace a microSD card and know it will work identically to any Pi
  • Can have a supply of different configured cards for different purposes
  • Upgradeable - put a larger microSD as needed
    When Pi was released, 2GB cards were most common/cheap, now 16GB and above
    the Compute module is already cramped with its 4GB onboard (and won't fit full noobs)
Reasons for onboard flash:
  • convenient and physically robust - no sd slot to be loose
  • non-removeable is useful for commercial protection
Android app - Raspi Card Imager - download and image SD cards - No PC required !

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 22742
Joined: Sat Jul 30, 2011 7:41 pm

Re: A Plea for Flash memory in Pi3

Sat Dec 12, 2015 4:33 pm

I have one real reason why flash is a no-go. It's not upgradable.

I find SD cards pretty reliable, and as others have commented above, there are ways of avoiding corruption.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

User avatar
TimG
Posts: 284
Joined: Tue Apr 03, 2012 12:15 am
Location: Switzerland

Re: A Plea for Flash memory in Pi3

Sat Dec 12, 2015 5:23 pm

The Arduino is reliable because its flash memory is read-only (unless the bootloader is running, which only happens during reprogramming).

Linux is less robust against power glitches because it needs a writable file system. Whether the files are on internal flash or an external SD card is irrelevant -- if power is removed whilst writing then the file system can be corrupted.

The real solution is to make the root file system read-only, and put all the writable files on a RAM-disk (whilst is lost after reboot). There are various ways of doing this -- see Heater's link above.

However making a read-only system is not straightforward, especially for the beginner. Yet the RPi gets used in so many different environments where power is unreliable and controlled shutdown is not always possible. For these situations, I'd love to see an "official" read-only Raspbian disk image.

stderr
Posts: 2178
Joined: Sat Dec 01, 2012 11:29 pm

Re: A Plea for Flash memory in Pi3

Sat Dec 12, 2015 6:19 pm

pberrett wrote:I have been playing with Pis and Arduinos for some time. One frustration for me is the corruption of Sd disks.
The next pi should have a jumper selected programmable/read only potentially network bootable bootstrap area written in Erlang with hotswappable code so you can upload corrections to the kernel without rebooting or taking the system offline. This will help with your balloon and with any future missions to Pluto. The jumper selection scheme is primarily intended to make *sure* that you have a non-compromised bootable system to work with if you get in trouble or think you might be. This means that your system can access its bank accounts while it is on its way to Pluto.

User avatar
r3d4
Posts: 967
Joined: Sat Jul 30, 2011 8:21 am
Location: ./

Re: A Plea for Flash memory in Pi3

Sun Dec 13, 2015 12:03 am

TimG wrote: I'd love to see an "official" read-only Raspbian disk image.
For now you will have to make do with un-official distro/img's (tcl?) and or other ppl'z randum crusty ROR (ReadonlyRoot) buildroots .

User avatar
r3d4
Posts: 967
Joined: Sat Jul 30, 2011 8:21 am
Location: ./

Re: A Plea for Flash memory in Pi3

Sun Dec 13, 2015 12:11 am

stderr wrote:This means that your system can access its bank accounts while it is on its way to Pluto.
*sings*
Oh you never get to pluto ,on proprietary firmware
:roll:

User avatar
solar3000
Posts: 1049
Joined: Sat May 18, 2013 12:14 am

Re: A Plea for Flash memory in Pi3

Sun Dec 13, 2015 3:37 am

The AMTEL chip's built in memory is only written with a special device. Once you unplug that writer, you can unpower your arduino any time. You can under power it anytime.
SD cards are read-write.
Antikythera

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: Korea

Re: A Plea for Flash memory in Pi3

Sun Dec 13, 2015 3:47 am

solar3000 wrote:The AMTEL chip's built in memory is only written with a special device. Once you unplug that writer, you can unpower your arduino any time. You can under power it anytime.
SD cards are read-write.
This makes no sense. What are you trying to say?

stderr
Posts: 2178
Joined: Sat Dec 01, 2012 11:29 pm

Re: A Plea for Flash memory in Pi3

Sun Dec 13, 2015 3:54 am

ame wrote:
solar3000 wrote:The AMTEL chip's built in memory is only written with a special device. Once you unplug that writer, you can unpower your arduino any time. You can under power it anytime.
SD cards are read-write.
This makes no sense. What are you trying to say?
I don't know what he's trying to say but it seems like he's saying that the built in memory for the AMTEL is not writeable from the device itself but requires some sort of additional writer or burner or something like that.

Something like an EEPROM or a UV EPROM or for example, some memory required that you have, I don't know 12 volts to write but you'd read at, I don't know, 5v. So you needed to put the memory into some device that could do that. Or any number of other possibilities. The idea that something *can't* be changed without some special action is a very good one, it's how we'd deal with the very real threat of computer viruses and the like if we were smart. We aren't very smart, we continue to use flash that can be changed by any program that gets root.

User avatar
Greg Erskine
Posts: 111
Joined: Sat Sep 15, 2012 4:20 am

Re: A Plea for Flash memory in Pi3

Sun Dec 13, 2015 4:09 am

r3d4 wrote:
TimG wrote: I'd love to see an "official" read-only Raspbian disk image.
For now you will have to make do with un-official distro/img's (tcl?) and or other ppl'z randum crusty ROR (ReadonlyRoot) buildroots .
Hi r3d4,

Does tcl = tiny core linux?

I've using piCore (tcl for the pi) for over a year and I can't remember having a SC card corruption, even when just pulling the plug. So if you don't need all the bells and whistles I can recommend piCore.

regards
Greg
* Raspberry Pi is a trademark of the Raspberry Pi Foundation

stderr
Posts: 2178
Joined: Sat Dec 01, 2012 11:29 pm

Re: A Plea for Flash memory in Pi3

Sun Dec 13, 2015 4:29 am

Greg Erskine wrote:I've using piCore (tcl for the pi) for over a year and I can't remember having a SC card corruption, even when just pulling the plug. So if you don't need all the bells and whistles I can recommend piCore.
This is because it is just running in RAM. If you were doing the shutdown sequence and pulled the plug as it was writing out the backup file, which has all the changes you made to tiny core, I can image you could have sdcard corruption. Another thing is that for an embedded application, the default tiny core idea that you can just download everything fresh at each boot is difficult if you don't have ready access to the internet or the time at start up.

I've only used tiny core on x86, does omxplayer work on it? Do you feel like their repositories are being kept current and include what should be there such as firefox?

fruit-uk
Posts: 609
Joined: Wed Aug 06, 2014 4:19 pm
Location: Suffolk, UK

Re: A Plea for Flash memory in Pi3

Sun Dec 13, 2015 5:31 am

I have never had SD card corruption - but then I only use the first partition after initial install, with the OS on USB stick or HDD.
I have had one USB stick fail.

16Gb cards are available around here for £5 at present so hardly a big deal.

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: Korea

Re: A Plea for Flash memory in Pi3

Sun Dec 13, 2015 6:09 am

stderr wrote:
ame wrote:
solar3000 wrote:The AMTEL chip's built in memory is only written with a special device. Once you unplug that writer, you can unpower your arduino any time. You can under power it anytime.
SD cards are read-write.
This makes no sense. What are you trying to say?
I don't know what he's trying to say but it seems like he's saying that the built in memory for the AMTEL is not writeable from the device itself but requires some sort of additional writer or burner or something like that.

Something like an EEPROM or a UV EPROM or for example, some memory required that you have, I don't know 12 volts to write but you'd read at, I don't know, 5v. So you needed to put the memory into some device that could do that. Or any number of other possibilities. The idea that something *can't* be changed without some special action is a very good one, it's how we'd deal with the very real threat of computer viruses and the like if we were smart. We aren't very smart, we continue to use flash that can be changed by any program that gets root.
But it can be changed. That's how the bootloader works. I agree that this generally won't happen by accident though.

There are things you can do to reduce this happening on a Pi. But, if it's not good enough... use something else.

W. H. Heydt
Posts: 10344
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: A Plea for Flash memory in Pi3

Sun Dec 13, 2015 6:23 am

Having just spent an evening working on an attempt to flash the eMMC on a CM...I have to say that I'm rather strongly opposed to making a future Pi that can't be booted from an SD card, and--since adding *anything* increases cost--I don't have much desire to pay for features I'll never want to use, even in concept.

User avatar
kusti8
Posts: 3439
Joined: Sat Dec 21, 2013 5:29 pm
Location: USA

Re: A Plea for Flash memory in Pi3

Sun Dec 13, 2015 9:32 am

stderr wrote:
Greg Erskine wrote:I've using piCore (tcl for the pi) for over a year and I can't remember having a SC card corruption, even when just pulling the plug. So if you don't need all the bells and whistles I can recommend piCore.
This is because it is just running in RAM. If you were doing the shutdown sequence and pulled the plug as it was writing out the backup file, which has all the changes you made to tiny core, I can image you could have sdcard corruption. Another thing is that for an embedded application, the default tiny core idea that you can just download everything fresh at each boot is difficult if you don't have ready access to the internet or the time at start up.

I've only used tiny core on x86, does omxplayer work on it? Do you feel like their repositories are being kept current and include what should be there such as firefox?
It don't think you've grasped how Tiny Core works. There is no backup, because it's intended to never be changed once ready. In a embedded application, you don't change the OS settings everything you boot up. If you need to save file then you use a USB stick. And you don't download everything fresh, the packages are stored on the SD card, but are put into RAM on boot up.

And there is omxplayer, although it's a bit of a hack.
There are 10 types of people: those who understand binary and those who don't.

emma1997
Posts: 200
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not the old one)

Re: A Plea for Flash memory in Pi3

Sun Dec 13, 2015 9:52 am

stderr wrote:it seems like he's saying that the built in memory for the AMTEL is not writeable from the device itself
From several comments here it looks like Pi-heads not up to speed on Arduino/AVR technology. All these Atmel chips have integral flash write capability (SPM/progmem). No bootloader or programmer required. Not much different than using SD except it's built in.

Like Pi these are subject to corruption just like a regular PC too if powered down at the wrong time without permission. Personally I hate having my behavior dictated by a machine. It's the thing I despise most about Windows. It's why I like MSDOS and now the Linux run-from-RAM ability is way cool too.

And I do like the Pi start-from-scratch boot approach. It's like many of the ARM chips with basic factory bootloader like STM etc. No BIOS upgrades or bricked boards to worry about. However I think it is a big mistake for RPi foundation to not include a pin 18 power-down routine in standard distro.

User avatar
TimG
Posts: 284
Joined: Tue Apr 03, 2012 12:15 am
Location: Switzerland

Re: A Plea for Flash memory in Pi3

Sun Dec 13, 2015 10:58 am

emma1997 wrote:From several comments here it looks like Pi-heads not up to speed on Arduino/AVR technology. All these Atmel chips have integral flash write capability (SPM/progmem). No bootloader or programmer required. Not much different than using SD except it's built in.
The ATmega chips can only execute the SPM instruction from the bootloader. See
http://www.atmel.com/images/doc1644.pdf

emma1997
Posts: 200
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not the old one)

Re: A Plea for Flash memory in Pi3

Sun Dec 13, 2015 11:20 am

TimG wrote: The ATmega chips can only execute the SPM instruction from the bootloader.
That is a common misconception. No bootloader is required. In most "Mega" series the SPM instruction must reside in RWW section but can be called from anywhere in memory. In some "Mega" and all "Tiny" family SPM can be anywhere in memory. The point is user code can write to flash just like any MCU writes to SD or other storage. The main difference is it's built in instead of plug in.

User avatar
bstrobl
Posts: 97
Joined: Wed Jun 04, 2014 8:31 pm
Location: Germany

Re: A Plea for Flash memory in Pi3

Sun Dec 13, 2015 12:40 pm

I think the current system is an excellent compromise. Current Pis if handled well can probably last decades, compared to most flash memory which will wear out if given enough time.

What would actually be kind of neat is an operating system installed in some embedded ROM on the SoC with a very basic linux system. It might not be changeable but it would allow basic use of the Pi if no card is available. Once a micro sd card is inserted, that part of the chip gets deactivated to reduce security issues and keep the "everything must be hackable with no blobs" group happy.

This would have several advantages:
1. Make it impervious to sudden power loss
2. Make it useable in areas where rewriting the card is difficult (think rural Africa where SD card images and card readers or extra Pis are not always available)
3. Make it useable without an SD card (cheaper!)
4. Allow use without knowledge of writing OSs onto a card
5. Make it impervious to misconfiguration
6. Faster speeds due to ROM access

Maybe use a highly polished up Raspbian with a ton of extra software (Wiki, Webserver etc). The Nintendo 3DS for example uses game cards with MROMs that can store a couple gigs of data.

A simple USB drive would then be enough to store documents and other bits and bobs.

Return to “General discussion”