board.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. * 2009-09-22 Bernard add board.h to this bsp
  9. */
  10. // <<< Use Configuration Wizard in Context Menu >>>
  11. #ifndef __BOARD_H__
  12. #define __BOARD_H__
  13. #include <gd32f3x0.h>
  14. #define EXT_SDRAM_BEGIN (0xC0000000U) /* the begining address of external SDRAM */
  15. #define EXT_SDRAM_END (EXT_SDRAM_BEGIN + (32U * 1024 * 1024)) /* the end address of external SDRAM */
  16. // <o> Internal SRAM memory size[Kbytes] <8-64>
  17. // <i>Default: 64
  18. #ifdef __ICCARM__
  19. // Use *.icf ram symbal, to avoid hardcode.
  20. extern char __ICFEDIT_region_RAM_end__;
  21. #define GD32_SRAM_END &__ICFEDIT_region_RAM_end__
  22. #else
  23. #define GD32_SRAM_SIZE 16
  24. #define GD32_SRAM_END (0x20000000 + GD32_SRAM_SIZE * 1024)
  25. #endif
  26. #ifdef __CC_ARM
  27. extern int Image$$RW_IRAM1$$ZI$$Limit;
  28. #define HEAP_BEGIN (&Image$$RW_IRAM1$$ZI$$Limit)
  29. #elif __ICCARM__
  30. #pragma section="HEAP"
  31. #define HEAP_BEGIN (__segment_end("HEAP"))
  32. #else
  33. extern int __bss_end;
  34. #define HEAP_BEGIN (&__bss_end)
  35. #endif
  36. #define HEAP_END GD32_SRAM_END
  37. #endif
  38. //*** <<< end of configuration section >>> ***