board.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. * 2021-08-15 Jonas first version
  9. */
  10. #ifndef __BOARD_H__
  11. #define __BOARD_H__
  12. #include <hk32f0xx.h>
  13. #include "hk32_msp.h"
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. /* Just only support for HK32F030C8T6 */
  18. #define HK32_FLASH_START_ADRESS ((uint32_t)0x08000000)
  19. #define FLASH_PAGE_SIZE (2 * 1024)
  20. #define HK32_FLASH_SIZE (64 * 1024)
  21. #define HK32_FLASH_END_ADDRESS ((uint32_t)(HK32_FLASH_START_ADRESS + HK32_FLASH_SIZE))
  22. /* Internal SRAM memory size[Kbytes] <10>, Default: 10*/
  23. #define HK32_SRAM_SIZE 10
  24. #define HK32_SRAM_END (0x20000000 + HK32_SRAM_SIZE * 1024)
  25. #if defined(__ARMCC_VERSION)
  26. extern int Image$$RW_IRAM1$$ZI$$Limit;
  27. #define HEAP_BEGIN ((void *)&Image$$RW_IRAM1$$ZI$$Limit)
  28. #elif __ICCARM__
  29. #pragma section="CSTACK"
  30. #define HEAP_BEGIN (__segment_end("CSTACK"))
  31. #else
  32. extern int __bss_end;
  33. #define HEAP_BEGIN ((void *)&__bss_end)
  34. #endif
  35. #define HEAP_END HK32_SRAM_END
  36. #ifdef __cplusplus
  37. }
  38. #endif
  39. #endif /* __BOARD_H__ */