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

cross mob
BrWu_4382966
Level 1
Level 1
5 replies posted First reply posted First question asked

In my code, based on the cyfx3s_msc example, I would like to have up to 4 user data partitions.

The function arguments are commented (as below) that partCount should be less or equal to 4.

extern CyU3PReturnStatus_t

CyU3PSibPartitionStorage (

uint8_t   portId,                       /**< Storage port to do the partitioning on. */

uint8_t   partCount,                    /**< Total number of partitions required. Should be less than or equal to 4. */

uint32_t *partSizes_p,                  /**< Sizes for each of the first (N - 1) partitions. The remaining storage on the device will be assigned to the last partition. */

uint8_t  *partType_p                    /**< Type for each partition (boot or data partition). */

);

       

My CyU3PSibPartitionStorage call returns CY_U3P_SUCCESS when I provide partCount 4, and four corresponding values for partSizes_p and partType_p.

Create partition idx: 0 port: 0 partCount: 4 partsize[0]: 1000000 parttype[0]: CY_U3P_SIB_LUN_DATA(0xDA)

Create partition idx: 1 port: 0 partCount: 4 partsize[1]: 1000000 parttype[1]: CY_U3P_SIB_LUN_DATA(0xDA)

Create partition idx: 2 port: 0 partCount: 4 partsize[2]: 1000000 parttype[2]: CY_U3P_SIB_LUN_DATA(0xDA)

Create partition idx: 3 port: 0 partCount: 4 partsize[3]: 1000000 parttype[3]: CY_U3P_SIB_LUN_DATA(0xDA)

CyU3PSibPartitionStorage port 0 Created 4 new partitions return code: 0

But when I reboot the device to use the new layout, there only exist two valid user partitions and two new invalid partitions which are marked as type CY_U3P_SIB_LUN_BOOT.

Found a device on port 0

        ... numUnits=6 ...

Dev 0, Unit 0: location=1 numBlocks=8192

Dev 0, Unit 1: location=2 numBlocks=8192

Dev 0, Unit 2: location=0 numBlocks=1000000

Dev 0, Unit 3: location=0 numBlocks=1000000

Dev 0, Unit 4: location=1 numBlocks=8192

Dev 0, Unit 5: location=2 numBlocks=8192

Digging deeper, I looked in the FX3 SDK source zip and the file sdk/firmware/src/storage/cyu3sib_fx3s.c:1301 there is a comment which reads:

/* This function partitions the user area of the card into two. */

CyU3PReturnStatus_t

CyU3PSibPartitionStorage (...)

So can the eMMC user area only be split in two partitions? The CyU3PSibPartitionStorage certainly accepts more and returns a successful result. 

The JEDEC standard (image below) seems to indicate there are always the BOOT1 and BOOT2 partitions and that it should be possible to have four General Purpose Area partitions.  It seems those aren't used and the CyU3PSibPartitionStorage call is just writing a custom Cypress-specific partition table to the eMMC flash itself, is that the case?

Is it possible to eliminate the BOOT1 and BOOT2 partitions? Is there any way to configure 2+ USER data partitions?

Thanks for any help, this is a critical issue for me at the moment.

jedec_emmc_partitions.png

0 Likes
1 Solution

My testing plan is pretty clear in the Linux commands above.  I didn't get to file transfers on Windows because the partitions didn't enumerate properly and matched the issue I was seeing in Linux).  Something that's obviously different between our two approaches is I am using one FX3S with two eMMC flash chips on Storage port 0 and Storage port 1 (which I referred to as Dev0 and Dev1) vs one SD card.

At this point I had to move on and have implemented my own virtual partition table while only relying on CyU3PSibCreatePartition to make one large partition on both flash parts.  My implementation seems to be working well so far and can go far beyond the (arbitrary?) 4 partition limit. Max LUNs for a Mass storage device is 16 I think... I would however like to understand why that API is behaving the way it is...

View solution in original post

0 Likes
7 Replies