fal_cfg.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 <board.h>
  13. #include <fal_def.h>
  14. #define FLASH_SIZE_GRANULARITY_16K (4 * 16 * 1024)
  15. #define FLASH_SIZE_GRANULARITY_64K (8 * 64 * 1024)
  16. #define FLASH_SIZE_GRANULARITY_128K (8 * 128 * 1024)
  17. #define STM32_FLASH_START_ADRESS_16K STM32_FLASH_START_ADRESS
  18. #define STM32_FLASH_START_ADRESS_64K STM32_FLASH_START_ADRESS
  19. #define STM32_FLASH_START_ADRESS_128K STM32_FLASH_START_ADRESS
  20. extern const struct fal_flash_dev stm32_onchip_flash_16k;
  21. extern const struct fal_flash_dev stm32_onchip_flash_64k;
  22. extern const struct fal_flash_dev stm32_onchip_flash_128k;
  23. extern struct fal_flash_dev w25q64;
  24. /* flash device table */
  25. #define FAL_FLASH_DEV_TABLE \
  26. { \
  27. &stm32_onchip_flash_128k, \
  28. &w25q64, \
  29. }
  30. /* ====================== Partition Configuration ========================== */
  31. #ifdef BSP_USING_BOOTLOADER
  32. #define FAL_PART_TABLE \
  33. { \
  34. {FAL_PART_MAGIC_WROD, "bootloader", "onchip_flash_128k", 0, 128 * 1024, 0}, \
  35. {FAL_PART_MAGIC_WROD, "app", "onchip_flash_128k", 128 * 1024, 384 * 1024, 0}, \
  36. {FAL_PART_MAGIC_WROD, "easyflash", "W25Q64", 0, 512 * 1024, 0}, \
  37. {FAL_PART_MAGIC_WROD, "download", "W25Q64", 512 * 1024, 1024 * 1024, 0}, \
  38. {FAL_PART_MAGIC_WROD, "wifi_image", "W25Q64", (512 + 1024) * 1024, 512 * 1024, 0}, \
  39. {FAL_PART_MAGIC_WROD, "font", "W25Q64", (512 + 1024 + 512) * 1024, 3 * 1024 * 1024, 0}, \
  40. {FAL_PART_MAGIC_WROD, "filesystem", "W25Q64", (512 + 1024 + 512 + 3 * 1024) * 1024, 3 * 1024 * 1024, 0}, \
  41. }
  42. #else
  43. #define FAL_PART_TABLE \
  44. { \
  45. {FAL_PART_MAGIC_WROD, "app", "onchip_flash_128k", 0, 384 * 1024, 0}, \
  46. {FAL_PART_MAGIC_WROD, "param", "onchip_flash_128k", 384 * 1024, 640 * 1024, 0}, \
  47. {FAL_PART_MAGIC_WROD, "easyflash", "W25Q64", 0, 512 * 1024, 0}, \
  48. {FAL_PART_MAGIC_WROD, "download", "W25Q64", 512 * 1024, 1024 * 1024, 0}, \
  49. {FAL_PART_MAGIC_WROD, "wifi_image", "W25Q64", (512 + 1024) * 1024, 512 * 1024, 0}, \
  50. {FAL_PART_MAGIC_WROD, "font", "W25Q64", (512 + 1024 + 512) * 1024, 3 * 1024 * 1024, 0}, \
  51. {FAL_PART_MAGIC_WROD, "filesystem", "W25Q64", (512 + 1024 + 512 + 3 * 1024) * 1024, 3 * 1024 * 1024, 0}, \
  52. }
  53. #endif /*FAL_PART_TABLE*/
  54. #endif /*BSP_USING_BOOTLOADER*/