fal_cfg.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. * 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. #define FLASH_SIZE_GRANULARITY_16K (4 * 16 * 1024)
  15. #define FLASH_SIZE_GRANULARITY_64K (FLASH_SIZE_GRANULARITY_16K + 64 * 1024)
  16. #define FLASH_SIZE_GRANULARITY_128K (FLASH_SIZE_GRANULARITY_64K + 7 * 128 * 1024)
  17. extern const struct fal_flash_dev stm32_onchip_flash_16k;
  18. extern const struct fal_flash_dev stm32_onchip_flash_64k;
  19. extern const struct fal_flash_dev stm32_onchip_flash_128k;
  20. /* flash device table */
  21. #define FAL_FLASH_DEV_TABLE \
  22. { \
  23. &stm32_onchip_flash_16k, \
  24. &stm32_onchip_flash_64k, \
  25. &stm32_onchip_flash_128k, \
  26. }
  27. /* ====================== Partition Configuration ========================== */
  28. #ifdef FAL_PART_HAS_TABLE_CFG
  29. /* partition table */
  30. #define FAL_PART_TABLE \
  31. { \
  32. {FAL_PART_MAGIC_WROD, "bootloader", "onchip_flash_16k", 0 , FLASH_SIZE_GRANULARITY_16K , 0}, \
  33. {FAL_PART_MAGIC_WROD, "param", "onchip_flash_64k", FLASH_SIZE_GRANULARITY_16K , FLASH_SIZE_GRANULARITY_64K , 0}, \
  34. {FAL_PART_MAGIC_WROD, "app", "onchip_flash_128k", FLASH_SIZE_GRANULARITY_64K, FLASH_SIZE_GRANULARITY_128K, 0}, \
  35. }
  36. #endif /* FAL_PART_HAS_TABLE_CFG */
  37. #endif /* _FAL_CFG_H_ */