/** ****************************************************************************** * @file : global_def.h * @brief : Header for global macro define . * This file contains the common defines of the application. ****************************************************************************** * @attention * * Copyright (c) 2025 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __GLOBAL_DEF_H #define __GLOBAL_DEF_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include "stm32l4xx_hal.h" //控制程序,是否编译为 bootloader, hex 格式 #define IS_BOOTLOADER (1) #define IAP_BOOTLOAD_ADDRESS 0x8000000 /* define bootload start address */ #define CONFIG_ADDRESS 0x8010000 /* 预留一个页用于存放配置信息 */ #define APP1_ADDRESS 0x8020000 /* define app start address */ #define APP2_ADDRESS 0x8030000 /* start address for ota package */ #define EFLASH_BASE (0x8000000) /* base addr */ #define EFLASH_BANK_SIZE (0x40000) /* blank size */ #define EFLASH_PAGE_SIZE 2048 /* define one-page size */ #define EFLASH_PAGE_NUM 128 /* define APP page num, size=2048*54=108K */ #define APP_SIZE (0x10000) /* 64 KB*/ #define APP2_ADDRESS_END ((uint32_t)(APP2_ADDRESS + APP_SIZE)) /* Exported functions prototypes ---------------------------------------------*/ #ifdef __cplusplus } #endif #endif /* __GLOBAL_DEF_H */