diff Discovery/Inc/firmwareEraseProgram.h @ 1017:5924a2d1d3ba GasConsumption

Prepare custom block update function: In the flash area of the font lib some sectors may be used for custom data or a boot updater image. With this change a flash option is added to the maintainance menu. IMPORTANT: The fimwareEraseProgram.c is needed for compiling the firmware now => Add it e.g. by adding a link from the OtherSources location to your source folder.
author Ideenmodellierer
date Thu, 29 May 2025 22:04:46 +0200
parents 5f11787b4f42
children
line wrap: on
line diff
--- a/Discovery/Inc/firmwareEraseProgram.h	Sun May 11 16:18:20 2025 +0200
+++ b/Discovery/Inc/firmwareEraseProgram.h	Thu May 29 22:04:46 2025 +0200
@@ -41,11 +41,42 @@
 #define HARDWAREDATA_ADDRESS	(0x08000000 + 0x0000A040)
 /* Exported functions --------------------------------------------------------*/
 
+ typedef struct
+ {
+ 	// 8 bytes
+ 	uint16_t primarySerial;
+ 	uint8_t primaryLicence;
+ 	uint8_t revision8bit;
+ 	uint8_t production_year;
+ 	uint8_t production_month;
+ 	uint8_t production_day;
+ 	uint8_t production_bluetooth_name_set;
 
+ 	// 44 bytes
+ 	char production_info[44];
+
+ 	// 8 bytes
+ 	uint16_t secondarySerial;
+ 	uint8_t secondaryLicence;
+ 	uint8_t secondaryReason8bit;
+ 	uint8_t secondary_year;
+ 	uint8_t secondary_month;
+ 	uint8_t secondary_day;
+ 	uint8_t secondary_bluetooth_name_set;
+
+ 	// 4 bytes
+ 	char secondary_info[4];
+ } SHardwareData;
+
+
+uint32_t CalcFletcher32(uint32_t startAddr, uint32_t endAddr);
 
 uint8_t firmware_eraseFlashMemory(void);
 uint8_t firmware_programFlashMemory(uint8_t *pBuffer1, uint32_t length1);//, uint8_t *pBuffer2, uint32_t length2)
 
+uint8_t bootloader_eraseFlashMemory(void);
+uint8_t bootloader_programFlashMemory(uint8_t *pBuffer1, uint32_t length1, SHardwareData* pHwInfo);
+
 uint8_t firmware2_variable_upperpart_eraseFlashMemory(uint32_t length, uint32_t offset);
 uint8_t firmware2_variable_upperpart_programFlashMemory(uint32_t length, uint32_t offset, uint8_t *pBuffer1, uint32_t pBuffer1Size, uint8_t *pBuffer2);