Teckna Teckna

Problem Creating MFS Partition MQX 4.0

Discussion created by Teckna Teckna on Apr 22, 2013
Latest reply on Apr 14, 2014 by Sean MacKay

Hi All,

 

I 've developed an application using CW10.2 and MQX 3.8.1.

Now i'am making the porting of all my application on MQX4.0 but i've a problem on MFS driver creating the partiton manager.


In my app on MQX3.8.1 the working procedure was:

1) Install partition manager over my device driver by "_io_part_mgr_install()" instruction

2) Open partition manager by "fopen" instruction

3)Create partition by "ioctl(handle, IO_IOCTL_SET_PARTITION, (uint_32_ptr) &part_info)" instruction

4)Install MFS over partition by  "_io_mfs_install()" instruction.

This procedure was repeated because i have more partion.


Using MQX4.0 and same procedure "ioctl(handle, IO_IOCTL_SET_PARTITION, (uint_32_ptr) &part_info)" instruction return IO_ERROR_DEVICE_BUSY error:

This is the code of  _io_part_mgr_ioctl function in MQX4.0:

 

        case IO_IOCTL_SET_PARTITION:

            if (part_info_ptr->SLOT)

            {

                /* Available only if operating on whole device */

                result = MQX_IO_OPERATION_NOT_AVAILABLE;

                break;

            }

            _lwsem_wait(&pm_struct_ptr->SEM);

            if (pm_struct_ptr->INSTANCES)

            {

                /* Available if this is the only instance to avoid inconsistencies */

                result = IO_ERROR_DEVICE_BUSY;

            }

            else {

                result = _pmgr_set_part_info(pm_struct_ptr, (PMGR_PART_INFO_STRUCT_PTR) param_ptr);

            }

            _lwsem_post(&pm_struct_ptr->SEM);

            break;

 

In MQX3.8.1 it was:

 

        case IO_IOCTL_SET_PARTITION:

            _lwsem_wait(&pt_mgr_ptr->SEM);

            result = _pmgr_set_part_info(pt_mgr_ptr, (PMGR_PART_INFO_STRUCT_PTR) param_ptr, 0);

            _lwsem_post(&pt_mgr_ptr->SEM);        

            break;

 

 

The problem is INSTANCES parameter (a new parameter not present in MQX3.8.1) .

This parameter is incremented in _io_part_mgr_open when i open partition manager therefore when i call ioctl its return is always IO_ERROR_DEVICE_BUSY.

Which is the way to create a partition in MQX4.0?

 

 

 

Outcomes