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.
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: 1000000 parttype: CY_U3P_SIB_LUN_DATA(0xDA)
Create partition idx: 1 port: 0 partCount: 4 partsize: 1000000 parttype: CY_U3P_SIB_LUN_DATA(0xDA)
Create partition idx: 2 port: 0 partCount: 4 partsize: 1000000 parttype: CY_U3P_SIB_LUN_DATA(0xDA)
Create partition idx: 3 port: 0 partCount: 4 partsize: 1000000 parttype: 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. */
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.