Problem with SD card unmount with rtems 4.10.99

ali nasir supremenasir at yahoo.com
Mon Apr 7 03:15:03 UTC 2014


Hi,

I am facing a problem during the SDcard unmount with the rtems 4.10.99 (GIT HEAD). Following sequence is performed during the mount:
1. rtems_io_register_driver .This returns the major number of the device
2. Then create a device (dev) using the call to rtems_filesystem_make_dev_t
3. rtems_disk_io_initialize
4. rtems_disk_create_phys is then called with the device (dev) returned from above call to rtems_filesystem_make_dev_t and the name as /dev/sdc0
5. rtems_bdpart_register_from_disk("/dev/sdc0")
6. rtems_fsmount. The rtems_fstab_entry has two entries. one for the partition (/dev/sdc01) and the other as /dev/sdc0
The above sequence is succesfull.
 
The unmount sequence is as follows:
1. unmount("/mnt/sdcard")
2. rmdir("/mnt/sdcard")
3. Call the rtems_media_get_device_identifier("/dev/sdc01", &dev) to get the dev. Note that here we start with the first partition
4. Call rtems_disk_obtain(dev) to get the disk_device pointer.
5. rtems_bdbuf_syncdev is then called. The pointer returned by disk_obtain is passed here. 
But at this point, i notice that the rtems_disk_obtain returns a NULL pointer and the syncdev crashes. I also see that the dev returned from the call to rtems_media_get_device_identifier does not seem to be correct. It does not give me the correct major number. 
This sequence used to work with the rtems4.10.2. The only difference was that in 4.10.2, the syncdev used to take the 'dev' itself as the argument. In 4.10.2, if this partition was not correctly removed, then all further SD card mount failed and needed a system reset for further mounts.

What is the correct sequence to unmount an existing single partition SDcard with the latest RTEMS?Note that it used to work correct with the 4.10.2
 
I see that there is a media manager also in place? Any example on how to use the media manager?
 
-Ali
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20140406/78bfe5d6/attachment.html>


More information about the users mailing list