board.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. * 2022-02-16 Tuber first version
  9. */
  10. #ifndef __BOARD_H__
  11. #define __BOARD_H__
  12. #include "CH57x_common.h"
  13. #define CH579M_FLASH_START_ADRESS ((uint32_t)0x00000000)
  14. #define FLASH_PAGE_SIZE (64)
  15. #define CH579M_FLASH_SIZE (512 * 1024)
  16. #define CH579M_FLASH_END_ADDRESS ((uint32_t)(CH579M_FLASH_START_ADRESS + CH579M_FLASH_SIZE))
  17. #define CH579M_SRAM_SIZE 32
  18. #define CH579M_SRAM_END (0x20000000 + CH579M_SRAM_SIZE * 1024)
  19. #if defined(__CC_ARM) || defined(__CLANG_ARM)
  20. extern int Image$$RW_IRAM1$$ZI$$Limit;
  21. #define HEAP_BEGIN ((void *)&Image$$RW_IRAM1$$ZI$$Limit)
  22. #elif __ICCARM__
  23. #pragma section="CSTACK"
  24. #define HEAP_BEGIN (__segment_end("CSTACK"))
  25. #else
  26. extern int __bss_end;
  27. #define HEAP_BEGIN ((void *)&__bss_end)
  28. #endif
  29. #define HEAP_END CH579M_SRAM_END
  30. #endif /* __BOARD_H__ */