board.h 999 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright (c) 2022-2025, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2025-01-22 chasel first version
  9. */
  10. #ifndef __BOARD_H__
  11. #define __BOARD_H__
  12. #include <rtthread.h>
  13. #include <rtdevice.h>
  14. #include <rthw.h>
  15. #include "mm32_device.h"
  16. #include <hal_common.h>
  17. #include "mm32_msp.h"
  18. #define SRAM_SIZE 0x1C000
  19. #define SRAM_BASE (0x30000000)
  20. #define SRAM_END (SRAM_BASE + SRAM_SIZE)
  21. #ifdef __CC_ARM
  22. extern int Image$$RW_IRAM1$$ZI$$Limit;
  23. #define HEAP_BEGIN ((void *)&Image$$RW_IRAM1$$ZI$$Limit)
  24. #elif __ICCARM__
  25. #pragma section = "HEAP"
  26. #define HEAP_BEGIN (__segment_end("HEAP"))
  27. #else
  28. extern int __bss_end__;
  29. #define HEAP_BEGIN ((void *)&__bss_end__)
  30. #endif
  31. #define HEAP_END SRAM_END
  32. #define HEAP_SIZE (HEAP_END - (rt_uint32_t)HEAP_BEGIN)
  33. extern void rt_hw_board_init(void);
  34. #define CLOCK_SYS_FREQ 120000000u
  35. #define CLOCK_SYSTICK_FREQ (CLOCK_SYS_FREQ/8u)
  36. #endif