board.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright (c) 2006-2024 RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2024-10-23 drifting1024 first implementation
  9. */
  10. #ifndef __BOARD_H__
  11. #define __BOARD_H__
  12. #include "gd32e50x.h"
  13. #include "drv_gpio.h"
  14. #include "gd32e50x_exti.h"
  15. #define EXT_SDRAM_BEGIN (0xC0000000U) /* the begining address of external SDRAM */
  16. #define EXT_SDRAM_END (EXT_SDRAM_BEGIN + (32U * 1024 * 1024)) /* the end address of external SDRAM */
  17. /* <o> Internal SRAM memory size[Kbytes] <96-128>*/
  18. /* <i>Default: 128*/
  19. #ifdef __ICCARM__
  20. /* Use *.icf ram symbal, to avoid hardcode.*/
  21. extern char __ICFEDIT_region_RAM_end__;
  22. #define GD32_SRAM_END &__ICFEDIT_region_RAM_end__
  23. #else
  24. #define GD32_SRAM_SIZE 128
  25. #define GD32_SRAM_END (0x20000000 + GD32_SRAM_SIZE * 1024)
  26. #endif
  27. #ifdef __ARMCC_VERSION
  28. extern int Image$$RW_IRAM1$$ZI$$Limit;
  29. #define HEAP_BEGIN (&Image$$RW_IRAM1$$ZI$$Limit)
  30. #elif __ICCARM__
  31. #pragma section="HEAP"
  32. #define HEAP_BEGIN (__segment_end("HEAP"))
  33. #else
  34. extern int __bss_end;
  35. #define HEAP_BEGIN (&__bss_end)
  36. #endif
  37. #define HEAP_END GD32_SRAM_END
  38. #endif