fal_cfg.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Copyright (c) 2006-2023, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2023-03-16 luobeihai 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 (64 * 1024)
  16. #define FLASH_SIZE_GRANULARITY_128K (7 * 128 * 1024)
  17. #define APM32_FLASH_START_ADRESS_16K APM32_FLASH_START_ADRESS
  18. #define APM32_FLASH_START_ADRESS_64K (APM32_FLASH_START_ADRESS_16K + FLASH_SIZE_GRANULARITY_16K)
  19. #define APM32_FLASH_START_ADRESS_128K (APM32_FLASH_START_ADRESS_64K + FLASH_SIZE_GRANULARITY_64K)
  20. extern const struct fal_flash_dev apm32_onchip_flash_16k;
  21. extern const struct fal_flash_dev apm32_onchip_flash_64k;
  22. extern const struct fal_flash_dev apm32_onchip_flash_128k;
  23. /* flash device table */
  24. #define FAL_FLASH_DEV_TABLE \
  25. { \
  26. &apm32_onchip_flash_16k, \
  27. &apm32_onchip_flash_64k, \
  28. &apm32_onchip_flash_128k, \
  29. }
  30. /* ====================== Partition Configuration ========================== */
  31. #ifdef FAL_PART_HAS_TABLE_CFG
  32. /* partition table */
  33. #define FAL_PART_TABLE \
  34. { \
  35. {FAL_PART_MAGIC_WROD, "bootloader", "onchip_flash_16k", 0 , FLASH_SIZE_GRANULARITY_16K , 0}, \
  36. {FAL_PART_MAGIC_WROD, "param", "onchip_flash_64k", 0 , FLASH_SIZE_GRANULARITY_64K , 0}, \
  37. {FAL_PART_MAGIC_WROD, "app", "onchip_flash_128k", 0 , FLASH_SIZE_GRANULARITY_128K, 0}, \
  38. }
  39. #endif /* FAL_PART_HAS_TABLE_CFG */
  40. #endif /* _FAL_CFG_H_ */