board.h 2.0 KB

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