AnsweredAssumed Answered

Are two partition manager for two primary partitions needed or not?

Question asked by Fabi on Sep 8, 2014
Latest reply on Sep 17, 2014 by Radek Sestak

Hi community,

 

for the partition manager I need some clarification. I've two primary partitions onto one SD card. To access both partitions, I've to setup two partition manager.  Here's the code snipped that works:

 

// Install partition manager over SD card driver, acquire full disk space

result = _io_part_mgr_install ( hdCard, "pm:", 0 );

         // error handling omitted here...

 

// Open partition manager

hdCardPart1 = fopen ( "pm:", NULL );

         // error handling omitted here...

 

// Validate partition 1

param = 1;

result = _io_ioctl ( hdCardPart1, IO_IOCTL_VAL_PART, &param );

if ( result == MQX_OK )

{

    // Install MFS over partition 1

    result = _io_mfs_install ( hdCardPart1, "c:", param );

             // error handling omitted here...

}

 

// Open file system

hd_1 = fopen ( "c:", NULL );

result = ferror ( hd_1 );

         // error handling omitted here...

 

// Open partition manager

hdCardPart2 = fopen ( "pm:", NULL );

         // error handling omitted here...

 

// Validate partition 2

param = 2;

result = _io_ioctl ( hdCardPart2, IO_IOCTL_VAL_PART, &param );

if ( result == MQX_OK )

{

    // Install MFS over partition 2

    result = _io_mfs_install ( hdCardPart2, "d:", param );

             // error handling omitted here...

}

 

hd_2 = fopen ( "d:", NULL );

result = ferror ( hd_2 );

         // error handling omitted here...

 

My question is, why two partition managers (hdCardPart1 and hdCardPart2) are needed?

That is to say, the following code snipped doesn't work:

 

// some code omitted here...

result = _io_mfs_install ( hdCardPart1, "c:", param );

// some code omitted here...

result = _io_mfs_install ( hdCardPart1, "d:", param ); // re-use the first partition manager for second partition -> not working

 

I use MQX 4.0.2.2 on MK60DN512.

 

TY

Outcomes