board.h 946 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Copyright (c) 2006-2018, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2018-05-14 ZYH add board.h to this bsp
  9. */
  10. #ifndef __BOARD_H__
  11. #define __BOARD_H__
  12. #include <stm32l4xx_hal.h>
  13. #ifdef __ICCARM__
  14. // Use *.icf ram symbal, to avoid hardcode.
  15. extern char __ICFEDIT_region_RAM_end__;
  16. #define STM32_SRAM_END &__ICFEDIT_region_RAM_end__
  17. #else
  18. #define STM32_SRAM_SIZE 96
  19. #define STM32_SRAM_END (0x20000000 + STM32_SRAM_SIZE * 1024)
  20. #endif
  21. #if defined(__CC_ARM) || defined(__CLANG_ARM)
  22. extern int Image$$RW_IRAM1$$ZI$$Limit;
  23. #define HEAP_BEGIN (&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 (&__bss_end)
  30. #endif
  31. #define HEAP_END STM32_SRAM_END
  32. extern void rt_hw_board_init(void);
  33. #endif