Skip to content

Commit 76d8276

Browse files
committed
OTA: STM32H7 add OTA magic number constexpr
1 parent f6e784a commit 76d8276

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/ota/implementation/OTASTM32H7.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ OTACloudProcessInterface::State STM32H7OTACloudProcess::flashOTA() {
8383
storageClean();
8484

8585
// this sets the registries in RTC to load the firmware from the storage selected at the next reboot
86-
STM32H747::writeBackupRegister(RTCBackup::DR0, 0x07AA);
86+
STM32H747::writeBackupRegister(RTCBackup::DR0, STM32H747OTA::MAGIC);
8787
STM32H747::writeBackupRegister(RTCBackup::DR1, STM32H747OTA::STORAGE_TYPE);
8888
STM32H747::writeBackupRegister(RTCBackup::DR2, STM32H747OTA::PARTITION);
8989
STM32H747::writeBackupRegister(RTCBackup::DR3, _program_length);

src/ota/implementation/OTASTM32H7.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ namespace STM32H747OTA {
2626
static const uint32_t constexpr STORAGE_TYPE = ((1 << 2) | (1 << 5) | (1 << 7));
2727
/* Default OTA partition */
2828
static const uint32_t constexpr PARTITION = 2;
29+
/* OTA Magic number */
30+
static const uint32_t constexpr MAGIC = 0x07AA;
2931
}
3032

3133
class STM32H7OTACloudProcess: public OTADefaultCloudProcessInterface {

0 commit comments

Comments
 (0)