board.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * File : board.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  19. *
  20. * Change Logs:
  21. * Date Author Notes
  22. * 2018-05-14 ZYH add board.h to this bsp
  23. */
  24. #ifndef __BOARD_H__
  25. #define __BOARD_H__
  26. #include <stm32l4xx_hal.h>
  27. #ifdef __ICCARM__
  28. // Use *.icf ram symbal, to avoid hardcode.
  29. extern char __ICFEDIT_region_RAM_end__;
  30. #define STM32_SRAM_END &__ICFEDIT_region_RAM_end__
  31. #else
  32. #define STM32_SRAM_SIZE 96
  33. #define STM32_SRAM_END (0x20000000 + STM32_SRAM_SIZE * 1024)
  34. #endif
  35. #ifdef __CC_ARM
  36. extern int Image$$RW_IRAM1$$ZI$$Limit;
  37. #define HEAP_BEGIN (&Image$$RW_IRAM1$$ZI$$Limit)
  38. #elif __ICCARM__
  39. #pragma section="HEAP"
  40. #define HEAP_BEGIN (__segment_end("HEAP"))
  41. #else
  42. extern int __bss_end;
  43. #define HEAP_BEGIN (&__bss_end)
  44. #endif
  45. #define HEAP_END STM32_SRAM_END
  46. extern void rt_hw_board_init(void);
  47. #endif