global_def.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /**
  2. ******************************************************************************
  3. * @file : global_def.h
  4. * @brief : Header for global macro define .
  5. * This file contains the common defines of the application.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * Copyright (c) 2025 STMicroelectronics.
  10. * All rights reserved.
  11. *
  12. * This software is licensed under terms that can be found in the LICENSE file
  13. * in the root directory of this software component.
  14. * If no LICENSE file comes with this software, it is provided AS-IS.
  15. *
  16. ******************************************************************************
  17. */
  18. /* Define to prevent recursive inclusion -------------------------------------*/
  19. #ifndef __GLOBAL_DEF_H
  20. #define __GLOBAL_DEF_H
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. /* Includes ------------------------------------------------------------------*/
  25. #include "stm32l4xx_hal.h"
  26. //控制程序,是否编译为 bootloader, hex 格式
  27. #define IS_BOOTLOADER (1)
  28. #define IAP_BOOTLOAD_ADDRESS 0x8000000 /* define bootload start address */
  29. #define CONFIG_ADDRESS 0x8010000 /* 预留一个页用于存放配置信息 */
  30. #define APP1_ADDRESS 0x8020000 /* define app start address */
  31. #define APP2_ADDRESS 0x8030000 /* start address for ota package */
  32. #define EFLASH_BASE (0x8000000) /* base addr */
  33. #define EFLASH_BANK_SIZE (0x40000) /* blank size */
  34. #define EFLASH_PAGE_SIZE 2048 /* define one-page size */
  35. #define EFLASH_PAGE_NUM 128 /* define APP page num, size=2048*54=108K */
  36. #define APP_SIZE (0x10000) /* 64 KB*/
  37. #define APP2_ADDRESS_END ((uint32_t)(APP2_ADDRESS + APP_SIZE))
  38. /* Exported functions prototypes ---------------------------------------------*/
  39. #ifdef __cplusplus
  40. }
  41. #endif
  42. #endif /* __GLOBAL_DEF_H */