Flashstorage made for Duo

Can someone help me port this library?
kasperv79
Posts: 10
Joined: Fri Dec 02, 2016 9:26 am

Flashstorage made for Duo

Post by kasperv79 » Mon Jan 09, 2017 9:54 pm

Flashstorage library made for Duo.
Can this be converted :)

https://github.com/sebnil/DueFlashStorage

User avatar
RogerClark
Posts: 7134
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Flashstorage made for Duo

Post by RogerClark » Tue Jan 10, 2017 3:04 am

kasperv79 wrote:Flashstorage library made for Duo.
Can this be converted :)

https://github.com/sebnil/DueFlashStorage
Anything can be converted if you have the time.

However the common miss-conception is that all ARM based processors are the same, but in reality only the very core of the ARM processor is common to different MCU's.

Flash is not part of the ARM core, and different manufacturers implement it differently.

User avatar
mrburnette
Posts: 1827
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: Flashstorage made for Duo

Post by mrburnette » Tue Jan 10, 2017 1:21 pm

RogerClark wrote: Anything can be converted if you have the time.
:lol:

kasperv79
Posts: 10
Joined: Fri Dec 02, 2016 9:26 am

Re: Flashstorage made for Duo

Post by kasperv79 » Tue Jan 10, 2017 3:38 pm

RogerClark wrote:
kasperv79 wrote:Flashstorage library made for Duo.
Can this be converted :)

https://github.com/sebnil/DueFlashStorage
Anything can be converted if you have the time.

However the common miss-conception is that all ARM based processors are the same, but in reality only the very core of the ARM processor is common to different MCU's.

Flash is not part of the ARM core, and different manufacturers implement it differently.
hmm.. thought Flash was a part af the Core but not EEPROM! ??

User avatar
Manny
Posts: 41
Joined: Wed Dec 09, 2015 3:15 pm

Re: Flashstorage made for Duo

Post by Manny » Tue Jan 10, 2017 4:23 pm

This flash library works with STM32 https://github.com/Marzogh/SPIFlash there's some others.

User avatar
RogerClark
Posts: 7134
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Flashstorage made for Duo

Post by RogerClark » Tue Jan 10, 2017 8:58 pm

kasperv79 wrote:
RogerClark wrote:
kasperv79 wrote:Flashstorage library made for Duo.
Can this be converted :)

https://github.com/sebnil/DueFlashStorage
Anything can be converted if you have the time.

However the common miss-conception is that all ARM based processors are the same, but in reality only the very core of the ARM processor is common to different MCU's.

Flash is not part of the ARM core, and different manufacturers implement it differently.
hmm.. thought Flash was a part af the Core but not EEPROM! ??
AFIK
EEPROM is just a name given by the Arduino team, for code to allow you to write to the program Flash.

In reality there is only Flash on most MCUs

victor_pv
Posts: 1679
Joined: Mon Apr 27, 2015 12:12 pm

Re: Flashstorage made for Duo

Post by victor_pv » Fri Jan 13, 2017 10:28 pm

I had a look and that flash library is for "emulating" an eeprom by using a block of flash memory, since the DUE doesn't have internal eeprom like the AVR does.

We already have a library for such, and I think there is some older thread commenting on it.
Also there is an example of using it:
Arduino_STM32/STM32F1/libraries/EEPROM/examples/EEPROM_example/EEPROM_example.ino

Word of caution, an eeprom can be written to many hundreds of thousands of times, while flash can be written to only a few thousand times.
Also to write a byte in flash you normally need to erase and rewrite the block. So a write to any byte in the block counts as a write to every byte of the block. If you plan on writing a value once a week and read it many times, you are probably ok, but if you plan on writing often, you may wear out the block of flash.

User avatar
ahull
Posts: 1627
Joined: Mon Apr 27, 2015 11:04 pm
Location: Sunny Scotland
Contact:

Re: Flashstorage made for Duo

Post by ahull » Fri Jan 13, 2017 10:58 pm

How much "flash" do you need?
How many times do you intend to re-write it?

The answer to those two questions will let us know what type of flash or eerom is best suited to your task.
- Andy Hull -

victor_pv
Posts: 1679
Joined: Mon Apr 27, 2015 12:12 pm

Re: Flashstorage made for Duo

Post by victor_pv » Sat Jan 14, 2017 3:54 am

RogerClark wrote: AFIK
EEPROM is just a name given by the Arduino team, for code to allow you to write to the program Flash.

In reality there is only Flash on most MCUs
Roger the AVR MCUs have an actual small eeprom inside to store data. The DUE EEPROM library is an emulation in program flash.

User avatar
RogerClark
Posts: 7134
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Flashstorage made for Duo

Post by RogerClark » Sat Jan 14, 2017 8:35 am

Victor

Thanks for the clarification

Post Reply