board.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * File : board.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2009, RT-Thread Development Team
  5. *
  6. * The license and distribution terms for this file may be
  7. * found in the file LICENSE in this distribution or at
  8. * http://www.rt-thread.org/license/LICENSE
  9. *
  10. * Change Logs:
  11. * Date Author Notes
  12. * 2009-09-22 Bernard add board.h to this bsp
  13. */
  14. // <<< Use Configuration Wizard in Context Menu >>>
  15. #ifndef __BOARD_H__
  16. #define __BOARD_H__
  17. #include <gd32f4xx.h>
  18. #define EXT_SDRAM_BEGIN (0xC0000000U) /* the begining address of external SDRAM */
  19. #define EXT_SDRAM_END (EXT_SDRAM_BEGIN + (32U * 1024 * 1024)) /* the end address of external SDRAM */
  20. // <o> Internal SRAM memory size[Kbytes] <8-64>
  21. // <i>Default: 64
  22. #ifdef __ICCARM__
  23. // Use *.icf ram symbal, to avoid hardcode.
  24. extern char __ICFEDIT_region_RAM_end__;
  25. #define GD32_SRAM_END &__ICFEDIT_region_RAM_end__
  26. #else
  27. #define GD32_SRAM_SIZE 128
  28. #define GD32_SRAM_END (0x20000000 + GD32_SRAM_SIZE * 1024)
  29. #endif
  30. #ifdef __CC_ARM
  31. extern int Image$$RW_IRAM1$$ZI$$Limit;
  32. #define HEAP_BEGIN (&Image$$RW_IRAM1$$ZI$$Limit)
  33. #elif __ICCARM__
  34. #pragma section="HEAP"
  35. #define HEAP_BEGIN (__segment_end("HEAP"))
  36. #else
  37. extern int __bss_end;
  38. #define HEAP_BEGIN (&__bss_end)
  39. #endif
  40. #define HEAP_END GD32_SRAM_END
  41. #endif
  42. //*** <<< end of configuration section >>> ***