Files
STM32F4-Base/Drivers/BSP/GD5F2GQ5UE/fal_cfg.h
2026-07-21 00:30:59 +08:00

64 lines
2.1 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#ifndef __FAL_CFG_H
#define __FAL_CFG_H
/*
* 模块名称FAL 配置
* 模块功能:定义 Flash 物理分区布局和 FAL 设备/分区表
* 适用平台STM32F407ZGT6
* 作者:王建锋
* 创建日期2026-07-16
* 修改记录:
* 2026-07-20 王建锋 统一分区配置,添加 FTL 分区宏供 nand_ftl.c 使用
*/
#ifdef __cplusplus
extern "C" {
#endif
/* ================== 物理分区布局256MB GD5F2GQ5UE ================== */
/*
* 分区名 偏移 大小 块范围 用途
* fdb_kvdb1 0 64MB Block 0~511 FlashDB KVDB
* fdb_tsdb1 64MB 64MB Block 512~1023 FlashDB TSDB
* ftl_fatfs 128MB 128MB Block 1024~2047 dhara FTL + FatFS
*/
#define FDB_KVDB1_OFFSET 0
#define FDB_KVDB1_SIZE (64 * 1024 * 1024)
#define FDB_TSDB1_OFFSET (FDB_KVDB1_OFFSET + FDB_KVDB1_SIZE)
#define FDB_TSDB1_SIZE (64 * 1024 * 1024)
#define FTL_FATFS_OFFSET (FDB_TSDB1_OFFSET + FDB_TSDB1_SIZE)
#define FTL_FATFS_SIZE (128 * 1024 * 1024)
/* ====================== FAL 配置(需 FAL 头文件) ====================== */
#define FAL_DEBUG 0
/* 启用分区表配置FAL 库要求此宏) */
#define FAL_PART_HAS_TABLE_CFG
/* ======================== Flash 设备表 ======================== */
extern const struct fal_flash_dev g_gd5f2gq5ue_flash;
#define FAL_FLASH_DEV_TABLE \
{ \
&g_gd5f2gq5ue_flash, \
}
/* ======================== 分区表 ======================== */
#ifdef FAL_PART_HAS_TABLE_CFG
#define FAL_PART_TABLE \
{ \
{FAL_PART_MAGIC_WORD, "fdb_kvdb1", "gd5f2gq5ue", FDB_KVDB1_OFFSET, FDB_KVDB1_SIZE, 0}, \
{FAL_PART_MAGIC_WORD, "fdb_tsdb1", "gd5f2gq5ue", FDB_TSDB1_OFFSET, FDB_TSDB1_SIZE, 0}, \
}
#endif /* FAL_PART_HAS_TABLE_CFG */
#ifdef __cplusplus
}
#endif
#endif /* __FAL_CFG_H */