MQX_INVALID_POINTER task error set when closing a USB device handle after USB disconnection

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MQX_INVALID_POINTER task error set when closing a USB device handle after USB disconnection

637 Views
JanKubiznak
Contributor I

Hello all,

I'd like to report a problem with the USB MSD umount proces. Generally I'm completely able to install and uninstall MFS on USB devices and also to access their file systems. However on every USB device disconnection a task error MQX_INVALID_POINTER is set.

MQX version: 4.1.1

HW: Kinetis70

For installation and uninstallation of MFS on USB I followed the steps described here:

http://cache.freescale.com/files/32bit/doc/app_note/AN3907.pdf

So - when I detect, that a device was attached, then I:

  1. Install USB-MFS device driver.

  2. Open the USB-MFS device driver.

  3. Install the file system driver.

  4. Open the file system driver.

And when I detect, that it was detached, then I:

  1. Close the file system driver.

  2. Uninstall the file system driver.

  3. Close the USB-MFS device driver.

  4. Uninstall the USB-MFS device driver.

And the error comes at the point (3) of the uninstallation.

Here the call stack:

  _task_set_error(MQX_INVALID_POINTER)

  _lwmem_free

  _io_usb_mfs_close

  _io_fclose

  fclose (hUsbDevice)

And here the error detail:

"_mem_free(fd_ptr->DEV_DATA_PTR);" is called from _io_usb_mfs_close(...), but my DEV_DATA_PTR is NULL.

Do I do something wrong? Or is it an MQX USB error?

Labels (2)
0 Kudos
1 Reply

388 Views
soledad
NXP Employee
NXP Employee

Hi Jan Kubiznak,

Did you check the MFS_USB example?

The example illustrates the usage of USB host, MFS and Shell API to deal with the USB memory stick. The application example allows user to perform a set of commands with USB memory stick through the terminal output. This including creating and deleting files, writing to and read reading from files as well as manipulation of directory.

This example is located at the path: C:\Freescale\Freescale_MQX_4_1\mfs\examples\mfs_usb


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos