board.c 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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-11-20 RealThread first version
  9. */
  10. #include <rtthread.h>
  11. #include <board.h>
  12. #include <drv_common.h>
  13. static struct rt_memheap system_heap2;
  14. void rt_hw_board_init()
  15. {
  16. extern void hw_board_init(char *clock_src, int32_t clock_src_freq, int32_t clock_target_freq);
  17. /* Heap initialization */
  18. #if defined(RT_USING_HEAP)
  19. rt_system_heap_init((void *) HEAP_BEGIN1, (void *) HEAP_END1);
  20. rt_memheap_init(&system_heap2, "sram", (void *)RAM2_START, RAM2_SIZE);
  21. #endif
  22. hw_board_init(BSP_CLOCK_SOURCE, BSP_CLOCK_SOURCE_FREQ_MHZ, BSP_CLOCK_SYSTEM_FREQ_MHZ);
  23. /* Set the shell console output device */
  24. #if defined(RT_USING_DEVICE) && defined(RT_USING_CONSOLE)
  25. rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
  26. #endif
  27. /* Board underlying hardware initialization */
  28. #ifdef RT_USING_COMPONENTS_INIT
  29. rt_components_board_init();
  30. #endif
  31. //rt_hw_rtc_init();
  32. }