Mercurial > public > ostc4
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 1014:8c0134a287da | 1017:5924a2d1d3ba |
|---|---|
| 39 /* Exported types ------------------------------------------------------------*/ | 39 /* Exported types ------------------------------------------------------------*/ |
| 40 | 40 |
| 41 #define HARDWAREDATA_ADDRESS (0x08000000 + 0x0000A040) | 41 #define HARDWAREDATA_ADDRESS (0x08000000 + 0x0000A040) |
| 42 /* Exported functions --------------------------------------------------------*/ | 42 /* Exported functions --------------------------------------------------------*/ |
| 43 | 43 |
| 44 typedef struct | |
| 45 { | |
| 46 // 8 bytes | |
| 47 uint16_t primarySerial; | |
| 48 uint8_t primaryLicence; | |
| 49 uint8_t revision8bit; | |
| 50 uint8_t production_year; | |
| 51 uint8_t production_month; | |
| 52 uint8_t production_day; | |
| 53 uint8_t production_bluetooth_name_set; | |
| 44 | 54 |
| 55 // 44 bytes | |
| 56 char production_info[44]; | |
| 57 | |
| 58 // 8 bytes | |
| 59 uint16_t secondarySerial; | |
| 60 uint8_t secondaryLicence; | |
| 61 uint8_t secondaryReason8bit; | |
| 62 uint8_t secondary_year; | |
| 63 uint8_t secondary_month; | |
| 64 uint8_t secondary_day; | |
| 65 uint8_t secondary_bluetooth_name_set; | |
| 66 | |
| 67 // 4 bytes | |
| 68 char secondary_info[4]; | |
| 69 } SHardwareData; | |
| 70 | |
| 71 | |
| 72 uint32_t CalcFletcher32(uint32_t startAddr, uint32_t endAddr); | |
| 45 | 73 |
| 46 uint8_t firmware_eraseFlashMemory(void); | 74 uint8_t firmware_eraseFlashMemory(void); |
| 47 uint8_t firmware_programFlashMemory(uint8_t *pBuffer1, uint32_t length1);//, uint8_t *pBuffer2, uint32_t length2) | 75 uint8_t firmware_programFlashMemory(uint8_t *pBuffer1, uint32_t length1);//, uint8_t *pBuffer2, uint32_t length2) |
| 76 | |
| 77 uint8_t bootloader_eraseFlashMemory(void); | |
| 78 uint8_t bootloader_programFlashMemory(uint8_t *pBuffer1, uint32_t length1, SHardwareData* pHwInfo); | |
| 48 | 79 |
| 49 uint8_t firmware2_variable_upperpart_eraseFlashMemory(uint32_t length, uint32_t offset); | 80 uint8_t firmware2_variable_upperpart_eraseFlashMemory(uint32_t length, uint32_t offset); |
| 50 uint8_t firmware2_variable_upperpart_programFlashMemory(uint32_t length, uint32_t offset, uint8_t *pBuffer1, uint32_t pBuffer1Size, uint8_t *pBuffer2); | 81 uint8_t firmware2_variable_upperpart_programFlashMemory(uint32_t length, uint32_t offset, uint8_t *pBuffer1, uint32_t pBuffer1Size, uint8_t *pBuffer2); |
| 51 | 82 |
| 52 uint8_t hardware_programmProductionData(uint8_t *buffer52); // uint16_t serial, uint16_t revision, uint8_t year, uint8_t month, uint8_t day, uint8_t sub, uint8_t *info[48] | 83 uint8_t hardware_programmProductionData(uint8_t *buffer52); // uint16_t serial, uint16_t revision, uint8_t year, uint8_t month, uint8_t day, uint8_t sub, uint8_t *info[48] |
