fal_cfg.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2018-12-5 SummerGift first version
  9. */
  10. #ifndef _FAL_CFG_H_
  11. #define _FAL_CFG_H_
  12. #include <rtthread.h>
  13. #include <board.h>
  14. #if defined(BSP_USING_ON_CHIP_FLASH)
  15. extern const struct fal_flash_dev stm32_onchip_flash;
  16. #endif /* BSP_USING_ON_CHIP_FLASH */
  17. /* ========================= Device Configuration ========================== */
  18. #ifdef BSP_USING_ON_CHIP_FLASH
  19. #define ONCHIP_FLASH_DEV &stm32_onchip_flash,
  20. #else
  21. #define ONCHIP_FLASH_DEV
  22. #endif /* BSP_USING_ON_CHIP_FLASH */
  23. /* flash device table */
  24. #define FAL_FLASH_DEV_TABLE \
  25. { \
  26. ONCHIP_FLASH_DEV \
  27. }
  28. /* ====================== Partition Configuration ========================== */
  29. #ifdef FAL_PART_HAS_TABLE_CFG
  30. #ifdef BSP_USING_ON_CHIP_FLASH
  31. #define ONCHIP_FLASH_PATITION {FAL_PART_MAGIC_WROD, "app", "onchip_flash", 0, 496 * 1024, 0}, \
  32. {FAL_PART_MAGIC_WROD, "param", "onchip_flash", 496* 1024, 16 * 1024, 0},
  33. #else
  34. #define ONCHIP_FLASH_PATITION
  35. #endif
  36. /* partition table */
  37. #define FAL_PART_TABLE \
  38. { \
  39. ONCHIP_FLASH_PATITION \
  40. }
  41. #endif /* FAL_PART_HAS_TABLE_CFG */
  42. #endif /* _FAL_CFG_H_ */