PSOC6能否支持4G的QSPI FLASH

公告

大中华汽车电子生态圈社区并入开发者社区- 更多资讯点击此

Tip / 登入 to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Moon_shi
Level 2
Level 2
Distributor - Zenitron(GC)
50 sign-ins 10 questions asked 25 sign-ins

通过配置SMIF tools,只支持256MB,客户硬件使用的时GD4G串行QSPI NANDFLASH,能否支持?

0 点赞
1 解答
ShipingW_81
Moderator
Moderator
Moderator
500 replies posted 250 solutions authored 250 replies posted

XIP模式是把外部flash映射为mcu内部存储空间,最大只有128M。

MMIO模式相当于一普通SPI外设,SMIF block时钟源为HFCLK2,可以根据采用的SPI模式 - dual/quad/octal,估算其数据速率。外部flash的地址长度在MTB中最大可以设为4 bytes(32bit),最大寻址空间为2^32即4GB,一般来说外挂flash大多采用Nor, 至于Nand,需要另行考虑其特性是否支持。

目前我还没有看到有MMIO(非映射)模式的demo code,现有的code都是memory mapped mode,需要在QSPI配置框内将此mode勾掉。

在原帖中查看解决方案

0 点赞
10 回复数
ShipingW_81
Moderator
Moderator
Moderator
500 replies posted 250 solutions authored 250 replies posted

客户是采用哪种模式,XIP还是MMIO?XIP通过内部存储空间映射,只有128M空间,MMIO的空间我再确认下,应该以Modus中设置上限为准。

0 点赞
Moon_shi
Level 2
Level 2
Distributor - Zenitron(GC)
50 sign-ins 10 questions asked 25 sign-ins

Hi ShipingW_81

目前客户测试的时使用XIP,具体的模式没有限定,MMIO模式对速率有多大影响?速率我们要满足客户的需求,

Regards,

Moon

0 点赞
Moon_shi
Level 2
Level 2
Distributor - Zenitron(GC)
50 sign-ins 10 questions asked 25 sign-ins

Hi ShipingW_81,

客戶是否可以使用非内存映射模式,我们有相关的例程吗,组件我这边没有发现QSPI使用间接模式或状态轮训模式的方式,能提供相关的例程工参考吗?

Br,

Moon

0 点赞
ShipingW_81
Moderator
Moderator
Moderator
500 replies posted 250 solutions authored 250 replies posted

XIP模式是把外部flash映射为mcu内部存储空间,最大只有128M。

MMIO模式相当于一普通SPI外设,SMIF block时钟源为HFCLK2,可以根据采用的SPI模式 - dual/quad/octal,估算其数据速率。外部flash的地址长度在MTB中最大可以设为4 bytes(32bit),最大寻址空间为2^32即4GB,一般来说外挂flash大多采用Nor, 至于Nand,需要另行考虑其特性是否支持。

目前我还没有看到有MMIO(非映射)模式的demo code,现有的code都是memory mapped mode,需要在QSPI配置框内将此mode勾掉。

0 点赞
Moon_shi
Level 2
Level 2
Distributor - Zenitron(GC)
50 sign-ins 10 questions asked 25 sign-ins

我看到我们的SMIF组件是有标注MMIO模式的,但是在配置窗口没有看到选型,将XIP模式变成MMIO模式,SPI模式不支持QSPI,

能说明具体如何操作吗?

0 点赞
ShipingW_81
Moderator
Moderator
Moderator
500 replies posted 250 solutions authored 250 replies posted

在Modus QSPI Configurator中从XIP切换为MMIO模式需要把Memory Mapped勾掉

pastedImage_0.png

0 点赞
Moon_shi
Level 2
Level 2
Distributor - Zenitron(GC)
50 sign-ins 10 questions asked 25 sign-ins

Hi ShipingW_81,

之前我尝试过这种方式,这样新建的时候最大的容量是256MB,无法实现512MB的设置?

Thanks,

Moon

0 点赞
ShipingW_81
Moderator
Moderator
Moderator
500 replies posted 250 solutions authored 250 replies posted

256M你具体是怎么设的?我的理解是MMIO模式下,外挂的flash只是一个SPI的slave device,这时候slave寻址的空间是由address字节数决定的,当Memory Mapped模式勾掉之后,后面的地址映射范围那些选项就无需关心了,在configuration选项下可以选择3字节地址或4字节地址,4字节(32bits)地址寻址范围2^32 = 4G, 理论上是可行的,但还要具体看实际应用情况。

pastedImage_0.png

0 点赞
Moon_shi
Level 2
Level 2
Distributor - Zenitron(GC)
50 sign-ins 10 questions asked 25 sign-ins

1.增加新的flash芯片时,需要填写容量;

2.我这边没有看到configuration选项,可能是版本问题;

见附件

SMIF configuration.pngSMIF1.png

0 点赞
ShipingW_81
Moderator
Moderator
Moderator
500 replies posted 250 solutions authored 250 replies posted

在PSoC Creator中SMIF Configuration Tool配置外部flash时,有可能找不到匹配的part number,这种情况下,需要具体修改cy_smif_memconfig.c和cy_smif_memconfig.h文件内容,手动添加所使用的外部flash的配置结构体,其过程跟通过configuration工具添加时完全一样的,对每个结构体的内容针对flash做逐项修改即可,比如外挂4G flash,首先需要修改以下结构体 -

cy_stc_smif_mem_device_cfg_t deviceCfg_flashname_SlaveSlot_1 =

{

    /* Specifies the number of address bytes used by the memory slave device. */

    .numOfAddrBytes = 0x04U,

    /* The size of the memory - 2^32. */

    .memSize = 0x100000000U,

    ... ...

}

我不太确定是否能用起来,你可以试下有没有问题,结合外部flash自身的特性,比如擦写sector大小,外挂4G nand flash之前没有试过的案例。

0 点赞