added magic numbers to M2 7.5"

This commit is contained in:
jjwbruijn
2024-02-16 01:17:11 +01:00
parent 3d125c415f
commit 691b688f46
3 changed files with 14 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
build
*.axf
# Allow
!*.bin
#!*.bin

View File

@@ -46,10 +46,10 @@ extern void dump(const uint8_t *a, const uint16_t l);
#include "oepl_fs.h"
#define SW_VER_CURRENT (0x0000011300000000ull) // top 16 bits are off limits, xxxx.VV.tt.vvvv.mmmm means version V.t.v.m
#define SW_DEFAULT_MAC (0x0000000000000014ull)
#define FW_MAGIC (0x14AFEEBCDC14AE5Aull)
uint64_t __attribute__((section(".ver"))) mCurVersionExport = SW_VER_CURRENT;
uint64_t __attribute__((section(".default_mac"))) default_mac = SW_DEFAULT_MAC;
uint64_t __attribute__((section(".fwmagic"))) magic = FW_MAGIC;
char macStr[32];
char macStr1[32];
@@ -543,6 +543,16 @@ void applyUpdate(uint32_t size) {
setupCLKCalib();
setupRTC(0);
uint64_t test;
FLASH_Read((FLASH_ReadMode_Type)0, fsEnd + 0x0168, (uint8_t *)&test, 8);
if (test != magic) {
printf("Update didn't have the correct magic number!\n");
printf("got %llu\n", test);
delay(1000);
return;
}
showApplyUpdate();
printf("Applying update\r\n");

View File

@@ -17,7 +17,7 @@ SECTIONS
{
KEEP(*(.isr_vector))
KEEP(*(.ver))
KEEP(*(.default_mac))
KEEP(*(.fwmagic))
*(.text*)
KEEP(*(.init))