rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
hw_layer
ports
stm32
stm32h7
mpu_util.cpp
Go to the documentation of this file.
1
/**
2
* @file mpu_util.cpp
3
*
4
* @date Feb 26, 2021
5
* @author Matthew Kennedy, (c) 2021
6
*/
7
8
#include "
pch.h
"
9
10
#include "
flash_int.h
"
11
12
bool
mcuCanFlashWhileRunning
() {
13
// We only support dual bank H7, so always allow flash while running.
14
return
true
;
15
}
16
17
size_t
flashSectorSize
(
flashsector_t
sector) {
18
// All sectors on H7 are 128k
19
return
128 * 1024;
20
}
21
22
uintptr_t
getFlashAddrFirstCopy
() {
23
return
0x08100000;
24
}
25
26
uintptr_t
getFlashAddrSecondCopy
() {
27
// Second copy is one sector past the first
28
return
getFlashAddrFirstCopy
() + 128 * 1024;
29
}
mcuCanFlashWhileRunning
bool mcuCanFlashWhileRunning()
Definition
mpu_util.cpp:10
getFlashAddrSecondCopy
uintptr_t getFlashAddrSecondCopy()
Definition
mpu_util.cpp:252
getFlashAddrFirstCopy
uintptr_t getFlashAddrFirstCopy()
Definition
mpu_util.cpp:248
flashSectorSize
size_t flashSectorSize(flashsector_t sector)
Get the size of sector.
Definition
mpu_util.cpp:237
flash_int.h
flashsector_t
uint8_t flashsector_t
Index of a sector.
Definition
flash_int.h:89
pch.h
Generated on Sat Sep 27 2025 00:10:06 for rusEFI by
1.9.8