@@ -35,23 +35,30 @@ const CLOCK_FREQ: Hertz = Hertz::from_raw(50_000_000);
35
35
36
36
// Important bootloader addresses and offsets, vector table information.
37
37
38
+ const NVM_SIZE : u32 = 0x20000 ;
38
39
const BOOTLOADER_START_ADDR : u32 = 0x0 ;
39
40
const BOOTLOADER_CRC_ADDR : u32 = BOOTLOADER_END_ADDR - 2 ;
40
41
// This is also the maximum size of the bootloader.
41
42
const BOOTLOADER_END_ADDR : u32 = 0x3000 ;
42
43
const APP_A_START_ADDR : u32 = BOOTLOADER_END_ADDR ;
43
- const APP_A_SIZE_ADDR : u32 = APP_A_END_ADDR - 8 ; // 0x117F8
44
- // Four bytes reserved, even when only 2 byte CRC is used. Leaves flexibility to switch to CRC32.
45
- const APP_A_CRC_ADDR : u32 = APP_A_END_ADDR - 4 ; // 0x117FC
46
- pub const APP_A_END_ADDR : u32 = APP_B_END_ADDR - BOOTLOADER_END_ADDR / 2 ; // 0x11800
47
- // The actual size of the image which is relevant for CRC calculation.
44
+ // 0x117F8
45
+ const APP_A_SIZE_ADDR : u32 = APP_A_END_ADDR - 8 ;
46
+ // Four bytes reserved, even when only 2 byte CRC is used. Leaves flexibility to switch to CRC32.
47
+ // 0x117FC
48
+ const APP_A_CRC_ADDR : u32 = APP_A_END_ADDR - 4 ;
49
+ // 0x11800
50
+ pub const APP_A_END_ADDR : u32 = APP_B_END_ADDR - BOOTLOADER_END_ADDR / 2 ;
51
+ // The actual size of the image which is relevant for CRC calculation.
48
52
const APP_B_START_ADDR : u32 = APP_A_END_ADDR ;
49
53
// The actual size of the image which is relevant for CRC calculation.
50
- const APP_B_SIZE_ADDR : u32 = APP_B_END_ADDR - 8 ; // 0x1FFF8
51
- // Four bytes reserved, even when only 2 byte CRC is used. Leaves flexibility to switch to CRC32.
52
- const APP_B_CRC_ADDR : u32 = APP_B_END_ADDR - 4 ; // 0x1FFFC
53
- pub const APP_B_END_ADDR : u32 = 0x20000 ;
54
- pub const APP_IMG_SZ : u32 = APP_B_END_ADDR - APP_A_END_ADDR / 2 ;
54
+ // 0x1FFF8
55
+ const APP_B_SIZE_ADDR : u32 = APP_B_END_ADDR - 8 ;
56
+ // Four bytes reserved, even when only 2 byte CRC is used. Leaves flexibility to switch to CRC32.
57
+ // 0x1FFFC
58
+ const APP_B_CRC_ADDR : u32 = APP_B_END_ADDR - 4 ;
59
+ // 0x20000
60
+ pub const APP_B_END_ADDR : u32 = NVM_SIZE ;
61
+ pub const APP_IMG_SZ : u32 = ( APP_B_END_ADDR - APP_A_START_ADDR ) / 2 ;
55
62
56
63
static_assertions:: const_assert!( ( APP_B_END_ADDR - BOOTLOADER_END_ADDR ) % 2 == 0 ) ;
57
64
0 commit comments