Mercurial > public > ostc4
comparison BootLoader/Src/base_bootlader.c @ 1016:0dd92e9b70a2 BootloaderOstc5
Bootloader use compressed fonts:
The previous Bootloader was larger than 128k => not fitting into the first sectors of the second flash bank. Most memory is occupied by the two fonts in use. In order to make the bootloader small enough for the bootloader update function the fonts need to be compressed. To avoid code changes in visualization functions the compressed fonts are decompressed into RAM and then used in the same way as before.
| author | Ideenmodellierer |
|---|---|
| date | Wed, 28 May 2025 17:20:44 +0200 |
| parents | 4ef0511c6665 |
| children | 9d9d506a82d3 |
comparison
equal
deleted
inserted
replaced
| 1015:4ef0511c6665 | 1016:0dd92e9b70a2 |
|---|---|
| 221 #include "stm32f4xx_hal.h" | 221 #include "stm32f4xx_hal.h" |
| 222 #include "stm32f4xx_hal_rcc.h" | 222 #include "stm32f4xx_hal_rcc.h" |
| 223 #include "stm32f4xx_hal_flash_ex.h" | 223 #include "stm32f4xx_hal_flash_ex.h" |
| 224 #include "stm32f4xx_hal_wwdg.h" | 224 #include "stm32f4xx_hal_wwdg.h" |
| 225 | 225 |
| 226 #include "Fonts/Font_T48_plus.h" | 226 #include "font_T48_min.h" |
| 227 #include "font_T24_min.h" | 227 #include "font_T24_min.h" |
| 228 #include "Fonts/image_heinrichs_weikamp.h" | 228 #include "Fonts/image_heinrichs_weikamp.h" |
| 229 | 229 |
| 230 // From Discovery/Inc (shall be shared...) | 230 // From Discovery/Inc (shall be shared...) |
| 231 #include "data_exchange_main.h" | 231 #include "data_exchange_main.h" |
| 236 #include "tStructure.h" | 236 #include "tStructure.h" |
| 237 | 237 |
| 238 // From AC6 support: | 238 // From AC6 support: |
| 239 #include <stdio.h> | 239 #include <stdio.h> |
| 240 #include <string.h> // for memcopy | 240 #include <string.h> // for memcopy |
| 241 | |
| 242 | |
| 243 extern void decompressFont(const tFont* pFont, tImageComp** pFontComp); | |
| 241 | 244 |
| 242 /* Private define ------------------------------------------------------------*/ | 245 /* Private define ------------------------------------------------------------*/ |
| 243 #define BUFFER_SIZE ((uint32_t)0x00177000) | 246 #define BUFFER_SIZE ((uint32_t)0x00177000) |
| 244 #define WRITE_READ_ADDR ((uint32_t)0x0000) | 247 #define WRITE_READ_ADDR ((uint32_t)0x0000) |
| 245 #define REFRESH_COUNT ((uint32_t)0x0569) /* SDRAM refresh counter (90Mhz SD clock) */ | 248 #define REFRESH_COUNT ((uint32_t)0x0569) /* SDRAM refresh counter (90Mhz SD clock) */ |
| 484 if((i == 0) && (callForUpdate == 0)) | 487 if((i == 0) && (callForUpdate == 0)) |
| 485 firmware_JumpTo_Application(); | 488 firmware_JumpTo_Application(); |
| 486 | 489 |
| 487 MX_SPI_Init(); | 490 MX_SPI_Init(); |
| 488 SDRAM_Config(); | 491 SDRAM_Config(); |
| 492 | |
| 493 decompressFont(&FontT24min, (tImageComp**)&FontT24_Comp); | |
| 494 decompressFont(&FontT48min, (tImageComp**)&FontT48_Comp); | |
| 495 | |
| 489 HAL_Delay(100); | 496 HAL_Delay(100); |
| 490 | 497 |
| 491 GFX_init1_no_DMA(&pLayerInvisible, 2); | 498 GFX_init1_no_DMA(&pLayerInvisible, 2); |
| 492 | 499 |
| 493 TIM_BACKLIGHT_init(); | 500 TIM_BACKLIGHT_init(); |
