rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
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
13#ifdef STM32H723xx
14 return false;
15#else
16 return true;
17#endif
18}
19
20size_t flashSectorSize(flashsector_t /* sector */) {
21 // All sectors on H7 are 128k
22 return 128 * 1024;
23}
24
25static_assert(sizeof(persistent_config_container_s) <= 128 * 1024, "Settings does not fit into flash sector");
26
28#ifdef STM32H723xx
29 return 0x080E0000;
30#else
31 return 0x08100000;
32#endif
33}
34
36#ifdef STM32H723xx
37 return 0;
38#else
39 // Second copy is one sector past the first
40 return getFlashAddrFirstCopy() + 128 * 1024;
41#endif
42}
bool mcuCanFlashWhileRunning()
Definition mpu_util.cpp:10
uintptr_t getFlashAddrSecondCopy()
Definition mpu_util.cpp:252
uintptr_t getFlashAddrFirstCopy()
Definition mpu_util.cpp:248
size_t flashSectorSize(flashsector_t sector)
Get the size of sector.
Definition mpu_util.cpp:237
uint8_t flashsector_t
Index of a sector.
Definition flash_int.h:93