board.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * File : board.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2009, RT-Thread Development Team
  5. *
  6. * The license and distribution terms for this file may be
  7. * found in the file LICENSE in this distribution or at
  8. * http://www.rt-thread.org/license/LICENSE
  9. *
  10. * Change Logs:
  11. * Date Author Notes
  12. * 2009-09-22 Bernard add board.h to this bsp
  13. */
  14. // <<< Use Configuration Wizard in Context Menu >>>
  15. #ifndef __BOARD_H__
  16. #define __BOARD_H__
  17. #include <stm32f4xx.h>
  18. #define MT48LC4M32B2_SIZE (16 * 1024 * 1024)
  19. #define EXT_SDRAM_BEGIN (0xC0000000) /* the begining address of external SDRAM */
  20. #define EXT_SDRAM_END (EXT_SDRAM_BEGIN + MT48LC4M32B2_SIZE) /* the end address of external SDRAM */
  21. // <o> Internal SRAM memory size[Kbytes] <8-64>
  22. // <i>Default: 64
  23. #ifdef __ICCARM__
  24. // Use *.icf ram symbal, to avoid hardcode.
  25. extern char __ICFEDIT_region_RAM_end__;
  26. #define STM32_SRAM_END &__ICFEDIT_region_RAM_end__
  27. #elif __GNUC__
  28. #define STM32_SRAM_SIZE 192
  29. #define STM32_SRAM_END (0x20000000 + STM32_SRAM_SIZE * 1024)
  30. #endif
  31. #ifdef __CC_ARM
  32. extern int Image$$RTT_HEAP$$ZI$$Base;
  33. extern int Image$$RTT_HEAP$$ZI$$Limit;
  34. #define HEAP_BEGIN (&Image$$RTT_HEAP$$ZI$$Base)
  35. #define HEAP_END (&Image$$RTT_HEAP$$ZI$$Limit)
  36. #elif __ICCARM__
  37. #pragma section="HEAP"
  38. #define HEAP_BEGIN (__segment_end("HEAP"))
  39. #define HEAP_END STM32_SRAM_END
  40. #else
  41. extern int __bss_end;
  42. #define HEAP_BEGIN (&__bss_end)
  43. #define HEAP_END STM32_SRAM_END
  44. #endif
  45. // <o> Console on USART: <0=> no console <1=>USART 1 <2=>USART 2 <3=> USART 3
  46. // <i>Default: 1
  47. #define STM32_CONSOLE_USART 1
  48. void rt_hw_board_init(void);
  49. #if STM32_CONSOLE_USART == 0
  50. #define CONSOLE_DEVICE "no"
  51. #elif STM32_CONSOLE_USART == 1
  52. #define CONSOLE_DEVICE "uart1"
  53. #elif STM32_CONSOLE_USART == 2
  54. #define CONSOLE_DEVICE "uart2"
  55. #elif STM32_CONSOLE_USART == 3
  56. #define CONSOLE_DEVICE "uart3"
  57. #endif
  58. #define FINSH_DEVICE_NAME CONSOLE_DEVICE
  59. void Error_Handler(void);
  60. #endif
  61. //*** <<< end of configuration section >>> ***