Difference between revisions of "Circular buffer on flash"

From Stm32World Wiki
Jump to navigation Jump to search
Line 2: Line 2:
 
[[File:Green Pill rev. b - fully assembled.jpg|thumb|[[Green Pill]] rev. c]]
 
[[File:Green Pill rev. b - fully assembled.jpg|thumb|[[Green Pill]] rev. c]]
 
As is commonly known, many [[STM32]] [[MCU]]s, including the [[STM32F103]] used on the [[Blue Pill]] boards, contains more non-volatile flash storage than is advertised by [[ST]].  On [[User:Lth|my]] own [[Green Pill]] board a STM32F103C8 [[MCU]] is used.  This [[MCU]] has got - according to [[ST]], 64kB of flash, but in reality it is identical to the STM32F103CB and it does have 128kB of flash.  This is documented in quite some detail [[STM32F103#Extra_Flash|here]].
 
As is commonly known, many [[STM32]] [[MCU]]s, including the [[STM32F103]] used on the [[Blue Pill]] boards, contains more non-volatile flash storage than is advertised by [[ST]].  On [[User:Lth|my]] own [[Green Pill]] board a STM32F103C8 [[MCU]] is used.  This [[MCU]] has got - according to [[ST]], 64kB of flash, but in reality it is identical to the STM32F103CB and it does have 128kB of flash.  This is documented in quite some detail [[STM32F103#Extra_Flash|here]].
 +
 +
This naturally leads to the question if this extra flash could be used to store for example sensor data, and well, the answer to that question is: of course it can.
 +
 +
Before we dive into this in more detail, let me stress a big fat warning.  Just because something ''can'' be done that does not necessarily translate into that being a good idea.  In the STM32F103x8 datasheet, we find the following table:
 +
 +
[[File:STM32F103 Data Retention.png|600px]]
  
  

Revision as of 05:31, 21 July 2021

Green Pill rev. c

As is commonly known, many STM32 MCUs, including the STM32F103 used on the Blue Pill boards, contains more non-volatile flash storage than is advertised by ST. On my own Green Pill board a STM32F103C8 MCU is used. This MCU has got - according to ST, 64kB of flash, but in reality it is identical to the STM32F103CB and it does have 128kB of flash. This is documented in quite some detail here.

This naturally leads to the question if this extra flash could be used to store for example sensor data, and well, the answer to that question is: of course it can.

Before we dive into this in more detail, let me stress a big fat warning. Just because something can be done that does not necessarily translate into that being a good idea. In the STM32F103x8 datasheet, we find the following table:

STM32F103 Data Retention.png


STM32 Read internal temperature and voltage reference

STM32F103xx Flash Page Layout.png