2021-02-26 14:38:17 -08:00
|
|
|
/**
|
|
|
|
* @file mpu_util.cpp
|
|
|
|
*
|
|
|
|
* @date Feb 26, 2021
|
|
|
|
* @author Matthew Kennedy, (c) 2021
|
|
|
|
*/
|
2021-02-05 19:10:59 -08:00
|
|
|
|
2022-04-25 17:38:16 -07:00
|
|
|
#include "pch.h"
|
|
|
|
|
2021-02-26 14:38:17 -08:00
|
|
|
#include "flash_int.h"
|
|
|
|
|
2021-05-28 22:05:29 -07:00
|
|
|
bool allowFlashWhileRunning() {
|
|
|
|
// We only support dual bank H7, so always allow flash while running.
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2021-02-26 14:38:17 -08:00
|
|
|
size_t flashSectorSize(flashsector_t sector) {
|
|
|
|
// All sectors on H7 are 128k
|
|
|
|
return 128 * 1024;
|
|
|
|
}
|
|
|
|
|
|
|
|
uintptr_t getFlashAddrFirstCopy() {
|
|
|
|
return 0x08100000;
|
|
|
|
}
|
|
|
|
|
|
|
|
uintptr_t getFlashAddrSecondCopy() {
|
|
|
|
// Second copy is one sector past the first
|
|
|
|
return getFlashAddrFirstCopy() + 128 * 1024;
|
|
|
|
}
|