### SDRAM Cubemx分配的IO和 BSP一致 

野火429的操作

Cubemx  SDRAM1  4bank 13 16bit  16-enabled  

PC0	FMC_SDNWE	n/a	Alternate Function Push Pull

PD0	FMC_D2	n/a	Alternate Function Push Pull	
PD1	FMC_D3	n/a	Alternate Function Push Pull	
PD8	FMC_D13	n/a	Alternate Function Push Pull	
PD9	FMC_D14	n/a	Alternate Function Push Pull	
PD10	FMC_D15	n/a	Alternate Function Push Pull	
PD14	FMC_D0	n/a	Alternate Function Push Pull	
PD15	FMC_D1	n/a	Alternate Function Push Pull	


PE0	FMC_NBL0	n/a	Alternate Function Push Pull	
PE1	FMC_NBL1	n/a	Alternate Function Push Pull
PE7	FMC_D4	n/a	Alternate Function Push Pull	
PE8	FMC_D5	n/a	Alternate Function Push Pull	
PE9	FMC_D6	n/a	Alternate Function Push Pull	
PE10	FMC_D7	n/a	Alternate Function Push Pull
PE11	FMC_D8	n/a	Alternate Function Push Pull	
PE12	FMC_D9	n/a	Alternate Function Push Pull
PE13	FMC_D10	n/a	Alternate Function Push Pull	
PE14	FMC_D11	n/a	Alternate Function Push Pull	
PE15	FMC_D12	n/a	Alternate Function Push Pull	

PF0	FMC_A0	n/a	Alternate Function Push Pull 
PF1	FMC_A1	n/a	Alternate Function Push Pull	
PF2	FMC_A2	n/a	Alternate Function Push Pull
PF3	FMC_A3	n/a	Alternate Function Push Pull	
PF4	FMC_A4	n/a	Alternate Function Push Pull	
PF5	FMC_A5	n/a	Alternate Function Push Pull	

PF11	FMC_SDNRAS	n/a	Alternate Function Push Pull	
PF12	FMC_A6	n/a	Alternate Function Push Pull	
PF13	FMC_A7	n/a	Alternate Function Push Pull
PF14	FMC_A8	n/a	Alternate Function Push Pull
PF15	FMC_A9	n/a	Alternate Function Push Pull

PG0	FMC_A10	n/a	Alternate Function Push Pull	
PG1	FMC_A11	n/a	Alternate Function Push Pull

PG2	FMC_A12	n/a	Alternate Function Push Pull	
PG4	FMC_BA0	n/a	Alternate Function Push Pull
PG5	FMC_BA1	n/a	Alternate Function Push Pull
PG8	FMC_SDCLK	n/a	Alternate Function Push Pull
PG15	FMC_SDNCAS	n/a	Alternate Function Push Pull

PH6	FMC_SDNE1	n/a	Alternate Function Push Pull	
PH7	FMC_SDCKE1	n/a	Alternate Function Push Pull	



| 左对齐 | Port | Port_pin ---> Fmc_pin |
| :-----| ----: | :----: |
| FMC_A0_GPIO_PORT |  GPIOF | ***PF0   ------> FMC_A0***
|FMC_A1_GPIO_PORT    |    GPIOF  | ***PF1   ------> FMC_A1***
|FMC_A2_GPIO_PORT  |   GPIOF  |   | ***PF2   ------> FMC_A2***
|FMC_A3_GPIO_PORT      |  GPIOF     | ***PF3   ------> FMC_A3***
|FMC_A4_GPIO_PORT      |  GPIOF      | ***PF4   ------> FMC_A4***
|FMC_A5_GPIO_PORT      |  GPIOF     | ***PF5   ------> FMC_A5***
|FMC_A6_GPIO_PORT      |  GPIOF    | ***PF12   ------> FMC_A6***
|FMC_A7_GPIO_PORT      |  GPIOF    | ***PF13   ------> FMC_A7***
|FMC_A8_GPIO_PORT      |  GPIOF  | ***PF14   ------> FMC_A8***
|FMC_A9_GPIO_PORT      |  GPIOF  | ***PF15   ------> FMC_A9***
|FMC_A10_GPIO_PORT      |  GPIOG  | ***PG0   ------> FMC_A10***
|FMC_A11_GPIO_PORT      |  GPIOG   | ***PG1   ------> FMC_A11***
|FMC_A12_GPIO_PORT      |  GPIOG   | ***PG2   ------> FMC_A12***
|FMC_D0_GPIO_PORT      |  GPIOD   | ***PD14   ------> FMC_D0***
|FMC_D1_GPIO_PORT      |  GPIOD  | ***PD15   ------> FMC_D1***
|FMC_D2_GPIO_PORT      |  GPIOD   | ***PD0   ------> FMC_D2***
|FMC_D3_GPIO_PORT      |  GPIOD   | ***PD1   ------> FMC_D3***
|FMC_D4_GPIO_PORT      |  GPIOE   | ***PE7   ------> FMC_D4***
|FMC_D5_GPIO_PORT      |  GPIOE   | ***PE8   ------> FMC_D5***
|FMC_D6_GPIO_PORT      |  GPIOE  | ***PE9   ------> FMC_D6***
|FMC_D7_GPIO_PORT      |  GPIOE   | ***PE10   ------> FMC_D7***
|FMC_D8_GPIO_PORT      |  GPIOE  | ***PE11   ------> FMC_D8***
|FMC_D9_GPIO_PORT      |  GPIOE  | ***PE12   ------> FMC_D9***
|FMC_D10_GPIO_PORT      |  GPIOE    | ***PE13   ------> FMC_D10***
|FMC_D11_GPIO_PORT      |  GPIOE   | ***PE14   ------> FMC_D11***
|FMC_D12_GPIO_PORT      |  GPIOE  | ***PE15   ------> FMC_D12***
|FMC_D13_GPIO_PORT      |  GPIOD    | ***PD8   ------> FMC_D13***
|FMC_D14_GPIO_PORT      |  GPIOD    | ***PD9   ------> FMC_D14***
|FMC_D15_GPIO_PORT      |  GPIOD   | ***PD10   ------> FMC_D15***
|FMC_CS_GPIO_PORT      |  GPIOH     | ***PH6   ------> FMC_SDNE1*** CS
|FMC_BA0_GPIO_PORT      |  GPIOG   | ***PG4   ------> FMC_BA0***
|FMC_BA1_GPIO_PORT      |  GPIOG    | ***PG5   ------> FMC_BA1***
|FMC_WE_GPIO_PORT      |  GPIOC   | ***PC0   ------> FMC_SDNWE**  WE
|FMC_RAS_GPIO_PORT      |  GPIOF  | ***PF11   ------> FMC_SDNRAS***
|FMC_CAS_GPIO_PORT      |  GPIOG  | ***PG15   ------> FMC_SDNCAS***
|FMC_CLK_GPIO_PORT      |  GPIOG    | ***PG8   ------> FMC_SDCLK***
|FMC_CKE_GPIO_PORT      |  GPIOH   | ***PH7   ------> FMC_SDCKE1***
|FMC_UDQM_GPIO_PORT      |  GPIOE    | ***PE0   ------> FMC_NBL0***  UDQM
|FMC_LDQM_GPIO_PORT      |  GPIOE    | ***PE1   ------> FMC_NBL1***  LDQM

### nandflash
由于公用数据线

  Cubemx 启用Nandflash2， 无法设置参数

自己   bsp_nand， 重新设置参数初始化
控制 IO， 需要自己初始化 

// IO :  PB13  R/B,  PG9 CE,  PD4  PD5 PD11  PD12
static void HAL_NAND_MspInit_Control_IO(NAND_HandleTypeDef *hnand)



### Malloc
内存分配  FTL  可能用到

需要设置 LD

<!-- MEMORY
{
{
RAM (xrw)       : ORIGIN = 0x20000000, LENGTH = 192K
CCMRAM (xrw)    : ORIGIN = 0x10000000, LENGTH = 64K
FLASH (rx)      : ORIGIN = 0x8000000, LENGTH = 1024K
SDRAM (xrw)	    : ORIGIN = 0xD0000000, LENGTH = 16*1024K 
SDRAMMAP (rw)	: ORIGIN = 0xD1E00000, LENGTH = 1664K 
}
 
} -->

	.sdram (NOLOAD) : 
	{ 
    . = ALIGN(4); 
    _sdram_begin = .; 
    *(.sdram) 
    *(.sdram*) 
    . = ALIGN(4); 
    _sdram_end = .; 
	} >SDRAM 
	.sdrammap (NOLOAD) : 
	{ 
    . = ALIGN(4); 
    __sdrammap_begin = .; 
    *(.sdrammap) 
    *(.sdrammap*) 
    . = ALIGN(4); 
    __sdrammap_end = .; 
	} >SDRAMMAP 


###  FTL

直接整合到 nand Flash？
直接分配系统内存，就2-3k大小


### DMA2D启用
ARGB8888


### LTDC
只能选  RGB565
屏rgb888 16.7 兼容 rgb565
touch  GT911

Cubemx 改不了hbp vbp 的值，需重新初始化去修改

每层的格式为  ARGB8888

  <!-- {
      /*根据液晶数据手册的参数配置*/
    .hbp = 8,  //HSYNC后的无效像素
    .vbp = 2,  //VSYNC后的无效行数

    .hsw = 41,  	//HSYNC宽度
    .vsw = 10,   //VSYNC宽度

    .hfp = 4,  	//HSYNC前的无效像素
    .vfp = 4,  	//VSYNC前的无效行数

    .comment_clock_2byte = 15, //rgb565/argb4444等双字节像素时推荐使用的液晶时钟频率
    .comment_clock_4byte = 15, //Argb8888等四字节像素时推荐使用的液晶时钟频率

    .lcd_pixel_width = 480,//液晶分辨率，宽
    .lcd_pixel_height = 272,//液晶分辨率，高
   
  } -->

****Cubemx 的配置如下，  只有RGB565的配置， 没有RGB888需要的IO配置 ****

 
添加背光  D7  LTDC_BL
LTDC_B4     PG12  --  PI4 , cubemx 改 PI4  LTDC_B4
|LTDC_R0  |LTDC_R1   |LTDC_R2       
|H2  |H3   |H8 
|LTDC_G0  |LTDC_G1   |         
|E5   |E6 | 
|LTDC_B0  |LTDC_B1   |LTDC_B2       
E4   G12  D6 (D6 可能被 NAND2 的Nowait 占用)
 
 所有IO 推挽  上拉 VeryHigh

  LTDC GPIO Configuration 
    PI9     ------> LTDC_VSYNC
    PI10     ------> LTDC_HSYNC
    PF10     ------> LTDC_DE
    PA3     ------> LTDC_B5
    PB0     ------> LTDC_R3
    PB1     ------> LTDC_R6
    PG6     ------> LTDC_R7
    PG7     ------> LTDC_CLK
    PC7     ------> LTDC_G6
    PA11     ------> LTDC_R4
    PA12     ------> LTDC_R5
    PH13     ------> LTDC_G2
    PH15     ------> LTDC_G4
    PI0     ------> LTDC_G5
    PI2     ------> LTDC_G7
    PG10     ------> LTDC_G3
    PG11     ------> LTDC_B3
    PG12     ------> LTDC_B4
    PB8     ------> LTDC_B6
    PB9     ------> LTDC_B7 
 
  PI9   PI10   PI0       PI2  
  PF10
  PA3  PA11   PA12
  PB0  PB1     PB8   PB9 
  PG6  PG7   PG11   PG10  PG12   
  PC7   
  PH13  PH15   

  
    GPIO_InitStruct.Pin = GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_0|GPIO_PIN_2;
    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
    GPIO_InitStruct.Pull = GPIO_NOPULL;
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
    GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
    HAL_GPIO_Init(GPIOI, &GPIO_InitStruct);

    GPIO_InitStruct.Pin = GPIO_PIN_10;
    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
    GPIO_InitStruct.Pull = GPIO_NOPULL;
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
    GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
    HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);

    GPIO_InitStruct.Pin = GPIO_PIN_3|GPIO_PIN_11|GPIO_PIN_12;
    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
    GPIO_InitStruct.Pull = GPIO_NOPULL;
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
    GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
    HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);

    GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1;
    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
    GPIO_InitStruct.Pull = GPIO_NOPULL;
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
    GPIO_InitStruct.Alternate = GPIO_AF9_LTDC;
    HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);

    GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7|GPIO_PIN_11;
    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
    GPIO_InitStruct.Pull = GPIO_NOPULL;
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
    GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
    HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);

    GPIO_InitStruct.Pin = GPIO_PIN_7;
    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
    GPIO_InitStruct.Pull = GPIO_NOPULL;
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
    GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
    HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);

    GPIO_InitStruct.Pin = GPIO_PIN_13|GPIO_PIN_15;
    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
    GPIO_InitStruct.Pull = GPIO_NOPULL;
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
    GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
    HAL_GPIO_Init(GPIOH, &GPIO_InitStruct);

    GPIO_InitStruct.Pin = GPIO_PIN_10|GPIO_PIN_12;
    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
    GPIO_InitStruct.Pull = GPIO_NOPULL;
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
    GPIO_InitStruct.Alternate = GPIO_AF9_LTDC;
    HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);

    GPIO_InitStruct.Pin = GPIO_PIN_8|GPIO_PIN_9;
    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
    GPIO_InitStruct.Pull = GPIO_NOPULL;
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
    GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
    HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);

  
  基本参考正点原子，原子的hsw 这些的定义有些问题

### GT911 驱动

可以参考下野火的 ，有软件IIC 有硬件IIC。 但是野火的软件IIC 有点问题
硬件iic 可以设置一个值，让前端去轮询， 轮询到执行 Scan 获得坐标
可以参考  
https://blog.csdn.net/weixin_38411122/article/details/129241223
https://github.com/oy2n/stm32cube-gt911-dma

touch 可以识别到触点了


### 字体  中文  图片

Display_char 有点问题 

### nandFlash  NorFlash USB虚拟U盘

spiFlash 分区， 配置写入分区
  自己定义在FATFS目录下的文件， 没有被编译 需要改写 user 文件

#### FATFS 修改
1. FATFS/target  目录, 添加 nand_diskio.c  nand_diskio.h
2. FATFS/APP/fatfs.h  引入  nand_diskio.h
3. FATFS.c        MX_FATFS_Init 修改 引入驱动
 引入flash Driver的定义

```C
uint8_t retUSER;    /* Return value for USER */
char USERPath[4];   /* USER logical drive path */
FATFS USERFatFS;    /* File system object for USER logical drive */
FIL USERFile;       /* File object for USER */
```
头文件 extern 出去，供外部引用

在  MX_FATFS_Init 初始化
```C
void MX_FATFS_Init(void)
{
  /*## FatFS: Link the SD driver ###########################*/
  retSD = FATFS_LinkDriver(&SD_Driver, SDPath);
  /*## FatFS: Link the USER driver ###########################*/
  retUSER = FATFS_LinkDriver(&USER_Driver, USERPath);
}
```

    FATFS_LinkDriver 来自 Middlewares/Third_Party/FatFs/ff_gen_drv.c
    SDPATH   UserPath 含有lun 信息, 即盘符 0:  1:

4. ffcong.h  磁盘数量定义
   #define _VOLUMES    1

5. Middlewares/Third_Party/FatFs/ 


    ###  添加文件
    ```C
    extern uint8_t retNAND; /* Return value for USER */
    extern char NANDPath[4]; /* USER logical drive path */
    extern FATFS NANDFatFS; /* File system object for USER logical drive */
    extern FIL NANDFile; /* File object for USER */
    ```
    nand_diskio.h/.c

```C

DSTATUS SPIFlash_initialize (BYTE pdrv);
DSTATUS SPIFlash_status (BYTE pdrv);
DRESULT SPIFlash_read (BYTE pdrv, BYTE *buff, DWORD sector, UINT count);
#if _USE_WRITE == 1
  DRESULT SPIFlash_write (BYTE pdrv, const BYTE *buff, DWORD sector, UINT count);
#endif /* _USE_WRITE == 1 */
#if _USE_IOCTL == 1
  DRESULT SPIFlash_ioctl (BYTE pdrv, BYTE cmd, void *buff);
#endif /* _USE_IOCTL == 1 */

Diskio_drvTypeDef  SPIFlash_Driver =
{
  SPIFlash_initialize,
  SPIFlash_status,
  SPIFlash_read,
#if  _USE_WRITE
  SPIFlash_write,
#endif  /* _USE_WRITE == 1 */
#if  _USE_IOCTL == 1
  SPIFlash_ioctl,
#endif /* _USE_IOCTL == 1 */
};


DSTATUS SPIFlash_initialize (BYTE pdrv       )
{
    Stat = STA_NOINIT;
    return Stat;
}

DSTATUS SPIFlash_status (BYTE pdrv      )
{
    Stat = STA_NOINIT;
    return Stat;
}


DRESULT SPIFlash_read (BYTE pdrv,  BYTE *buff,   DWORD sector, UINT count  )
{
    return RES_OK;
}

#if _USE_WRITE == 1
DRESULT SPIFlash_write (BYTE pdrv, const BYTE *buff, DWORD sector,UINT count)
{

    return RES_OK;

}
#endif  

#if _USE_IOCTL == 1
DRESULT SPIFlash_ioctl (BYTE pdrv, BYTE cmd, void *buff )
{
    DRESULT res = RES_ERROR;
    return res;
}
#endif  
```

前面调用  spiflash

```C
    FATFS fs;                                                    /* FatFs文件系统对象 */
    FIL fnew;                                                    /* 文件对象 */
    FRESULT res_flash;                                            /* 文件操作结果 */
    UINT fnum;                                                      /* 文件成功读写数量 */
    BYTE ReadBuffer[1024]={0};                                    /* 读缓冲区 */
    BYTE WriteBuffer[] = "这是一个测试程序\r\n";

//  /* 挂载外部flash */
    res_flash = f_mount(&fs,"0:",1);
    log_i(" mout res  %d \r\n",res_flash);

//     /* 如果没有文件系统就格式化创建创建文件系统 */
    if(res_flash == FR_NO_FILESYSTEM)
    {
        log_i("fmount no file system");
        /* 格式化 */
        res_flash=f_mkfs("0:",FM_ANY,0,MyBuffer,4096); // FM_ANY 不能为0
        log_i(" mkfs  %d \r\n",res_flash);

        if(res_flash == FR_OK)
        {
            /* 格式化后，先取消挂载 */
            res_flash = f_mount(NULL,"0:",1);
            /* 重新挂载    */
            res_flash = f_mount(&fs,"0:",1);
            log_i("fmount OK..   %d", res_flash);
        }
        else
        {
            /* 红灯常亮 */
            log_i(" format failure ...res : %d ",res_flash);
        }
        /* 绿灯常亮 */
        // HAL_GPIO_WritePin(GPIOB, GPIO_PIN_0, 0);
    }
    else if(res_flash != FR_OK)
    {
        /* 红灯常亮 */
        log_i("fmount failure");
    }

    /* 打开文件，如果没有文件就创建 */
    res_flash = f_open(&fnew, "0:FatFs.txt", FA_CREATE_ALWAYS | FA_WRITE );
    log_i(" f_open  %d \r\n",res_flash);
    if ( res_flash == FR_OK )
    {
        /* 将指定存储区内容写入到文件内 */
        res_flash = f_write(&fnew,WriteBuffer,sizeof(WriteBuffer),&fnum);
        log_i(" f_write  %d \r\n",res_flash);
        if(res_flash == FR_OK)
        {
            /* 蓝灯亮 */
            log_i("write file success ... ");
 
        }
        else
        {
            /* 不再读写，关闭文件 */
            f_close(&fnew);
            /* 红灯常亮 */
            log_i("write file failure");
        }
        /* 不再读写，关闭文件 */
        f_close(&fnew);
    }
    else
    {
        log_i("write file failure ..... ");
    }
````

NANDFLASH 调用FTL的初始化和读写扇区的函数

```C
    FATFS fs;                                                    /* FatFs文件系统对象 */
    FIL fnew;                                                    /* 文件对象 */
    FRESULT res_flash;                                           /* 文件操作结果 */
    UINT fnum;                                                   /* 文件成功读写数量 */
    BYTE ReadBuffer[1024]={0};                                   /* 读缓冲区 */
    BYTE WriteBuffer[] = "这是一个测试程序\r\n";

//  /* 挂载外部flash */
    res_flash = f_mount( &fs,"1:",1);
    // log_i(" mount res  %08X \r\n",NAND_ReadID());
    log_i(" mount res  %d \r\n", res_flash);

//     /* 如果没有文件系统就格式化创建创建文件系统 */
    if(res_flash == FR_NO_FILESYSTEM)
    {
        log_i("fmount no file system");
        /* 格式化 */
        res_flash=f_mkfs("1:",FM_ANY,0,MyBuffer,_MIN_SS); // FM_ANY 不能为0
        if(res_flash == FR_OK)
        {
            log_i(" mkfs  format ok ! " );
            // 格式化后，先取消挂载 /
            res_flash = f_mount(NULL,"1:",1);
            // 重新挂载    
            res_flash = f_mount(&fs,"1:",1);
            log_i("fmount OK..   %d", res_flash);
        }
        else
        {
            log_i(" format failure .... %d ",res_flash);
        }
    }
    else if(res_flash != FR_OK)
    {
        // 红灯常亮  
        log_i("fmount failure");
    }

    /* 打开文件，如果没有文件就创建 */
    res_flash = f_open(&fnew, "1:FatFs.txt", FA_CREATE_ALWAYS | FA_WRITE );
    log_i(" f_open  %d \r\n",res_flash);
    if ( res_flash == FR_OK )
    {
        /* 将指定存储区内容写入到文件内 */
        res_flash = f_write(&fnew,WriteBuffer,sizeof(WriteBuffer),&fnum);
        log_i(" f_write  %d \r\n",res_flash);
        if(res_flash == FR_OK)
        {
            /* 蓝灯亮 */
            log_i("write file success ... ");
        }
        else
        {
            /* 不再读写，关闭文件 */
            f_close(&fnew);
            /* 红灯常亮 */
            log_i("write file failure");
        }
        /* 不再读写，关闭文件 */
        f_close(&fnew);
    }
    else
    {
        log_i("write file failure ..... ");
    }
```

####  USB 虚拟U盘的修改
/USB_DEVICE/App/usbd_storage_if.h
/USB_DEVICE/App/usbd_storage_if.c

HS  FS 
修改盘大小的参数， 读写盘的参数

MX_USB_DEVICE_Init()放任务中 

spiFLASH   需要考虑总的扇区的偏离
nandflash  无需去考虑扇区的偏离

```C
#define STORAGE_LUN_NBR                  2
#define SPIFLASH_BLK_NBR                  0x1700  //  5888*4096 23M, 扣除7M 25M, 扣2M文件系统
#define SPIFLASH_BLK_SIZ                  0x1000
#define NANDFLASH_BLK_NBR                  0x800000   // 有效扇区？ 有效block  952*2048= 0x1DC000, *4 = 0x770000,
#define NANDFLASH_BLK_SIZ                  0x0200  //  page大小 0x800 2048 byte，还是Sector大小 512 0x200
```

以上 Flash 只有5.73M  ，原因暂未查

### lvgl