fal_cfg.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 "w25q16m"
  15. /* ===================== Flash device Configuration ========================= */
  16. extern const struct fal_flash_dev stm32f1_onchip_flash;
  17. extern struct fal_flash_dev nor_flash0;
  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. //16Mflash
  29. /*
  30. //#define FAL_PART_TABLE \
  31. //{ \
  32. // {FAL_PART_MAGIC_WORD, "bl", "onchip_flash", 0, 200*1024, 0}, \
  33. // {FAL_PART_MAGIC_WORD, "app", "onchip_flash", 200*1024, 312*1024, 0}, \
  34. // {FAL_PART_MAGIC_WORD, "easyflash", FAL_USING_NOR_FLASH_DEV_NAME, 0, 15*1024*1024, 0}, \
  35. // {FAL_PART_MAGIC_WORD, "fm_area", FAL_USING_NOR_FLASH_DEV_NAME, 15*1024*1024, 512*1024, 0}, \
  36. // {FAL_PART_MAGIC_WORD, "df_area", FAL_USING_NOR_FLASH_DEV_NAME, 15*1024*1024 + 512*1024, 512*1024, 0}, \
  37. //}
  38. */
  39. //4Mflash
  40. #define FAL_PART_TABLE \
  41. { \
  42. {FAL_PART_MAGIC_WORD, "bl", "onchip_flash", 0, 200*1024, 0}, \
  43. {FAL_PART_MAGIC_WORD, "app", "onchip_flash", 200*1024, 312*1024, 0}, \
  44. {FAL_PART_MAGIC_WORD, "easyflash", FAL_USING_NOR_FLASH_DEV_NAME, 0, 3*1024*1024, 0}, \
  45. {FAL_PART_MAGIC_WORD, "fm_area", FAL_USING_NOR_FLASH_DEV_NAME, 3*1024*1024, 512*1024, 0}, \
  46. {FAL_PART_MAGIC_WORD, "df_area", FAL_USING_NOR_FLASH_DEV_NAME, 3*1024*1024 + 512*1024, 512*1024, 0}, \
  47. }
  48. #endif /* FAL_PART_HAS_TABLE_CFG */
  49. #endif /* _FAL_CFG_H_ */