board.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. #include <drv_sdram.h>
  19. /* board configuration */
  20. // <o> SDCard Driver <1=>SDIO sdcard <0=>SPI MMC card
  21. // <i>Default: 1
  22. #define STM32_USE_SDIO 0
  23. #define IS42S16400J_SIZE 0x400000
  24. // <o>Begin Address of External SDRAM
  25. // <i>Default: 0xD0000000
  26. #define EXT_SDRAM_BEGIN SDRAM_BANK_ADDR /* the begining address of external SDRAM */
  27. // <o>End Address of External SRAM
  28. // <i>Default: 0xD0800000
  29. #define EXT_SDRAM_END SDRAM_BANK_ADDR + IS42S16400J_SIZE /* the end address of external SDRAM */
  30. // </e>
  31. // <o> Internal SRAM memory size[Kbytes] <8-64>
  32. // <i>Default: 64
  33. #ifdef __ICCARM__
  34. // Use *.icf ram symbal, to avoid hardcode.
  35. extern char __ICFEDIT_region_RAM_end__;
  36. #define STM32_SRAM_END &__ICFEDIT_region_RAM_end__
  37. #else
  38. #define STM32_SRAM_SIZE 256
  39. #define STM32_SRAM_END (0x20000000 + STM32_SRAM_SIZE * 1024)
  40. #endif
  41. #ifdef __CC_ARM
  42. extern int Image$$RW_IRAM1$$ZI$$Limit;
  43. #define HEAP_BEGIN (&Image$$RW_IRAM1$$ZI$$Limit)
  44. #elif __ICCARM__
  45. #pragma section="HEAP"
  46. #define HEAP_BEGIN (__segment_end("HEAP"))
  47. #else
  48. extern int __bss_end;
  49. #define HEAP_BEGIN (&__bss_end)
  50. #endif
  51. #define HEAP_END STM32_SRAM_END
  52. // <o> Console on USART: <0=> no console <1=>USART 1 <2=>USART 2 <3=> USART 3
  53. // <i>Default: 1
  54. #define STM32_CONSOLE_USART 2
  55. void rt_hw_board_init(void);
  56. #if STM32_CONSOLE_USART == 0
  57. #define CONSOLE_DEVICE "no"
  58. #elif STM32_CONSOLE_USART == 1
  59. #define CONSOLE_DEVICE "uart1"
  60. #elif STM32_CONSOLE_USART == 2
  61. #define CONSOLE_DEVICE "uart2"
  62. #elif STM32_CONSOLE_USART == 3
  63. #define CONSOLE_DEVICE "uart3"
  64. #endif
  65. #define FINSH_DEVICE_NAME CONSOLE_DEVICE
  66. void Error_Handler(void);
  67. #endif
  68. // <<< Use Configuration Wizard in Context Menu >>>