fal_cfg.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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-05-17 armink the first version
  9. */
  10. #ifndef _FAL_CFG_H_
  11. #define _FAL_CFG_H_
  12. #include <rtconfig.h>
  13. #include <board.h>
  14. #define NOR_FLASH_DEV_NAME "norflash0"
  15. /* ===================== Flash device Configuration ========================= */
  16. extern struct fal_flash_dev nor_flash0;
  17. extern const struct fal_flash_dev stm32f1_onchip_flash;
  18. /* flash device table */
  19. #define FAL_FLASH_DEV_TABLE \
  20. { \
  21. &stm32f1_onchip_flash, \
  22. &nor_flash0, \
  23. }
  24. /* ====================== Partition Configuration ========================== */
  25. #ifdef FAL_PART_HAS_TABLE_CFG
  26. /* partition table */
  27. //分区表:FAL_PART_MAGIC_WORD,分区名,flash设备名字,起始地址,空间大小,保留0
  28. /*
  29. #define FAL_PART_TABLE \
  30. { \
  31. {FAL_PART_MAGIC_WORD, "bl", "onchip_flash", 0, 200*1024, 0}, \
  32. {FAL_PART_MAGIC_WORD, "app", "onchip_flash", 200*1024, 312*1024, 0}, \
  33. {FAL_PART_MAGIC_WORD, "easyflash", FAL_USING_NOR_FLASH_DEV_NAME, 0, 15*1024*1024, 0}, \
  34. {FAL_PART_MAGIC_WORD, "fm_area", FAL_USING_NOR_FLASH_DEV_NAME, 15*1024*1024, 512*1024, 0}, \
  35. {FAL_PART_MAGIC_WORD, "df_area", FAL_USING_NOR_FLASH_DEV_NAME, 15*1024*1024 + 512*1024, 512*1024, 0}, \
  36. }
  37. */
  38. #define FAL_PART_TABLE \
  39. { \
  40. {FAL_PART_MAGIC_WORD, "bl", "onchip_flash", 0, 200*1024, 0}, \
  41. {FAL_PART_MAGIC_WORD, "app", "onchip_flash", 200*1024, 312*1024, 0}, \
  42. {FAL_PART_MAGIC_WORD, "easyflash", FAL_USING_NOR_FLASH_DEV_NAME, 0, 3*1024*1024, 0}, \
  43. {FAL_PART_MAGIC_WORD, "fm_area", FAL_USING_NOR_FLASH_DEV_NAME, 3*1024*1024, 512*1024, 0}, \
  44. {FAL_PART_MAGIC_WORD, "df_area", FAL_USING_NOR_FLASH_DEV_NAME, 3*1024*1024 + 512*1024, 512*1024, 0}, \
  45. }
  46. #endif /* FAL_PART_HAS_TABLE_CFG */
  47. #endif /* _FAL_CFG_H_ */