board.h 1.4 KB

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