File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -13,11 +13,17 @@ use crate::hal::{
13
13
use cortex_m_rt:: entry;
14
14
use embedded_storage:: nor_flash:: { NorFlash , ReadNorFlash } ;
15
15
16
+ /// # NOTE
17
+ /// This example assumes a flash size of more than 16K. If your MCU has less or equal than 16K Bytes
18
+ /// of flash memory, adjust the `memory.x` file and `OFFSET_START` + `OFFSET_END` constants accordingly.
16
19
#[ entry]
17
20
fn main ( ) -> ! {
18
21
if let Some ( mut p) = pac:: Peripherals :: take ( ) {
19
22
let _ = p. RCC . configure ( ) . freeze ( & mut p. FLASH ) ;
20
23
24
+ // Check that flash is big enough for this example
25
+ assert ! ( p. FLASH . len( ) > 16 * 1024 ) ;
26
+
21
27
// All examples use the first 16K of flash for the program so we use the first page after that
22
28
const OFFSET_START : u32 = 16 * 1024 ;
23
29
const OFFSET_END : u32 = OFFSET_START + 1024 ;
You can’t perform that action at this time.
0 commit comments