board.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2021-08-09 supperthomas first version
  9. */
  10. #ifndef __BOARD_H__
  11. #define __BOARD_H__
  12. #include <stm32l4xx.h>
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. #define STM32_FLASH_START_ADRESS ((uint32_t)0x08000000)
  17. #define STM32_FLASH_SIZE (2048 * 1024)
  18. #define STM32_FLASH_END_ADDRESS ((uint32_t)(STM32_FLASH_START_ADRESS + STM32_FLASH_SIZE))
  19. #define STM32_SRAM1_SIZE (640)
  20. #define STM32_SRAM1_START (0x20000000)
  21. #define STM32_SRAM1_END (STM32_SRAM1_START + STM32_SRAM1_SIZE * 1024)
  22. #if defined(__ARMCC_VERSION)
  23. extern int Image$$RW_IRAM1$$ZI$$Limit;
  24. #define HEAP_BEGIN ((void *)&Image$$RW_IRAM1$$ZI$$Limit)
  25. #elif __ICCARM__
  26. #pragma section="CSTACK"
  27. #define HEAP_BEGIN (__segment_end("CSTACK"))
  28. #else
  29. extern int __bss_end;
  30. #define HEAP_BEGIN ((void *)&__bss_end)
  31. #endif
  32. #define HEAP_END STM32_SRAM1_END
  33. void SystemClock_Config(void);
  34. #ifdef __cplusplus
  35. }
  36. #endif
  37. #endif